OSDN Git Service

2b75cca5206a2465df016bdd065d0f625b629515
[peercast-im/PeerCastIM.git] / PeerCast.root / PeerCast / core / common / inifile.h
1 // ------------------------------------------------
2 // File : inifile.h
3 // Date: 4-apr-2002
4 // Author: giles
5 // Desc: 
6 //
7 // (c) 2002 peercast.org
8 // ------------------------------------------------
9 // This program is free software; you can redistribute it and/or modify
10 // it under the terms of the GNU General Public License as published by
11 // the Free Software Foundation; either version 2 of the License, or
12 // (at your option) any later version.
13
14 // This program is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 // GNU General Public License for more details.
18 // ------------------------------------------------
19
20 #ifndef _INIFILE
21 #define _INIFILE
22
23 #include "stream.h"
24
25 // -----------------------------------------
26 class IniFile 
27 {
28 public:
29         bool    openReadOnly(const char *);
30         bool    openWriteReplace(const char *);
31         void    close();
32
33         bool    readNext();
34
35         bool    isName(const char *);
36         char *  getName();
37         int             getIntValue();
38         char *  getStrValue();
39         bool    getBoolValue();
40
41         void    writeSection(const char *);
42         void    writeIntValue(const char *, int);
43         void    writeStrValue(const char *, const char *);
44         void    writeBoolValue(const char *, int);
45         void    writeLine(const char *);
46
47
48         FileStream      fStream;
49         char    currLine[256];
50         char    *nameStr,*valueStr;
51 };
52
53 #endif