zz::cfg::Value Class Reference

The Value class for store/load various type to/from string. More...

#include <zupply.hpp>

Public Member Functions

 Value ()
 Value default constructor.
 
 Value (const char *cstr)
 Value constructor from raw string. More...
 
 Value (std::string str)
 Value constrctor from string. More...
 
 Value (const Value &other)
 Value copy constructor. More...
 
std::string str () const
 Return stored string. More...
 
bool empty () const
 Check if stored string is empty. More...
 
void clear ()
 Clear stored string.
 
bool operator== (const Value &other)
 Overloaded operator == for comparison. More...
 
Valueoperator= (const Value &other)
 Overloaded operator = for copy. More...
 
template<typename T >
std::string store (T t)
 Store value from template type T Support type that can << to a stringstream.
 
template<typename T >
std::string store (std::vector< T > t)
 Template specification of store for vector of type T Support type that can << to a stringstream.
 
template<typename T >
load (T &t)
 Load value to template type T Support type that can >> to a stringstream.
 
template<typename T >
std::vector< T > load (std::vector< T > &t)
 
template<typename T >
load ()
 Template for load function with no input.
 
template<>
bool load (bool &b)
 

Detailed Description

The Value class for store/load various type to/from string.

Constructor & Destructor Documentation

zz::cfg::Value::Value ( const char *  cstr)
inline

Value constructor from raw string.

Parameters
cstr
zz::cfg::Value::Value ( std::string  str)
inline

Value constrctor from string.

Parameters
str
zz::cfg::Value::Value ( const Value other)
inline

Value copy constructor.

Parameters
other

Member Function Documentation

bool zz::cfg::Value::empty ( ) const
inline

Check if stored string is empty.

Returns
True if empty
Value& zz::cfg::Value::operator= ( const Value other)
inline

Overloaded operator = for copy.

Parameters
other
Returns
bool zz::cfg::Value::operator== ( const Value other)
inline

Overloaded operator == for comparison.

Parameters
other
Returns
True if stored strings are same
std::string zz::cfg::Value::str ( ) const
inline

Return stored string.

Returns
String

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