Main Page   Class Hierarchy   Compound List   File List   Compound Members  

resConfigRegistryUnix.h

00001 //////////////////////////////////////////////////////////////////////
00002 // Copyright (c) 2001-2002 David Pritchard <drpritch@alumni.uwaterloo.ca>
00003 // 
00004 // This program is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public License
00006 // as published by the Free Software Foundation; either
00007 // version 2 of the License, or (at your option) any later
00008 // version.
00009 // 
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU Lesser General Public License for more details.
00014 // 
00015 // You should have received a copy of the GNU Lesser General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 
00019 #ifndef freecloth_resmgt_resConfigRegistryUnix_h
00020 #define freecloth_resmgt_resConfigRegistryUnix_h
00021 
00022 #ifndef freecloth_resmgt_package_h
00023 #include <freecloth/resmgt/package.h>
00024 #endif
00025 
00026 #ifndef freecloth_resmgt_resConfigRegistry_h
00027 #include <freecloth/resmgt/resConfigRegistry.h>
00028 #endif
00029 
00030 #ifndef freecloth_base_map
00031 #include <freecloth/base/map>
00032 #endif
00033 
00034 #ifndef freecloth_base_fstream
00035 #include <freecloth/base/fstream>
00036 #endif
00037 
00038 FREECLOTH_NAMESPACE_START
00039 
00040 ////////////////////////////////////////////////////////////////////////////////
00041 // FORWARD DECLARATIONS
00042 
00043 ////////////////////////////////////////////////////////////////////////////////
00044 // CLASS ResConfigRegistryWUnix
00045 //
00046 // Configuration writer for Unix, using registry keys.
00047 //
00048 class ResConfigRegistryWUnix : public ResConfigRegistryW {
00049 
00050 public:
00051     //----- member functions -----
00052 
00053     ResConfigRegistryWUnix( const String& filename );
00054     virtual ~ResConfigRegistryWUnix();
00055 
00056     virtual void writeString(
00057         const String& key,
00058         const String& value
00059     );
00060 
00061 private:
00062     //----- data members -----
00063 
00064     std::ofstream out;
00065 };
00066 
00067 ////////////////////////////////////////////////////////////////////////////////
00068 // CLASS ResConfigRegistryRUnix
00069 //
00070 // Configuration reader for Unix, using registry keys.
00071 //
00072 class ResConfigRegistryRUnix : public ResConfigRegistryR {
00073 
00074 public:
00075     //----- member functions -----
00076 
00077     ResConfigRegistryRUnix( const String& filename );
00078     virtual ~ResConfigRegistryRUnix();
00079 
00080     virtual bool hasKey( const String& key ) const;
00081 
00082     virtual String readString(
00083         const String& key,
00084         const String& def
00085     ) const;
00086 
00087 private:
00088     std::map<String,String> _keys;
00089 };
00090 
00091 FREECLOTH_NAMESPACE_END
00092 
00093 #endif

Generated on Wed Apr 23 15:58:52 2003 for Freecloth by doxygen1.3-rc3