#ifndef PICONFIG_H #define PICONFIG_H #include "pifile.h" class PIConfig: public PIFile { public: PIConfig(const string & path); ~PIConfig() {;} string getValue(const string & vname, const string & def = "", bool * exist = 0) const; string getValue(const string & vname, const char * def = "", bool * exist = 0) const; bool getValue(const string & vname, const bool def = false, bool * exist = 0) const; char getValue(const string & vname, const char def = 0, bool * exist = 0) const; short getValue(const string & vname, const short def = 0, bool * exist = 0) const; int getValue(const string & vname, const int def = 0, bool * exist = 0) const; long getValue(const string & vname, const long def = 0, bool * exist = 0) const; uchar getValue(const string & vname, const uchar def = 0, bool * exist = 0) const; ushort getValue(const string & vname, const ushort def = 0, bool * exist = 0) const; uint getValue(const string & vname, const uint def = 0, bool * exist = 0) const; ulong getValue(const string & vname, const ulong def = 0, bool * exist = 0) const; float getValue(const string & vname, const float def = 0., bool * exist = 0) const; double getValue(const string & vname, const double def = 0., bool * exist = 0) const; void setValue(const string & name, const string & value, const string & type = "s", bool write = true); void setValue(const string & name, const char * value, bool write = true); void setValue(const string & name, const bool value, bool write = true); void setValue(const string & name, const char value, bool write = true); void setValue(const string & name, const short value, bool write = true); void setValue(const string & name, const int value, bool write = true); void setValue(const string & name, const long value, bool write = true); void setValue(const string & name, const uchar value, bool write = true); void setValue(const string & name, const ushort value, bool write = true); void setValue(const string & name, const uint value, bool write = true); void setValue(const string & name, const ulong value, bool write = true); void setValue(const string & name, const float value, bool write = true); void setValue(const string & name, const double value, bool write = true); string getValue(int number) const {return settval[number];} string getName(int number) const {return settname[number];} string getComment(int number) const {return settcom[number];} void setValue(int number, const string & value, bool write = true); bool existsValue(const string & name); char getType(int number) const {return setttype[number][0];} int getNumber(const string & name); void setName(int number, const string & name); void setType(int number, const string & type); void setComment(int number, const string & comment); int numValues() const {return settval.size();} void addLine(const string & name, const string & value, const string & type = "s"); void insertLine(int number, const string & name, const string & value, const string & type = "s"); void deleteLine(const string & name); void deleteLine(int number); void readAll(); void writeAll(); private: void parse(); vector settname; vector settval; vector settcom; vector setttab; vector setttype; vector all; vector settlines; int lines; }; #endif // PICONFIG_H