Main Page   Class Hierarchy   Compound List   File List   Compound Members  

kconfig.h

00001 // vi:ts=4:shiftwidth=4:expandtab
00002 /*
00003    This file is part of the KDE libraries
00004    Copyright (c) 1999 Preston Brown <pbrown@kde.org>
00005    Copyright (C) 1997 Matthias Kalle Dalheimer <kalle@kde.org>
00006    Copyright (C) 2002 Zhang Le <ejoy@users.sourceforge.net>
00007    Last Change:20-Jul-2002.
00008 
00009    This library is free software; you can redistribute it and/or
00010    modify it under the terms of the GNU Library General Public
00011    License as published by the Free Software Foundation; either
00012    version 2 of the License, or (at your option) any later version.
00013 
00014    This library is distributed in the hope that it will be useful,
00015    but WITHOUT ANY WARRANTY; without even the implied warranty of
00016    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017    Library General Public License for more details.
00018 
00019    You should have received a copy of the GNU Library General Public License
00020    along with this library; see the file COPYING.LIB.  If not, write to
00021    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00022    Boston, MA 02111-1307, USA.
00023 */
00024 
00025 // $Id: kconfig.h,v 1.1.1.1 2002/12/01 04:08:23 zl Exp $
00026 
00027 #ifndef _KCONFIG_H
00028 #define _KCONFIG_H
00029 
00030 
00031 #include "kconfigbase.h"
00032 
00033 namespace config {
00034 
00035 class KConfigPrivate;
00036 
00047 class KConfig : public KConfigBase
00048 {
00049 
00050 public:
00062   KConfig( const string& fileName = "",
00063           bool bReadOnly = false, bool bUseKDEGlobals = true, const char *resType="config");
00064 
00071   virtual ~KConfig();
00072 
00085   virtual void rollback(bool bDeep = true);
00086 
00087 
00091   virtual vector<string> groupList() const;
00092 
00104   virtual map<string, string> entryMap(const string &pGroup) const;
00105 
00110   virtual void reparseConfiguration();
00111 
00117   void setFileWriteMode(int mode);
00118 
00124   void setForceGlobal( bool force ) { bForceGlobal = force; }
00125 
00130   bool forceGlobal() const { return bForceGlobal; }
00131     
00132 protected:
00133 
00140   virtual bool internalHasGroup(const string &group) const;
00141 
00152   virtual KEntryMap internalEntryMap(const string &pGroup) const;
00153 
00164    virtual KEntryMap internalEntryMap() const { return aEntryMap; }
00165 
00176   virtual void putData(const KEntryKey &_key, const KEntry &_data, bool _checkGroup=true);
00177 
00186   virtual KEntry lookupData(const KEntryKey &_key) const;
00187 
00195   KEntryMap aEntryMap;
00196 
00197 private:
00202   KConfig( const KConfig& );
00207   KConfig& operator= ( const KConfig& rConfig );
00208 
00209 private:
00210   bool bGroupImmutable : 1; // Current group is immutable.
00211   bool bFileImmutable  : 1; // Current file is immutable.
00212   bool bForceGlobal    : 1; // Apply everything to kdeglobals.
00213 protected:
00214   virtual void virtual_hook( int id, void* data );
00215 private:
00216   KConfigPrivate *d;
00217 };
00218 
00219 }; //namespace config
00220 
00221 #endif

Generated on Sat Dec 14 20:05:52 2002 for libconfig by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002