Conf v1.5.0
Reader Class Referencefinal

Conf reader instance handle. More...

#include <reader.hpp>

Public Member Functions

 Reader (const filesystem::path &filePath)
 Creates a new Conf file reader instance.
 
 Reader (const char *data)
 Creates a new Conf data reader instance.
 
 ~Reader ()
 Destroys Conf reader instance.
 
bool getType (const string &key, ConfDataType &type) const noexcept
 Returns the type of value by key.
 
bool get (const string &key, int64_t &value) const noexcept
 Returns the integer value by key. (int64)
 
bool get (const string &key, int32_t &value) const noexcept
 Returns the integer value by key. (int32)
 
bool get (const string &key, uint32_t &value) const noexcept
 Returns the integer value by key. (uint32)
 
bool get (const string &key, int16_t &value) const noexcept
 Returns the integer value by key. (int16)
 
bool get (const string &key, uint16_t &value) const noexcept
 Returns the integer value by key. (uint16)
 
bool get (const string &key, int8_t &value) const noexcept
 Returns the integer value by key. (int8)
 
bool get (const string &key, uint8_t &value) const noexcept
 Returns the integer value by key. (uint8)
 
bool get (const string &key, double &value) const noexcept
 Returns the floating value by key. (double)
 
bool get (const string &key, float &value) const noexcept
 Returns the floating value by key. (float)
 
bool get (const string &key, bool &value) const noexcept
 Returns the boolean value by key.
 
bool get (const string &key, string_view &value) const noexcept
 Returns the string value by key.
 

Detailed Description

Conf reader instance handle.

See the reader.h

Constructor & Destructor Documentation

◆ Reader() [1/2]

Reader ( const filesystem::path & filePath)
inline

Creates a new Conf file reader instance.

See the createFileConfReader().

Parameters
[in]filePathtarget Conf file path string
Exceptions
Errorwith a ConfResult string and line number on failure.

◆ Reader() [2/2]

Reader ( const char * data)
inline

Creates a new Conf data reader instance.

See the createDataConfReader().

Parameters
[in]datatarget Conf data string
Exceptions
Errorwith a ConfResult string and line number on failure.

◆ ~Reader()

~Reader ( )
inline

Destroys Conf reader instance.

See the destroyConfReader().

Member Function Documentation

◆ getType()

bool getType ( const string & key,
ConfDataType & type ) const
inlinenoexcept

Returns the type of value by key.

See the getConfReaderType().

Parameters
[in]keytarget item key string
[out]typereference to the value type
Returns
True on succes, false if item is not found.

◆ get() [1/11]

bool get ( const string & key,
int64_t & value ) const
inlinenoexcept

Returns the integer value by key. (int64)

See the getConfReaderInt().

Parameters
[in]keytarget item key string
[out]valuereference to the integer value
Returns
True on succes, false if item is not found or has a different type.

◆ get() [2/11]

bool get ( const string & key,
int32_t & value ) const
inlinenoexcept

Returns the integer value by key. (int32)

See the getConfReaderInt().

Parameters
[in]keytarget item key string
[out]valuereference to the integer value
Returns
True on succes, false if item is not found or has a different type.

◆ get() [3/11]

bool get ( const string & key,
uint32_t & value ) const
inlinenoexcept

Returns the integer value by key. (uint32)

See the getConfReaderInt().

Parameters
[in]keytarget item key string
[out]valuereference to the integer value
Returns
True on succes, false if item is not found or has a different type.

◆ get() [4/11]

bool get ( const string & key,
int16_t & value ) const
inlinenoexcept

Returns the integer value by key. (int16)

See the getConfReaderInt().

Parameters
[in]keytarget item key string
[out]valuereference to the integer value
Returns
True on succes, false if item is not found or has a different type.

◆ get() [5/11]

bool get ( const string & key,
uint16_t & value ) const
inlinenoexcept

Returns the integer value by key. (uint16)

See the getConfReaderInt().

Parameters
[in]keytarget item key string
[out]valuereference to the integer value
Returns
True on succes, false if item is not found or has a different type.

◆ get() [6/11]

bool get ( const string & key,
int8_t & value ) const
inlinenoexcept

Returns the integer value by key. (int8)

See the getConfReaderInt().

Parameters
[in]keytarget item key string
[out]valuereference to the integer value
Returns
True on succes, false if item is not found or has a different type.

◆ get() [7/11]

bool get ( const string & key,
uint8_t & value ) const
inlinenoexcept

Returns the integer value by key. (uint8)

See the getConfReaderInt().

Parameters
[in]keytarget item key string
[out]valuereference to the integer value
Returns
True on succes, false if item is not found or has a different type.

◆ get() [8/11]

bool get ( const string & key,
double & value ) const
inlinenoexcept

Returns the floating value by key. (double)

See the getConfReaderFloat().

Parameters
[in]keytarget item key string
[out]valuereference to the floating value
Returns
True on succes, false if item is not found or has a different type.

◆ get() [9/11]

bool get ( const string & key,
float & value ) const
inlinenoexcept

Returns the floating value by key. (float)

See the getConfReaderFloat().

Parameters
[in]keytarget item key string
[out]valuereference to the floating value
Returns
True on succes, false if item is not found or has a different type.

◆ get() [10/11]

bool get ( const string & key,
bool & value ) const
inlinenoexcept

Returns the boolean value by key.

See the getConfReaderBool().

Parameters
[in]keytarget item key string
[out]valuereference to the boolean value
Returns
True on succes, false if item is not found or has a different type.

◆ get() [11/11]

bool get ( const string & key,
string_view & value ) const
inlinenoexcept

Returns the string value by key.

See the getConfReaderString().

Parameters
[in]keytarget item key string
[out]valuereference to the string value
Returns
True on succes, false if item is not found or has a different type.