Fawkes API  Fawkes Development Version
fawkes::SQLiteConfiguration::SQLiteValueIterator Class Reference

#include <config/sqlite.h>

Inheritance diagram for fawkes::SQLiteConfiguration::SQLiteValueIterator:

Public Member Functions

virtual ~SQLiteValueIterator ()
 Destructor. More...
 
virtual bool next ()
 
virtual bool valid () const
 Check if the current element is valid. More...
 
virtual const char * path () const
 Path of value. More...
 
virtual const char * type () const
 Type of value. More...
 
virtual bool is_float () const
 
virtual bool is_uint () const
 
virtual bool is_int () const
 
virtual bool is_bool () const
 
virtual bool is_string () const
 
virtual bool is_list () const
 
virtual size_t get_list_size () const
 
virtual bool is_default () const
 
virtual float get_float () const
 Get float value. More...
 
virtual unsigned int get_uint () const
 Get unsigned int value. More...
 
virtual int get_int () const
 Get int value. More...
 
virtual bool get_bool () const
 Get bool value. More...
 
virtual std::string get_string () const
 Get string value. More...
 
virtual std::vector< float > get_floats () const
 
virtual std::vector< unsigned int > get_uints () const
 
virtual std::vector< int > get_ints () const
 
virtual std::vector< bool > get_bools () const
 
virtual std::vector< std::string > get_strings () const
 
virtual std::string get_as_string () const
 Get value as string. More...
 
virtual std::string get_comment () const
 Get comment. More...
 
std::string get_modtype () const
 Get modification type. More...
 
std::string get_oldvalue () const
 Get old value (as string). More...
 
- Public Member Functions inherited from fawkes::Configuration::ValueIterator
virtual ~ValueIterator ()
 

Protected Member Functions

 SQLiteValueIterator (::sqlite3_stmt *stmt, void *p=NULL)
 Constructor. More...
 

Detailed Description

SQLite configuration value iterator.

Definition at line 117 of file sqlite.h.

Constructor & Destructor Documentation

◆ SQLiteValueIterator()

fawkes::SQLiteConfiguration::SQLiteValueIterator::SQLiteValueIterator ( ::sqlite3_stmt *  stmt,
void *  p = NULL 
)
protected

Constructor.

Parameters
stmtcompiled SQLite statement
ppointer to arbitrary data that is freed (not deleted!) when the iterator is deleted.

Definition at line 1985 of file sqlite.cpp.

◆ ~SQLiteValueIterator()

fawkes::SQLiteConfiguration::SQLiteValueIterator::~SQLiteValueIterator ( )
virtual

Destructor.

Definition at line 1992 of file sqlite.cpp.

Member Function Documentation

◆ get_as_string()

std::string fawkes::SQLiteConfiguration::SQLiteValueIterator::get_as_string ( ) const
virtual

Get value as string.

Returns
value

Implements fawkes::Configuration::ValueIterator.

Definition at line 2183 of file sqlite.cpp.

◆ get_bool()

bool fawkes::SQLiteConfiguration::SQLiteValueIterator::get_bool ( ) const
virtual

Get bool value.

Returns
value

Implements fawkes::Configuration::ValueIterator.

Definition at line 2135 of file sqlite.cpp.

◆ get_bools()

std::vector< bool > fawkes::SQLiteConfiguration::SQLiteValueIterator::get_bools ( ) const
virtual

Get list of values from configuration which is of type bool

Returns
value

Implements fawkes::Configuration::ValueIterator.

Definition at line 2168 of file sqlite.cpp.

◆ get_comment()

std::string fawkes::SQLiteConfiguration::SQLiteValueIterator::get_comment ( ) const
virtual

Get comment.

Returns
string comment value

Implements fawkes::Configuration::ValueIterator.

Definition at line 2192 of file sqlite.cpp.

◆ get_float()

float fawkes::SQLiteConfiguration::SQLiteValueIterator::get_float ( ) const
virtual

Get float value.

Returns
value

Implements fawkes::Configuration::ValueIterator.

Definition at line 2103 of file sqlite.cpp.

◆ get_floats()

std::vector< float > fawkes::SQLiteConfiguration::SQLiteValueIterator::get_floats ( ) const
virtual

Get list of values from configuration which is of type float

Returns
value

Implements fawkes::Configuration::ValueIterator.

Definition at line 2150 of file sqlite.cpp.

◆ get_int()

int fawkes::SQLiteConfiguration::SQLiteValueIterator::get_int ( ) const
virtual

Get int value.

Returns
value

Implements fawkes::Configuration::ValueIterator.

Definition at line 2126 of file sqlite.cpp.

◆ get_ints()

std::vector< int > fawkes::SQLiteConfiguration::SQLiteValueIterator::get_ints ( ) const
virtual

Get list of values from configuration which is of type int

Returns
value

Implements fawkes::Configuration::ValueIterator.

Definition at line 2162 of file sqlite.cpp.

◆ get_list_size()

size_t fawkes::SQLiteConfiguration::SQLiteValueIterator::get_list_size ( ) const
virtual

Get number of elements in list value.

Returns
number of elements in list value
Exceptions
Exceptionthrown if the element is not a list.

Implements fawkes::Configuration::ValueIterator.

Definition at line 2088 of file sqlite.cpp.

◆ get_modtype()

std::string fawkes::SQLiteConfiguration::SQLiteValueIterator::get_modtype ( ) const

Get modification type.

This can only be called if the iterator has been retrieved via SQLiteConfiguration::modified_iterator(). Otherwise the return value is always and empty string.

Returns
string modification type

Definition at line 2205 of file sqlite.cpp.

◆ get_oldvalue()

std::string fawkes::SQLiteConfiguration::SQLiteValueIterator::get_oldvalue ( ) const

Get old value (as string).

This can only be called if the iterator has been retrieved via SQLiteConfiguration::modified_iterator(). The value is always returned as string, as it is meant for debugging purposes only. Otherwise the return value is always and empty string.

Returns
string modification type

Definition at line 2219 of file sqlite.cpp.

◆ get_string()

std::string fawkes::SQLiteConfiguration::SQLiteValueIterator::get_string ( ) const
virtual

Get string value.

Returns
value

Implements fawkes::Configuration::ValueIterator.

Definition at line 2144 of file sqlite.cpp.

◆ get_strings()

std::vector< std::string > fawkes::SQLiteConfiguration::SQLiteValueIterator::get_strings ( ) const
virtual

Get list of values from configuration which is of type string

Returns
value

Implements fawkes::Configuration::ValueIterator.

Definition at line 2174 of file sqlite.cpp.

◆ get_uint()

unsigned int fawkes::SQLiteConfiguration::SQLiteValueIterator::get_uint ( ) const
virtual

Get unsigned int value.

Returns
value

Implements fawkes::Configuration::ValueIterator.

Definition at line 2112 of file sqlite.cpp.

◆ get_uints()

std::vector< unsigned int > fawkes::SQLiteConfiguration::SQLiteValueIterator::get_uints ( ) const
virtual

Get list of values from configuration which is of type unsigned int

Returns
value

Implements fawkes::Configuration::ValueIterator.

Definition at line 2156 of file sqlite.cpp.

◆ is_bool()

bool fawkes::SQLiteConfiguration::SQLiteValueIterator::is_bool ( ) const
virtual

Check if current value is a bool.

Returns
true, if value is a bool, false otherwise

Implements fawkes::Configuration::ValueIterator.

Definition at line 2070 of file sqlite.cpp.

◆ is_default()

bool fawkes::SQLiteConfiguration::SQLiteValueIterator::is_default ( ) const
virtual

Check if current value was read from the default config.

Returns
true, if value was read from the default config, false otherwise

Implements fawkes::Configuration::ValueIterator.

Definition at line 2094 of file sqlite.cpp.

◆ is_float()

bool fawkes::SQLiteConfiguration::SQLiteValueIterator::is_float ( ) const
virtual

Check if current value is a float.

Returns
true, if value is a float, false otherwise

Implements fawkes::Configuration::ValueIterator.

Definition at line 2052 of file sqlite.cpp.

◆ is_int()

bool fawkes::SQLiteConfiguration::SQLiteValueIterator::is_int ( ) const
virtual

Check if current value is a int.

Returns
true, if value is a int, false otherwise

Implements fawkes::Configuration::ValueIterator.

Definition at line 2064 of file sqlite.cpp.

◆ is_list()

bool fawkes::SQLiteConfiguration::SQLiteValueIterator::is_list ( ) const
virtual

Check if a value is a list.

Returns
true if the value exists and is a list

Implements fawkes::Configuration::ValueIterator.

Definition at line 2082 of file sqlite.cpp.

◆ is_string()

bool fawkes::SQLiteConfiguration::SQLiteValueIterator::is_string ( ) const
virtual

Check if current value is a string.

Returns
true, if value is a string, false otherwise

Implements fawkes::Configuration::ValueIterator.

Definition at line 2076 of file sqlite.cpp.

◆ is_uint()

bool fawkes::SQLiteConfiguration::SQLiteValueIterator::is_uint ( ) const
virtual

Check if current value is a unsigned int.

Returns
true, if value is a unsigned int, false otherwise

Implements fawkes::Configuration::ValueIterator.

Definition at line 2058 of file sqlite.cpp.

◆ next()

bool fawkes::SQLiteConfiguration::SQLiteValueIterator::next ( )
virtual

Check if there is another element and advance to this if possible. This advances to the next element, if there is one.

Returns
true, if another element has been reached, false otherwise

Implements fawkes::Configuration::ValueIterator.

Definition at line 2008 of file sqlite.cpp.

◆ path()

const char * fawkes::SQLiteConfiguration::SQLiteValueIterator::path ( ) const
virtual

Path of value.

Returns
path of value

Implements fawkes::Configuration::ValueIterator.

Definition at line 2037 of file sqlite.cpp.

◆ type()

const char * fawkes::SQLiteConfiguration::SQLiteValueIterator::type ( ) const
virtual

Type of value.

Returns
string representation of value type.

Implements fawkes::Configuration::ValueIterator.

Definition at line 2046 of file sqlite.cpp.

◆ valid()

bool fawkes::SQLiteConfiguration::SQLiteValueIterator::valid ( ) const
virtual

Check if the current element is valid.

This is much like the classic end element for iterators. If the iterator is invalid there all subsequent calls to next() shall fail.

Returns
true, if the iterator is still valid, false otherwise

Implements fawkes::Configuration::ValueIterator.

Definition at line 2028 of file sqlite.cpp.


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