Expose some ways to manage an INI file.

This is required for our later INI file loaders and savers
This commit is contained in:
Ryan Houdek 2016-01-14 16:38:06 -06:00 committed by Léo Lam
parent a2f5c3dbe0
commit 85c3e677da

View file

@ -76,11 +76,15 @@ public:
bool Get(const std::string& key, std::vector<std::string>* values) const;
bool operator<(const Section& other) const { return name < other.name; }
using SectionMap = std::map<std::string, std::string, CaseInsensitiveStringCompare>;
const std::string& GetName() const { return name; }
const SectionMap& GetValues() const { return values; }
protected:
std::string name;
std::vector<std::string> keys_order;
std::map<std::string, std::string, CaseInsensitiveStringCompare> values;
SectionMap values;
std::vector<std::string> lines;
};
@ -140,6 +144,7 @@ public:
// In particular it is used in PostProcessing for its configuration
static void ParseLine(const std::string& line, std::string* keyOut, std::string* valueOut);
const std::list<Section>& GetSections() const { return sections; }
private:
std::list<Section> sections;