#include <IniFile.h>
Inheritance diagram for IniSection:
Public Member Functions | |
IniSection (const char *u) | |
IniSection (const IniParser *p) | |
IniSection (const IniSection &s) | |
void | operator= (const IniSection &s) |
virtual | ~IniSection () |
IniSection (const IniParser *p, string n) | |
void | initValue (const string &key, const string &val, const string &comment, int rb) |
void | initSection (const string &name, const string &comment, int rb, int wb=-2) |
void | initReadBy () |
void | setRewriteBy (int c) |
int | getRewriteBy () |
int | getSubSectionRewriteBy (const char *name) |
void | setEndComment (const char *c) |
const char * | getEndComment () const |
bool | isDirty () |
virtual void | clean () |
IniSection & | findSection (const vector< string > &path, int from=0) |
int | findEndFromUp (const vector< string > &path, int wanted, int found=-1, int from=0) |
void | Dump () |
int | Read (const YCPPath &p, YCPValue &out, bool rewrite) |
int | Dir (const YCPPath &p, YCPList &out) |
int | Write (const YCPPath &p, const YCPValue &v, bool rewrite) |
int | Delete (const YCPPath &p) |
IniIterator | getContainerBegin () |
IniIterator | getContainerEnd () |
IniSection & | getSection (const char *name) |
Private Member Functions | |
void | reindex () |
int | getMyValue (const YCPPath &p, YCPValue &out, int what, int depth) |
int | getValue (const YCPPath &p, YCPValue &out, int what, int depth=0) |
int | getSectionProp (const YCPPath &p, YCPValue &out, int what, int depth=0) |
int | getAll (const YCPPath &p, YCPValue &out, int depth) |
YCPMap | getAllDoIt () |
int | myDir (YCPList &l, IniType what) |
int | dirHelper (const YCPPath &p, YCPList &out, int sections, int depth=0) |
int | setMyValue (const YCPPath &p, const YCPValue &in, int what, int depth) |
int | setValue (const YCPPath &p, const YCPValue &in, int what, int depth=0) |
int | setSectionProp (const YCPPath &p, const YCPValue &in, int what, int depth) |
int | setAll (const YCPPath &p, const YCPValue &in, int depth) |
int | setAllDoIt (const YCPMap &in) |
int | delValue (const YCPPath &p, int depth) |
int | delSection (const YCPPath &p, int depth) |
void | delMyValue (const string &k) |
void | delValue1 (IniEntryIdxIterator exi) |
void | delSection1 (IniSectionIdxIterator sxi) |
int | getValueFlat (const YCPPath &p, YCPValue &out) |
int | setValueFlat (const YCPPath &p, const YCPValue &in) |
int | delValueFlat (const YCPPath &p) |
int | dirValueFlat (const YCPPath &p, YCPList &l) |
Private Attributes | |
const IniParser * | ip |
string | end_comment |
int | rewrite_by |
IniContainer | container |
IniEntryIndex | ivalues |
IniSectionIndex | isections |
|
explicit uninitialized constructor |
|
|
|
Must define an own copy constructor so that the indices point to the copy, not the original |
|
|
|
this is a constructor for newly added sections --> sets dirty
|
|
set all subsection and values to clean Reimplemented from IniBase. |
|
Generic delete for values, sections.
|
|
deletes all values of this name we own
|
|
Delete section on path. Deletes also all its subsections.
|
|
deletes a section we own |
|
Delete value on path
|
|
deletes a section we own |
|
Delete value in flat mode |
|
Generic interface to SCR::Dir |
|
Recursive function to find the one section we want to dir and at last to do dir.
|
|
Get list of values in flat mode. |
|
Dump a section with subsections and subvalues to stdout. |
|
If currently parsed end-section-tag hasn't matched currently processed section by name, we need to find the best possible match by type (read_by). Hence we look for a section on current path which can be closed by found end-section-tag. Note: this function can abort if the path passed in invalid.
|
|
Gets section on a path. Recursive. Attention! This function aborts when it doesn't find the section! Use with care! (Used only by IniParser::parse_helper)
|
|
Get a complete subtree
|
|
Gets data for this section and all its values and subsections Reimplemented from IniBase. |
|
|
|
|
|
|
|
Get a value (or list of them if repeat_names) in this section It would be enough to pass only k instead of p and depth, but then the error messages would not know the whole path
|
|
|
|
Aborts if section doesn't exist! TODO gets any of multiple sections
|
|
Get section property -- comment or read-by
|
|
|
|
Get a value on a path
|
|
Get value in flat mode.
|
|
This function has very special purpose, it ensures that top-section delimiter is not written when saving multiple files. |
|
If section already exist, it is updated only in case, that it isn't dirty.
|
|
If value doesn't exist, creates new, otherwise calls method init of the existing one.
|
|
|
|
Get directory of this section
|
|
|
|
Generic interface to SCR::Read
|
|
build ivalues and isections |
|
Set all properties and values for a section. No recursive creation of the specified path.
|
|
Set all properties and values for a section.
Reimplemented from IniBase. |
|
If there is no comment at the beginning and no values and no sections, it is better to set is as comment at the beginning. Sets also dirty flag.
|
|
Set a value (or list of them if repeat_names) in this section It would be enough to pass only k instead of p and depth, but then the error messages would not know the whole path
|
|
sets dirty flag also |
|
Set section comment or read-by. Creates recursively all non-existing subsections.
|
|
Set value on path. Creates recursively all non-existing subsections.
|
|
Set value in flat mode.
|
|
Generic interface to SCR::Write
|
|
What entries of cvalues and csections are valid Values contained by this section Sections contained by this section |
|
if this is global section, there may be comment at the end this is quite special case, it is impossible to change it |
|
The parser, queried about global settings But once the const is discarded to add to deleted_sections |
|
Index of sections |
|
Index of values |
|
index to IniParser::rewrites for filename - section name mapping It appears that read_by was used for both purposes, causing bug (#19066). |