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

/home/jeroen/FOX/fox/fox-1.7.33/include/FXRegistry.h
00001 /********************************************************************************
00002 *                                                                               *
00003 *                           R e g i s t r y   C l a s s                         *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1998,2012 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or modify          *
00009 * it under the terms of the GNU Lesser General Public License as published by   *
00010 * the Free Software Foundation; either version 3 of the License, or             *
00011 * (at your option) any later version.                                           *
00012 *                                                                               *
00013 * This library is distributed in the hope that it will be useful,               *
00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                 *
00016 * GNU Lesser General Public License for more details.                           *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public License      *
00019 * along with this program.  If not, see <http://www.gnu.org/licenses/>          *
00020 ********************************************************************************/
00021 #ifndef FXREGISTRY_H
00022 #define FXREGISTRY_H
00023 
00024 #ifndef FXSETTINGS_H
00025 #include "FXSettings.h"
00026 #endif
00027 
00028 namespace FX {
00029 
00030 
00059 class FXAPI FXRegistry : public FXSettings {
00060   FXDECLARE(FXRegistry)
00061 protected:
00062   FXString applicationkey;  // Application key
00063   FXString vendorkey;       // Vendor key
00064   FXString systemdirs;      // System-wide settings directories
00065   FXString userdir;         // User settings directory
00066   FXbool   ascii;           // ASCII file-based registry
00067 protected:
00068 #if defined(WIN32)
00069   FXbool readFromRegistry(void* hRootKey,FXbool mark);
00070   FXbool readFromRegistryGroup(void* org,const char* groupname,FXbool mark=false);
00071   FXbool writeToRegistry(void* hRootKey);
00072   FXbool writeToRegistryGroup(void* org,const char* groupname);
00073 #endif
00074 private:
00075   FXRegistry(const FXRegistry&);
00076   FXRegistry &operator=(const FXRegistry&);
00077 public:
00078 
00083   FXRegistry(const FXString& akey=FXString::null,const FXString& vkey=FXString::null);
00084 
00089   void setAsciiMode(FXbool asciiMode){ ascii=asciiMode; }
00090 
00092   FXbool getAsciiMode() const { return ascii; }
00093 
00095   void setAppKey(const FXString& name){ applicationkey=name; }
00096 
00098   const FXString& getAppKey() const { return applicationkey; }
00099 
00101   void setVendorKey(const FXString& name){ vendorkey=name; }
00102 
00104   const FXString& getVendorKey() const { return vendorkey; }
00105 
00107   void setSystemDirectories(const FXString& dirs){ systemdirs=dirs; }
00108 
00110   const FXString& getSystemDirectories() const { return systemdirs; }
00111 
00113   void setUserDirectory(const FXString& dir){ userdir=dir; }
00114 
00116   const FXString& getUserDirectory() const { return userdir; }
00117 
00119   virtual FXbool read();
00120 
00122   virtual FXbool write();
00123 
00125   static const FXchar ext[];
00126 
00128   static const FXchar foxrc[];
00129 
00131   virtual ~FXRegistry();
00132   };
00133 
00134 }
00135 
00136 #endif

Copyright © 1997-2011 Jeroen van der Zijp