feisty meow concerns codebase  2.140
system_values.h
Go to the documentation of this file.
1 #ifndef SYSTEM_VALUES_CLASS
2 #define SYSTEM_VALUES_CLASS
3 
4 /*****************************************************************************\
5 * *
6 * Name : system_values *
7 * Author : Chris Koeritz *
8 * *
9 *******************************************************************************
10 * Copyright (c) 2004-$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/astring.h>
19 #include <basis/contracts.h>
20 //#include <structures/static_memory_gremlin.h>
21 
22 namespace configuration {
23 
24 // forward.
25 class system_values_lookup_list;
26 
28 
38 class system_values : public virtual basis::root_object
39 {
40 public:
41  system_values(const basis::astring &section_tag);
43 
56  virtual ~system_values();
57 
58  DEFINE_CLASS_NAME("system_values");
59 
60  // these provide symbolic versions of the section tag used in the
61  // constructor. these are preferable to using the string constants
62  // directly.
63  static const char *OUTCOME_VALUES();
65  static const char *FILTER_VALUES();
67  static const char *EVENT_VALUES();
69 
70  static const char *DEFAULT_MANIFEST;
72 
74  bool use_other_manifest(const basis::astring &manifest_file);
76 
79  virtual basis::astring text_form() const;
81 
82  bool lookup(int value, basis::astring &symbolic_name, basis::astring &description,
83  basis::astring &file_location);
85 
92  bool lookup(const basis::astring &symbolic_name, int &value, basis::astring &description,
93  basis::astring &file_location);
95 
99  int elements() const;
101 
102  bool get(int index, basis::astring &symbolic_name, int &value,
103  basis::astring &description, basis::astring &file_location);
105 
106 private:
107  basis::astring *_tag;
108  system_values_lookup_list *_list;
109  basis::astring *_file;
110 
111  bool open_values();
112 };
113 
114 } //namespace.
115 
116 #endif
117 
Provides a dynamically resizable ASCII character string.
Definition: astring.h:35
This class provides a way to look up generated values used in the code base.
Definition: system_values.h:39
bool use_other_manifest(const basis::astring &manifest_file)
supports using a different manifest file than the default.
bool get(int index, basis::astring &symbolic_name, int &value, basis::astring &description, basis::astring &file_location)
accesses the "index"th item in the list.
static const char * EVENT_VALUES()
values that define event objects used in the program.
bool lookup(int value, basis::astring &symbolic_name, basis::astring &description, basis::astring &file_location)
locates a "value" and finds its name, description and location.
DEFINE_CLASS_NAME("system_values")
system_values(const basis::astring &section_tag)
provides a lookup on values found in the section named "section_tag".
static const char * FILTER_VALUES()
values that define filters used in logging.
virtual basis::astring text_form() const
shows all items in the table.
int elements() const
returns how many items are listed for the types of values specified.
static const char * DEFAULT_MANIFEST
the default manifest file.
Definition: system_values.h:70
static const char * OUTCOME_VALUES()
values that define the outcomes of operations.