Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
scarsty committed Sep 15, 2023
1 parent e000c19 commit c98829f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions INIReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ class INIReader
else
{
std::list<Record<T>>::emplace_back(key, T());
auto p = &std::list<Record<T>>::back().value;
index.insert(std::pair(key1, p));
T* p = &std::list<Record<T>>::back().value;
index.insert({ key1, p });
return *p;
}
}
const T& at(const std::string& key) const
{
return *index.at(key);
return *index.at(COM_METHOD()(key));
}
int count(const std::string& key) const
{
return index.count(key);
return index.count(COM_METHOD()(key));
}
};

Expand Down Expand Up @@ -85,7 +85,7 @@ class INIReader
}
const int count(const std::string& key) const
{
return sections.index.count(key);
return sections.index.count(COM_METHOD()(key));
}
void erase(const std::string& key)
{
Expand All @@ -94,7 +94,7 @@ class INIReader
{
return &sec.value == &it;
});
sections.index.erase(key);
sections.index.erase(COM_METHOD()(key));
}
std::vector<std::string> getAllKeys() const
{
Expand Down Expand Up @@ -350,7 +350,7 @@ class INIReader
//check one section exist or not
int hasSection(const std::string& section) const
{
return keys.sections.index.count(section);
return keys.count(section);
}

//check one section and one key exist or not
Expand Down

0 comments on commit c98829f

Please sign in to comment.