2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 * Author : Boris Mikhailenko <stg34@ua.fm>
27 $Date: 2009/06/22 16:00:38 $
30 //---------------------------------------------------------------------------
41 //---------------------------------------------------------------------------
43 typedef bool (*StringCaseCmp_t)(const string & str1, const string & str2);
48 mutable map<string, string, StringCaseCmp_t> param_val;
49 mutable map<string, string>::iterator it;
58 CONFIGFILE(const string &fn);
60 const string & GetFileName() const;
62 // 5 ÆÕÎËÃÉÉ Read* ×ÏÚ×ÒÁÝÁÀÔ 0 ÐÒÉ ÕÓÐÅÛÎÏÍ ÓÞÉÔÙ×ÁÎÉÉ
63 // É EINVAL ÐÒÉ ÏÔÓÕÔÓ×ÉÉ ÐÁÒÁÍÅÔÒÁ É ×ÙÓÔÁ×ÌÑÀÔ defaulValue
64 int ReadString(const string & param, char * val, int * maxLen, const char * defaultVal) const;
65 int ReadString(const string & param, string * val, const string & defaultVal) const;
67 int ReadTime (const string & param, time_t *, time_t) const;
69 int ReadShortInt (const string & param, short int *, short int) const;
70 int ReadInt (const string & param, int *, int) const;
71 int ReadLongInt (const string & param, long int *, long int) const;
72 int ReadLongLongInt(const string & param, int64_t *, int64_t) const;
74 int ReadUShortInt (const string & param, unsigned short int *, unsigned short int) const;
75 int ReadUInt (const string & param, unsigned int *, unsigned int) const;
76 int ReadULongInt (const string & param, unsigned long int *, unsigned long int) const;
77 int ReadULongLongInt(const string & param, uint64_t *, uint64_t) const;
79 int ReadDouble (const string & param, double * val, double defaultVal) const;
81 int WriteString(const string & param, const char * val);
82 int WriteString(const string & param, const string & val);
83 int WriteInt (const string & param, int64_t val);
84 int WriteDouble(const string & param, double val);
88 //---------------------------------------------------------------------------