]> git.tdb.fi Git - libs/datafile.git/commitdiff
Make the File reference in PackSource::Object const
authorMikko Rasa <tdb@tdb.fi>
Sun, 17 Jan 2021 10:42:22 +0000 (12:42 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 17 Jan 2021 10:51:34 +0000 (12:51 +0200)
source/packsource.cpp
source/packsource.h

index f4c06b5deab36260d50b4736009977b569db6270..ec7232aa3f057fb51786d146675142483a788490 100644 (file)
@@ -113,7 +113,7 @@ void PackSource::load(Collection &coll, const CollectionItemTypeBase &type, cons
        if(i==objects.end())
                return;
 
-       File &file = i->second->get_file();
+       const File &file = i->second->get_file();
 
        RefPtr<IO::Base> in = file.open();
        Parser parser(*in, file.get_full_name());
@@ -201,7 +201,7 @@ void PackSource::File::collect_objects(ObjectMap &objs) const
 }
 
 
-PackSource::Object::Object(File &f, const string &n, const string &k):
+PackSource::Object::Object(const File &f, const string &n, const string &k):
        file(f),
        name(n),
        keyword(k)
index 35ec8b87a72eb54572057c04328a329e3d364dad..56590b16cf222f82b5b0c90ad1ab0ce7ecd53c61 100644 (file)
@@ -97,14 +97,14 @@ private:
        class Object
        {
        private:
-               File &file;
+               const File &file;
                std::string name;
                std::string keyword;
 
        public:
-               Object(File &, const std::string &, const std::string &);
+               Object(const File &, const std::string &, const std::string &);
 
-               File &get_file() const { return file; }
+               const File &get_file() const { return file; }
                const std::string &get_name() const { return name; }
                const std::string &get_keyword() const { return keyword; }
        };