#include <xformat.hpp>
Public Types | |
typedef _char_type | char_type |
typedef _traits_type | traits_type |
typedef _alloc_type | allocator_type |
typedef std::basic_string < _char_type, _traits_type, _alloc_type > | string_type |
typedef std::basic_stringstream < _char_type, _traits_type, _alloc_type > | stream_type |
Public Member Functions | |
template<typename _value_type > | |
bool | to_str (const _value_type &value, string_type &str, bool raise=true) |
template<typename _value_type > | |
string_type | to_str (const _value_type &value) |
template<typename _value_type > | |
bool | from_str (const string_type &str, _value_type &value, bool raise=true) |
template<typename _value_type > | |
_value_type | from_str (const string_type &str) |
Public Attributes | |
stream_type | stream |
This class encapsulates a stringstream that is used for converting value types to/from string.
_value_type lite::basic_conversion< _char_type, _traits_type, _alloc_type >::from_str | ( | const string_type & | str | ) | [inline] |
Convert the string in str to a _value_type and return it. Throw an exception on error.
bool lite::basic_conversion< _char_type, _traits_type, _alloc_type >::from_str | ( | const string_type & | str, | |
_value_type & | value, | |||
bool | raise = true | |||
) | [inline] |
Convert the string in str to a _value_type and store it in value. Throw an exception on error if raise is true. Otherwise return false on error and true otherwise.
string_type lite::basic_conversion< _char_type, _traits_type, _alloc_type >::to_str | ( | const _value_type & | value | ) | [inline] |
Convert value to string and return it. Throws an exception on error.
bool lite::basic_conversion< _char_type, _traits_type, _alloc_type >::to_str | ( | const _value_type & | value, | |
string_type & | str, | |||
bool | raise = true | |||
) | [inline] |
Convert value to string and store it in str. Throw an exception on error if raise is true. Otherwise return false on error and true otherwise.
stream_type lite::basic_conversion< _char_type, _traits_type, _alloc_type >::stream |
the conversion setting can be modified by directly accessing the stream object