feisty meow concerns codebase  2.140
configuration_list.h
Go to the documentation of this file.
1 #ifndef CONFIGURATION_LIST_CLASS
2 #define CONFIGURATION_LIST_CLASS
3 
4 /*****************************************************************************\
5 * *
6 * Name : configuration_list *
7 * Author : Chris Koeritz *
8 * *
9 *******************************************************************************
10 * Copyright (c) 2001-$now By Author. This program is free software; you can *
11 * redistribute it and/or modify it under the terms of the GNU General Public *
12 * License as published by the Free Software Foundation; either version 2 of *
13 * the License or (at your option) any later version. This is online at: *
14 * http://www.fsf.org/copyleft/gpl.html *
15 * Please send any updates to: fred@gruntose.com *
16 \*****************************************************************************/
17 
18 #include <basis/contracts.h>
19 
20 namespace configuration {
21 
22 // forward.
23 class cl_figlet_list;
24 class configlet;
26 
28 
33 class configuration_list : public virtual basis::root_object
34 {
35 public:
37  virtual ~configuration_list();
38 
39  DEFINE_CLASS_NAME("configuration_list");
40 
41  void reset();
42 
43  void add(const configlet &new_item);
45 
46  const configlet *find(const configlet &to_find) const;
48 
54  bool zap(const configlet &dead_item);
56 
59  bool load(configurator &config);
61  bool store(configurator &config) const;
62 
63 private:
64  cl_figlet_list *_figs;
65 };
66 
67 } //namespace.
68 
69 #endif
70 
Represents an atom of configuration info.
Definition: configlet.h:33
Manages a collection of configlet objects.
bool store(configurator &config) const
writes the current values of all the configlets in "this" into "config".
const configlet * find(const configlet &to_find) const
locates the actual configlet with the section and entry of "to_find".
bool zap(const configlet &dead_item)
removes a previously added configuration item.
void add(const configlet &new_item)
adds another configuration atom into the list.
DEFINE_CLASS_NAME("configuration_list")
bool load(configurator &config)
reads the values of all the configlets stored in "config" into this.
void reset()
removes all items from the list.
Provides a base class for configuration repositories.
Definition: configurator.h:34