Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

cfgfile.h

00001 /*
00002     Copyright (C) 2001 by Martin Geisse <mgeisse@gmx.net>
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     License as published by the Free Software Foundation; either
00007     version 2 of the License, or (at your option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012     Library General Public License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public
00015     License along with this library; if not, write to the Free
00016     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017 */
00018 
00019 #ifndef __IUTIL_CFGFILE_H__
00020 #define __IUTIL_CFGFILE_H__
00021 
00022 #include "csutil/scf.h"
00023 struct iConfigIterator;
00024 struct iVFS;
00025 
00026 SCF_VERSION(iConfigFile, 0, 0, 2);
00027 
00031 struct iConfigFile : public iBase
00032 {
00037   virtual const char* GetFileName () const = 0;
00038 
00043   virtual iVFS* GetVFS () const = 0;
00044 
00049   virtual void SetFileName (const char*, iVFS*) = 0;
00050 
00067   virtual bool Load (const char* iFileName, iVFS* = NULL, bool Merge = false,
00068     bool NewWins = true) = 0;
00069 
00074   virtual bool Save () = 0;
00075 
00082   virtual bool Save (const char *iFileName, iVFS* = NULL) = 0;
00083 
00085   virtual void Clear() = 0;
00086 
00093   virtual iConfigIterator *Enumerate(const char *Subsection = NULL) = 0;
00094 
00096   virtual bool KeyExists(const char *Key) const = 0;
00098   virtual bool SubsectionExists(const char *Subsection) const = 0;
00099 
00101   virtual int GetInt(const char *Key, int Def = 0) const = 0;
00103   virtual float GetFloat(const char *Key, float Def = 0.0) const = 0;
00105   virtual const char *GetStr(const char *Key, const char *Def = "") const = 0;
00107   virtual bool GetBool(const char *Key, bool Def = false) const = 0;
00109   virtual const char *GetComment(const char *Key) const = 0;
00110 
00112   virtual void SetStr (const char *Key, const char *Val) = 0;
00114   virtual void SetInt (const char *Key, int Value) = 0;
00116   virtual void SetFloat (const char *Key, float Value) = 0;
00118   virtual void SetBool (const char *Key, bool Value) = 0;
00125   virtual bool SetComment (const char *Key, const char *Text) = 0;
00127   virtual void DeleteKey(const char *Key) = 0;
00129   virtual const char *GetEOFComment() const = 0;
00131   virtual void SetEOFComment(const char *Text) = 0;
00132 };
00133 
00134 
00135 SCF_VERSION(iConfigIterator, 0, 0, 1);
00136 
00141 struct iConfigIterator : public iBase
00142 {
00144   virtual iConfigFile *GetConfigFile() const = 0;
00146   virtual const char *GetSubsection() const = 0;
00147 
00149   virtual void Rewind () = 0;
00151   virtual bool Next() = 0;
00152 
00159   virtual const char *GetKey(bool Local = false) const = 0;
00161   virtual int GetInt() const = 0;
00163   virtual float GetFloat() const = 0;
00165   virtual const char *GetStr() const = 0;
00167   virtual bool GetBool() const = 0;
00169   virtual const char *GetComment() const = 0;
00170 };
00171 
00172 #endif // __IUTIL_CFGFILE_H__

Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000