|
SectionList::iterator | findSection (std::string_view sectionName) |
| Returns an iterator to the first section with the name sectionName.
|
|
SectionList::const_iterator | findSection (std::string_view sectionName) const |
| Returns an iterator to the first section with the name sectionName.
|
|
SectionList::iterator | findSection (SectionList::iterator after, std::string_view sectionName) |
| Returns an iterator to the first section with the name sectionName which comes after after.
|
|
SectionList::const_iterator | findSection (SectionList::iterator after, std::string_view sectionName) const |
| Returns an iterator to the first section with the name sectionName which comes after after.
|
|
SectionList::iterator | sectionEnd () |
| Returns an iterator that points one past the last section.
|
|
SectionList::const_iterator | sectionEnd () const |
| Returns an iterator that points one past the last section.
|
|
std::optional< FieldList::iterator > | findField (std::string_view sectionName, std::string_view key) |
| Returns an iterator to the first field within the first section with matching sectionName and key.
|
|
std::optional< FieldList::const_iterator > | findField (std::string_view sectionName, std::string_view key) const |
| Returns an iterator to the first field within the first section with matching sectionName and key.
|
|
void | parse (std::istream &inputStream, IniFileParseOptions options=IniFileParseOptions::None) |
| Parses all data from the specified inputStream.
|
|
void | make (std::ostream &outputStream, IniFileMakeOptions options=IniFileMakeOptions::None) |
| Write the current data to the specified outputStream.
|
|
The AdvancedIniFile class allows parsing and writing INI files.
In contrast to IniFile this class preserves
- the difference between absence of an equal sign and an empty value after equal sign.
- the order of the fields within a section.
- alignment of equal signs via extra spaces between key and equal sign.
- comments.
In the following description the word "element" is used to refer to a section or a field.
The parsed data or data to be written is directly exposed via the "sections" member variable of this class. There are also convenience functions to find a particular element.
Since the preceding comment of an element usually belongs to it each element has a "precedingCommentBlock" member variable. If a file ends with a comment an implicit section is added at the end which contains that comment as "precedingCommentBlock". Comments are not stripped from newline and '#' characters. When altering/adding comments be sure to use newline and '#' characters as needed.
Comments appearing in the same line as an element are stored using the "followingInlineComment" member variable.
- Todo
- Support "line continuation", where a backslash followed immediately by EOL (end-of-line) causes the line break to be ignored, and the "logical line" to be continued on the next actual line from the INI file.
Definition at line 79 of file inifile.h.