From: Mikko Rasa Date: Tue, 25 Mar 2014 14:56:12 +0000 (+0200) Subject: Update zone name after loading X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=c8c39c4256af8676d46063db88048d809cc2ee5f;p=r2c2.git Update zone name after loading --- diff --git a/source/libr2c2/zone.cpp b/source/libr2c2/zone.cpp index dc60a3a..318c815 100644 --- a/source/libr2c2/zone.cpp +++ b/source/libr2c2/zone.cpp @@ -38,6 +38,11 @@ void Zone::set_name(const string &g, const string &q, unsigned n) qualifier = q; number = n; + update_name(); +} + +void Zone::update_name() +{ string full_name = group; if(!qualifier.empty()) { @@ -75,6 +80,11 @@ Zone::Loader::Loader(Zone &z): add("qualifier", &Zone::qualifier); } +void Zone::Loader::finish() +{ + obj.update_name(); +} + void Zone::Loader::block(unsigned b) { Block &blk = obj.layout.get_block(b); diff --git a/source/libr2c2/zone.h b/source/libr2c2/zone.h index d8488d7..86a36e8 100644 --- a/source/libr2c2/zone.h +++ b/source/libr2c2/zone.h @@ -19,6 +19,7 @@ public: public: Loader(Zone &); private: + virtual void finish(); void block(unsigned); }; @@ -33,6 +34,9 @@ public: virtual void set_name(const std::string &); void set_name(const std::string &, const std::string &, unsigned); +private: + void update_name(); +public: const std::string &get_group() const { return group; } const std::string &get_qualifier() const { return qualifier; } unsigned get_number() const { return number; }