|
nis-util
1.0.D108
|
#include <item.h>
Public Types | |
| enum | level_t { level_builtin, level_etc_nis_util_conf, level_home_nis_util_rc, level_nis_util_env, level_nis_util_prog_env, level_command_line_file, level_command_line_option } |
| typedef boost::shared_ptr < configuration_item > | pointer |
Public Member Functions | |
| virtual | ~configuration_item () |
| virtual rcstring | get_string_value (void) const =0 |
| virtual bool | get_bool_value (void) const =0 |
| virtual long | get_long_value (void) const =0 |
| const source_location & | get_source_location (void) const |
| level_t | get_level (void) const |
| rcstring | get_name (void) const |
| void | print (void) const |
Static Public Member Functions | |
| static const char * | level_name (level_t value) |
Protected Member Functions | |
| configuration_item (const source_location &locn, level_t level, const rcstring &name) | |
Private Attributes | |
| source_location | locn |
| level_t | level |
| rcstring | name |
The configuration_item class is used to represent a single configuration configuration_item's setting. Once created, it can't be modified, updates are accomplished by replacemnt.
| typedef boost::shared_ptr<configuration_item> configuration_item::pointer |
The level_t type describes the source of a configuration setting, and also acts as a precedence indicatorm higher values have higher precedence.
| level_builtin |
The configuration item's hard coded default. Usually conservative, maximum informative-ness. |
| level_etc_nis_util_conf |
The configuration item is from the /etc/nis-util.conf file. |
| level_home_nis_util_rc |
The configuration item is from the $HOME/.nis-util.rc file. |
| level_nis_util_env |
The configuration item is from the $NIS_UTIL environment variable. This is formatted identically to the file format, including newlines, but in a string. |
| level_nis_util_prog_env |
The configuration item is from the util-specific environment variable. This is formatted identically to the file format, including newlines, but in a string. The nameof the environmae variable us determined using the following code: rcstring name = rcstring(explain_program_name_get()).upcase().identifier(); That is: take the name of the running program, make it all upper case, and recplace any non-identifier characters with nul. For example "nis-util-passwd" becomes "NIS_UTIL_PASSWD". |
| level_command_line_file |
A configuration file specified on the command line, using the --configuration=filename command line option. |
| level_command_line_option |
A command line option, as it relates to a specific item, usually in the [global] section. |
| configuration_item::~configuration_item | ( | ) | [virtual] |
| configuration_item::configuration_item | ( | const source_location & | locn, |
| level_t | level, | ||
| const rcstring & | name | ||
| ) | [protected] |
| virtual bool configuration_item::get_bool_value | ( | void | ) | const [pure virtual] |
The get_string_value method is used to obtain the value of this configuration item, as a boolean.
Implemented in configuration_item_boolean, configuration_item_integer, and configuration_item_string.
| level_t configuration_item::get_level | ( | void | ) | const [inline] |
| virtual long configuration_item::get_long_value | ( | void | ) | const [pure virtual] |
The get_string_value method is used to obtain the value of this configuration item, as an integer.
Implemented in configuration_item_boolean, configuration_item_integer, and configuration_item_string.
| rcstring configuration_item::get_name | ( | void | ) | const [inline] |
| const source_location& configuration_item::get_source_location | ( | void | ) | const [inline] |
| virtual rcstring configuration_item::get_string_value | ( | void | ) | const [pure virtual] |
The get_string_value method is used to obtain the value of this configuration item, as a string.
Implemented in configuration_item_boolean, configuration_item_integer, and configuration_item_string.
| const char * configuration_item::level_name | ( | level_t | value | ) | [static] |
| void configuration_item::print | ( | void | ) | const |
level_t configuration_item::level [private] |
source_location configuration_item::locn [private] |
rcstring configuration_item::name [private] |
1.7.6.1