registry_config.h

Go to the documentation of this file.
00001 #ifndef REGISTRY_CONFIGURATOR_CLASS
00002 #define REGISTRY_CONFIGURATOR_CLASS
00003 
00004 /*****************************************************************************\
00005 *                                                                             *
00006 *  Name   : registry_configurator                                             *
00007 *  Author : Chris Koeritz                                                     *
00008 *                                                                             *
00009 *******************************************************************************
00010 * Copyright (c) 2004-$now By Author.  This program is free software; you can  *
00011 * redistribute it and/or modify it under the terms of the GNU General Public  *
00012 * License as published by the Free Software Foundation; either version 2 of   *
00013 * the License or (at your option) any later version.  This is online at:      *
00014 *     http://www.fsf.org/copyleft/gpl.html                                    *
00015 * Please send any updates to: fred@gruntose.com                               *
00016 \*****************************************************************************/
00017 
00018 #include "opsysdll.h"
00019 
00020 #include <basis/object_base.h>
00021 #include <data_struct/configurator.h>
00022 
00023 // forward.
00024 class byte_filer;
00025 class filename;
00026 
00028 
00029 class OPSYSTEM_CLASS_STYLE registry_configurator : public configurator
00030 {
00031 public:
00033   enum registry_hives {
00034     hkey_classes_root,
00035     hkey_current_user,
00036     hkey_local_machine,
00037     hkey_users,
00038     hkey_current_config,
00039     // abbreviations for the above sections...
00040     HKCR = hkey_classes_root,
00041     HKCU = hkey_current_user,
00042     HKLM = hkey_local_machine,
00043     HKU = hkey_users,
00044     HKCC = hkey_current_config
00045   };
00046 
00047   registry_configurator(registry_hives hive, treatment_of_defaults behavior);
00049 
00051   virtual ~registry_configurator();
00052 
00053   IMPLEMENT_CLASS_NAME("registry_configurator");
00054 
00055   virtual bool get(const istring &section, const istring &entry,
00056           istring &found);
00058 
00061   virtual bool section_exists(const istring &section);
00063 
00064   virtual bool put(const istring &section, const istring &entry,
00065           const istring &to_store);
00067 
00070   virtual bool delete_section(const istring &section);
00072 
00073   virtual bool delete_entry(const istring &section, const istring &entry);
00075 
00076   virtual bool get_section(const istring &section, string_table &info);
00078 
00080   virtual bool put_section(const istring &section, const string_table &info);
00082 
00085   void *translate_hive(registry_hives hive);
00087 
00088   istring fix_section(const istring &section);
00090 
00093 private:
00094   registry_hives _hive;  
00095 
00096   // not to be called.
00097   registry_configurator(const registry_configurator &);
00098   registry_configurator &operator =(const registry_configurator &);
00099 
00100   static const istring_object &reg_str_fake_default();
00101 };
00102 
00103 #endif
00104 

Generated on Fri Nov 21 04:29:55 2008 for HOOPLE Libraries by  doxygen 1.5.1