]> git.tdb.fi Git - libs/datafile.git/commitdiff
Update Variant API usage
authorMikko Rasa <tdb@tdb.fi>
Sun, 3 Sep 2023 23:07:26 +0000 (02:07 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 3 Sep 2023 23:07:26 +0000 (02:07 +0300)
source/collection.h

index a0717cfd8fc44746f1f59c215c2a14ab2ce1f043..fc5ac3c0bea652602f4f7afc8dbe86db5d31f458 100644 (file)
@@ -234,7 +234,7 @@ private:
                        return get_status(name, *type);
 
                ItemMap::const_iterator i = items.find(name);
-               return (i!=items.end() && i->second.check_type<RefPtr<T> >());
+               return (i!=items.end() && i->second.has_type<RefPtr<T> >());
        }
 
 public:
@@ -256,7 +256,7 @@ public:
                typedef RefPtr<typename std::remove_cv<T>::type> RPNCT;
 
                for(const auto &kvp: items)
-                       if(kvp.second.check_type<RPNCT>())
+                       if(kvp.second.has_type<RPNCT>())
                                if(kvp.second.value<RPNCT>().get()==d)
                                        return kvp.first;
        
@@ -456,7 +456,7 @@ public:
        { return dynamic_cast<const CollectionItemType<T> *>(&other); }
 
        bool check_item_type(const Variant &var) const override
-       { return var.check_type<RefPtr<T> >(); }
+       { return var.has_type<RefPtr<T> >(); }
 
        void add_to_loader(Collection::Loader &) const override
        { }
@@ -508,7 +508,7 @@ public:
 template<typename T>
 T &Collection::extract(const Variant &var) const
 {
-       if(!var.check_type<RefPtr<T> >())
+       if(!var.has_type<RefPtr<T> >())
                if(CollectionItemTypeBase *type = get_type_for_item(var))
                        if(T *item = type->extract<T>(var))
                                return *item;