feisty meow concerns codebase  2.140
registry_config.h
Go to the documentation of this file.
1 #ifndef REGISTRY_CONFIGURATOR_CLASS
2 #define REGISTRY_CONFIGURATOR_CLASS
3 
4 /*
5 * Name : registry_configurator *
6 * Author : Chris Koeritz *
7 **
8 * Copyright (c) 2004-$now By Author. This program is free software; you can *
9 * redistribute it and/or modify it under the terms of the GNU General Public *
10 * License as published by the Free Software Foundation; either version 2 of *
11 * the License or (at your option) any later version. This is online at: *
12 * http://www.fsf.org/copyleft/gpl.html *
13 * Please send any updates to: fred@gruntose.com *
14 */
15 
16 #include <basis/contracts.h>
18 #include <filesystem/byte_filer.h>
19 #include <filesystem/filename.h>
20 
21 namespace configuration {
22 
24 
26 {
27 public:
35  // abbreviations for the above sections...
41  };
42 
45 
47  virtual ~registry_configurator();
48 
49  DEFINE_CLASS_NAME("registry_configurator");
50 
51  virtual bool get(const basis::astring &section, const basis::astring &entry,
52  basis::astring &found);
54 
57  virtual bool section_exists(const basis::astring &section);
59 
60  virtual bool put(const basis::astring &section, const basis::astring &entry,
61  const basis::astring &to_store);
63 
66  virtual bool delete_section(const basis::astring &section);
68 
69  virtual bool delete_entry(const basis::astring &section, const basis::astring &entry);
71 
72  virtual bool get_section(const basis::astring &section, structures::string_table &info);
74 
76  virtual bool put_section(const basis::astring &section, const structures::string_table &info);
78 
81  void *translate_hive(registry_hives hive);
83 
86 
89 private:
90  registry_hives _hive;
91 
92  // not to be called.
94  registry_configurator &operator =(const registry_configurator &);
95 
96  static const basis::astring &reg_str_fake_default();
97 };
98 
99 }
100 
101 #endif
102 
Provides a dynamically resizable ASCII character string.
Definition: astring.h:35
Provides a base class for configuration repositories.
Definition: configurator.h:34
treatment_of_defaults behavior() const
observes the behavior chosen for the load() function.
Definition: configurator.h:46
Supports the configurator class interface on the windows registry.
registry_configurator(registry_hives hive, treatment_of_defaults behavior)
creates a registry_configurator that stores entries into the "hive".
virtual bool put_section(const basis::astring &section, const structures::string_table &info)
writes a table called "info" into the "section" in the INI file.
DEFINE_CLASS_NAME("registry_configurator")
basis::astring fix_section(const basis::astring &section)
repairs malformed section names.
virtual bool put(const basis::astring &section, const basis::astring &entry, const basis::astring &to_store)
implements the configurator storage function.
virtual bool section_exists(const basis::astring &section)
returns true if the "section" was found in the file.
void * translate_hive(registry_hives hive)
translates from our enum to the windows specific type for hives.
virtual bool get_section(const basis::astring &section, structures::string_table &info)
reads the entire "section" into a table called "info".
virtual bool delete_entry(const basis::astring &section, const basis::astring &entry)
removes the entry specified by the "section" and "entry" name.
registry_hives
the hives are major partitions of the registry.
virtual bool delete_section(const basis::astring &section)
removes the entire "section" specified.
virtual bool get(const basis::astring &section, const basis::astring &entry, basis::astring &found)
implements the configurator retrieval function.
Provides a symbol_table that holds strings as the content.
Definition: string_table.h:32