File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -249,6 +249,9 @@ class INIReader
249249 // Return the list of sections found in ini file
250250 const std::set<std::string> Sections () const ;
251251
252+ // Return the list of keys in the given section
253+ const std::set<std::string> Keys (std::string section) const ;
254+
252255 const std::unordered_map<std::string, std::string> Get (std::string section) const ;
253256
254257 template <typename T = std::string>
@@ -319,6 +322,16 @@ inline const std::set<std::string> INIReader::Sections() const
319322 return retval;
320323}
321324
325+ inline const std::set<std::string> INIReader::Keys (std::string section) const
326+ {
327+ auto const _section = Get (section);
328+ std::set<std::string> retval;
329+ for (auto const & element : _section) {
330+ retval.insert (element.first );
331+ }
332+ return retval;
333+ }
334+
322335inline const std::unordered_map<std::string, std::string> INIReader::Get (std::string section) const {
323336 auto const _section = _values.find (section);
324337 if (_section == _values.end ()) {
You can’t perform that action at this time.
0 commit comments