lite::basic_conversion< _char_type, _traits_type, _alloc_type > Class Template Reference
[String Conversion]

#include <xformat.hpp>

List of all members.

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

Detailed Description

template<typename _char_type, typename _traits_type, typename _alloc_type>
class lite::basic_conversion< _char_type, _traits_type, _alloc_type >

This class encapsulates a stringstream that is used for converting value types to/from string.


Member Function Documentation

template<typename _char_type , typename _traits_type , typename _alloc_type >
template<typename _value_type >
_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.

template<typename _char_type , typename _traits_type , typename _alloc_type >
template<typename _value_type >
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.

template<typename _char_type , typename _traits_type , typename _alloc_type >
template<typename _value_type >
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.

template<typename _char_type , typename _traits_type , typename _alloc_type >
template<typename _value_type >
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.


Member Data Documentation

template<typename _char_type , typename _traits_type , typename _alloc_type >
stream_type lite::basic_conversion< _char_type, _traits_type, _alloc_type >::stream

the conversion setting can be modified by directly accessing the stream object


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Defines

Generated on Fri Nov 6 02:03:21 2009 for Lite by  doxygen 1.6.0