CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

cfgfile.h

Go to the documentation of this file.
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 __CS_IUTIL_CFGFILE_H__
00020 #define __CS_IUTIL_CFGFILE_H__
00021 
00026 #include "csutil/scf.h"
00027 struct iConfigIterator;
00028 struct iVFS;
00029 
00030 SCF_VERSION(iConfigFile, 0, 0, 2);
00031 
00035 struct iConfigFile : public iBase
00036 {
00038   virtual const char* GetFileName () const = 0;
00039 
00044   virtual iVFS* GetVFS () const = 0;
00045 
00050   virtual void SetFileName (const char*, iVFS*) = 0;
00051 
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 csPtr<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 
00104   virtual int GetInt (const char *Key, int Def = 0) const = 0;
00109   virtual float GetFloat (const char *Key, float Def = 0.0) const = 0;
00114   virtual const char *GetStr (const char *Key, const char *Def = "") const = 0;
00119   virtual bool GetBool (const char *Key, bool Def = false) const = 0;
00121   virtual const char *GetComment (const char *Key) const = 0;
00122 
00124   virtual void SetStr (const char *Key, const char *Val) = 0;
00126   virtual void SetInt (const char *Key, int Value) = 0;
00128   virtual void SetFloat (const char *Key, float Value) = 0;
00130   virtual void SetBool (const char *Key, bool Value) = 0;
00137   virtual bool SetComment (const char *Key, const char *Text) = 0;
00139   virtual void DeleteKey (const char *Key) = 0;
00141   virtual const char *GetEOFComment () const = 0;
00143   virtual void SetEOFComment (const char *Text) = 0;
00144 };
00145 
00146 
00147 SCF_VERSION(iConfigIterator, 0, 0, 1);
00148 
00153 struct iConfigIterator : public iBase
00154 {
00156   virtual iConfigFile *GetConfigFile () const = 0;
00158   virtual const char *GetSubsection () const = 0;
00159 
00161   virtual void Rewind () = 0;
00163   virtual bool Next() = 0;
00164 
00171   virtual const char *GetKey (bool Local = false) const = 0;
00173   virtual int GetInt () const = 0;
00175   virtual float GetFloat () const = 0;
00177   virtual const char *GetStr () const = 0;
00179   virtual bool GetBool () const = 0;
00181   virtual const char *GetComment () const = 0;
00182 };
00185 #endif // __CS_IUTIL_CFGFILE_H__

Generated for Crystal Space by doxygen 1.2.14