]> git.tdb.fi Git - r2c2.git/commitdiff
Update zone name after loading
authorMikko Rasa <tdb@tdb.fi>
Tue, 25 Mar 2014 14:56:12 +0000 (16:56 +0200)
committerMikko Rasa <tdb@tdb.fi>
Wed, 26 Mar 2014 00:06:41 +0000 (02:06 +0200)
source/libr2c2/zone.cpp
source/libr2c2/zone.h

index dc60a3a2630f13ccb3b02cd2d72ef8d722412799..318c8150df8fca0a0d8e38c55f8b9edde4b97e25 100644 (file)
@@ -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);
index d8488d7da1f58990e3c79f88e189b31fe4bb3f33..86a36e8a45951bafd307ad4f031eb856512efccc 100644 (file)
@@ -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; }