void BinaryWriter::write_string(const StringType::Store &s)
{
- StringMap::const_iterator i = strings.find(s);
+ auto i = strings.find(s);
if(i!=strings.end())
write_int(-static_cast<int>(i->second));
else
const Variant *Collection::find_var(const string &name, const CollectionItemTypeBase *type)
{
- ItemMap::iterator i = items.find(name);
+ auto i = items.find(name);
if(i!=items.end())
return &i->second;
unsigned Collection::get_status(const string &name, const CollectionItemTypeBase &type) const
{
- ItemMap::const_iterator i = items.find(name);
+ auto i = items.find(name);
if(i==items.end())
{
auto j = find_if(sources, [&name, &type](const CollectionSource *s){ return s->is_loadable(type, name); });
template<typename T>
T *find(const std::string &name) const
{
- ItemMap::const_iterator i = items.find(name);
+ auto i = items.find(name);
return (i!=items.end() ? extract<typename std::remove_cv<T>::type>(i->second) : 0);
}
if(CollectionItemTypeBase *type = get_type<T>())
return get_status(name, *type);
- ItemMap::const_iterator i = items.find(name);
+ auto i = items.find(name);
return (i!=items.end() && i->second.has_type<std::shared_ptr<T>>());
}
bool DirectorySource::lookup_file(const string &name, FS::Path &result) const
{
- ObjectMap::const_iterator i = objects.find(name);
+ auto i = objects.find(name);
if(i==objects.end())
return false;
void PackSource::translate_maps(const PackSource &other)
{
- for(list<Pack>::const_iterator i=packs.begin(), j=other.packs.begin(); (i!=packs.end() && j!=other.packs.end()); ++i, ++j)
+ for(auto i=packs.begin(), j=other.packs.begin(); (i!=packs.end() && j!=other.packs.end()); ++i, ++j)
i->translate_files(files, *j);
- for(FileMap::const_iterator i=files.begin(), j=other.files.begin(); (i!=files.end() && j!=other.files.end()); ++i, ++j)
+ for(auto i=files.begin(), j=other.files.begin(); (i!=files.end() && j!=other.files.end()); ++i, ++j)
i->second->translate_objects(objects, *j->second);
}