NetBurner 3.5.0
PDF Version
 
config_bool Class Reference

Boolean Configuration Variable. More...

#include <config_obj.h>

Inherits config_value.

Inherited by reboot_obj.

Public Member Functions

virtual void GetTextValue (NBString &s)
 Copy the object value as a text string to the specified NBString object.
 
 config_bool (config_obj &owner, bool def_val, const char *name, const char *desc=NULL)
 Object constructor with the parent/owner leaf parameter.
 
 config_bool (bool def_val, const char *name, const char *desc=NULL)
 Object constructor.
 
 operator bool () const
 Return the object value.
 
config_booloperator= (const bool v)
 Assign the config_bool object value to the specified bool value.
 
config_booloperator= (const config_bool &cb)
 Copy one config_bool object to another.
 
config_booloperator= (const int i)
 Assign a config_bool object value to the specified integer value.
 
virtual void GetTypeValue (NBString &s)
 Copy the object type value to the specified NBString object.
 

Additional Inherited Members

- Protected Member Functions inherited from config_value
 config_value (config_obj &owner, const char *name, const char *desc)
 Object constructor with the parent/owner leaf parameter.
 
 config_value (const char *name, const char *desc)
 Object constructor.
 

Detailed Description

Boolean Configuration Variable.

Note
All modifictions to configuration objects are marked as pending. A call to SaveConfigToStorage is required to save changes to flash memory.

Constructor & Destructor Documentation

◆ config_bool() [1/2]

config_bool::config_bool ( config_obj & owner,
bool def_val,
const char * name,
const char * desc = NULL )
inline

Object constructor with the parent/owner leaf parameter.

Parameters
ownerReference to parent leaf
def_valDefault value
nameField name assigned to the value
descDescription used for info/tool tip

◆ config_bool() [2/2]

config_bool::config_bool ( bool def_val,
const char * name,
const char * desc = NULL )
inline

Object constructor.

Parameters
def_valDefault value
nameField name assigned to the value
descDescription, used for info/tool tips

Member Function Documentation

◆ GetTextValue()

virtual void config_bool::GetTextValue ( NBString & s)
inlinevirtual

Copy the object value as a text string to the specified NBString object.

Writes either "true" or "false". This is a virtual function that can be overridden in a derived class.

Parameters
sReference to a NBString object to store the result

Implements config_value.

◆ GetTypeValue()

virtual void config_bool::GetTypeValue ( NBString & s)
inlinevirtual

Copy the object type value to the specified NBString object.

Parameters
sNBString object to hold the type value string

◆ operator bool()

config_bool::operator bool ( ) const
inline

Return the object value.

Returns
The object value as a bool

Example: for a variable named configInt of type config_double:

bool boolValue = bool(NV_Settings.m_nvBool);
iprintf("boolValue: %d\r\n", boolValue);

◆ operator=() [1/3]

config_bool & config_bool::operator= ( const bool v)
inline

Assign the config_bool object value to the specified bool value.

Parameters
vValue of type bool

◆ operator=() [2/3]

config_bool & config_bool::operator= ( const config_bool & cb)
inline

Copy one config_bool object to another.

Parameters
cbReference to a config_bool object

◆ operator=() [3/3]

config_bool & config_bool::operator= ( const int i)
inline

Assign a config_bool object value to the specified integer value.

Parameters
iInteger value, either 0 (false) or 1 (true)

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