nis-util  1.0.D108
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
configuration_item_boolean Class Reference

#include <boolean.h>

Inheritance diagram for configuration_item_boolean:
configuration_item

Public Member Functions

virtual ~configuration_item_boolean ()

Static Public Member Functions

static bool candidate (const rcstring &text, bool &value)
static pointer create_if_candidate (const source_location &locn, level_t level, const rcstring &name, const rcstring &potential_value)
static pointer create (const source_location &locn, level_t level, const rcstring &name, bool value)

Protected Member Functions

rcstring get_string_value (void) const
bool get_bool_value (void) const
long get_long_value (void) const

Private Member Functions

 configuration_item_boolean (const source_location &locn, level_t level, const rcstring &name, bool value)
 configuration_item_boolean ()
 configuration_item_boolean (const configuration_item_boolean &rhs)
configuration_item_booleanoperator= (const configuration_item_boolean &rhs)

Private Attributes

bool value

Detailed Description

The configuration_item_boolean class is used to represent a boolean valued configuration item.

Definition at line 28 of file boolean.h.


Constructor & Destructor Documentation

The destructor.

Definition at line 25 of file boolean.cc.

configuration_item_boolean::configuration_item_boolean ( const source_location locn,
level_t  level,
const rcstring name,
bool  value 
) [private]

The constructor. It is private on purpose, use the create class method instead.

Parameters:
locnThe source file location of this configuration item.
levelThe precedence level of this configuration item.
nameThe name of this configuration item.
valueThe boolean value of this configuration item.

Definition at line 30 of file boolean.cc.

The default constructor. Do not use.

The copy constructor. Do not use.

Parameters:
rhsThe right hand side of the initialization.

Member Function Documentation

bool configuration_item_boolean::candidate ( const rcstring text,
bool &  value 
) [static]

The candidate class method is used to determine whether or not the given text could be a boolean value, and thus, the text could be used to build a boolean configuration item.

Parameters:
textThe text that may, or may not, be a representation of a boolean.
valueIf it is a boolean, the value is returned here.
Returns:
true if it looks like a boolean value, false if not

Definition at line 55 of file boolean.cc.

configuration_item_boolean::pointer configuration_item_boolean::create ( const source_location locn,
level_t  level,
const rcstring name,
bool  value 
) [static]

The create class method is used to create new dynamically allocated instances of this class.

Parameters:
locnThe source file location of this configuration item.
levelThe precedence level of this configuration item.
nameThe name of this configuration item.
valueThe boolean value of this configuration item.
Returns:
a pointer to the new item, never NULL

Definition at line 43 of file boolean.cc.

configuration_item_boolean::pointer configuration_item_boolean::create_if_candidate ( const source_location locn,
level_t  level,
const rcstring name,
const rcstring potential_value 
) [static]

The create_if_candidate class method is used to create new dynamically allocated instances of this class, if the string value presented looks like a boolean value.

Parameters:
locnThe source file location of this configuration item.
levelThe precedence level of this configuration item.
nameThe name of this configuration item.
potential_valueThe string value of this configuration item.
Returns:
a pointer to the new item, or NULL if potential_value does not look boolean.

Definition at line 62 of file boolean.cc.

bool configuration_item_boolean::get_bool_value ( void  ) const [protected, virtual]

The get_string_value method is used to obtain the value of this configuration item, as a boolean.

Implements configuration_item.

Definition at line 97 of file boolean.cc.

long configuration_item_boolean::get_long_value ( void  ) const [protected, virtual]

The get_string_value method is used to obtain the value of this configuration item, as an integer.

Implements configuration_item.

Definition at line 82 of file boolean.cc.

rcstring configuration_item_boolean::get_string_value ( void  ) const [protected, virtual]

The get_string_value method is used to obtain the value of this configuration item, as a string.

Implements configuration_item.

Definition at line 73 of file boolean.cc.

configuration_item_boolean& configuration_item_boolean::operator= ( const configuration_item_boolean rhs) [private]

The assignment operator. Do not use.

Parameters:
rhsThe right hand side of the assignment.

Field Documentation

The value instance variable is used to rememebr the boolean value of this configuration item.

Definition at line 120 of file boolean.h.


The documentation for this class was generated from the following files: