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

#include <integer.h>

Inheritance diagram for configuration_item_integer:
configuration_item

Public Member Functions

virtual ~configuration_item_integer ()

Static Public Member Functions

static bool candidate (const rcstring &text, long &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, long 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_integer (const source_location &locn, level_t level, const rcstring &name, long value)
 configuration_item_integer ()
 configuration_item_integer (const configuration_item_integer &rhs)
configuration_item_integeroperator= (const configuration_item_integer &rhs)

Private Attributes

long value

Detailed Description

The configuration_item_integer class is used to represent an integer valued configuration item.

Definition at line 28 of file integer.h.


Constructor & Destructor Documentation

The destructor.

Definition at line 24 of file integer.cc.

configuration_item_integer::configuration_item_integer ( const source_location locn,
level_t  level,
const rcstring name,
long  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 integer value of this configuration item.

Definition at line 29 of file integer.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_integer::candidate ( const rcstring text,
long &  value 
) [static]

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

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

Definition at line 54 of file integer.cc.

configuration_item_integer::pointer configuration_item_integer::create ( const source_location locn,
level_t  level,
const rcstring name,
long  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 integer value of this configuration item.
Returns:
a pointer to the new item, never NULL

Definition at line 42 of file integer.cc.

configuration_item_integer::pointer configuration_item_integer::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 64 of file integer.cc.

bool configuration_item_integer::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 92 of file integer.cc.

long configuration_item_integer::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 84 of file integer.cc.

rcstring configuration_item_integer::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 75 of file integer.cc.

configuration_item_integer& configuration_item_integer::operator= ( const configuration_item_integer 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 integer value of this configuration item.

Definition at line 120 of file integer.h.


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