1 #ifndef __GM_CONFIG_SECTIONS_H__ 2 #define __GM_CONFIG_SECTIONS_H__ 7 #include <arc/ArcConfigFile.h> 29 std::list<std::string> section_names;
30 std::string section_indicator;
31 std::string current_section;
32 std::string current_identifier;
33 int current_section_n;
34 std::list<std::string>::iterator current_section_p;
36 bool current_section_changed;
54 operator bool(
void)
const {
return ((fin!=NULL) && (*fin)); };
74 bool ReadNext(std::string& name,std::string& value);
78 const char*
Section(
void)
const {
return current_section.c_str(); };
81 bool SectionNew(
void)
const {
return current_section_changed; };
86 int SectionNum(
void)
const {
return current_section_n; };
92 if(current_section_n<0)
return "";
93 return current_section_p->c_str();
98 if(current_section_n<0)
return "";
99 if(current_section.length() > current_section_p->length())
100 return (current_section.c_str()+current_section_p->length()+1);
117 static int NextArg(
const char* line,std::string &str,
char separator =
' ',
char quotes =
'\0');
121 static std::string
NextArg(std::string &rest,
char separator =
' ',
char quotes =
'\0');
127 #endif // __GM_CONFIG_SECTIONS_H__ Arc namespace contains all core ARC classes.
Definition: ArcConfig.h:11
void SetSectionIndicator(const char *ind=NULL)
Definition: ArcConfigIni.h:65
static int NextArg(const char *line, std::string &str, char separator=' ', char quotes='\0')
Definition: ArcConfigIni.h:25
const char * SubSectionMatch(const char *name)
const char * Section(void) const
Definition: ArcConfigIni.h:78
const char * SectionMatch(void) const
Definition: ArcConfigIni.h:91
int SectionNum(void) const
Definition: ArcConfigIni.h:86
bool ReadNext(std::string &line)
~ConfigIni(void)
Ordinary destructor.
const char * SubSection(void) const
Returns name of subsection to which last read line belongs.
Definition: ArcConfigIni.h:97
Definition: ArcConfigFile.h:14
bool AddSection(const char *name)
bool SectionNew(void) const
Returns true if last ReadNext() switched to next section.
Definition: ArcConfigIni.h:81
const char * SectionIdentifier(void) const
Return identifier of the section to which last read line belongs.
Definition: ArcConfigIni.h:110