Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

s11n::io::strtool::STPrivate Namespace Reference

The functions in the Private namespace should not be used by client code. More...


Functions

template<typename value_type>
value_type from_string (const std::string &str, const value_type &errorVal) throw ()
 Lexically casts str to a value_type, returning errorVal if the conversion fails.
template<typename value_type>
std::string to_string (const value_type &obj) throw ()
 Returns a string representation of the given object, which must be ostreamble.
std::string from_string (const std::string &str, const std::string &) throw ()
 Convenience/efficiency overload.
std::string from_string (const char *str, const char *) throw ()
 Convenience/efficiency overload.
std::string to_string (const char *obj) throw ()
 Convenience/efficiency overload.
std::string to_string (const std::string &obj) throw ()
 Convenience/efficiency overload.


Detailed Description

The functions in the Private namespace should not be used by client code.

Function Documentation

std::string s11n::io::strtool::STPrivate::from_string const char *  str,
const char * 
throw () [inline]
 

Convenience/efficiency overload.

Definition at line 84 of file strtool.hpp.

std::string s11n::io::strtool::STPrivate::from_string const std::string &  str,
const std::string & 
throw () [inline]
 

Convenience/efficiency overload.

Definition at line 76 of file strtool.hpp.

template<typename value_type>
value_type s11n::io::strtool::STPrivate::from_string const std::string &  str,
const value_type &  errorVal
throw ()
 

Lexically casts str to a value_type, returning errorVal if the conversion fails.

TODO: implement the following suggestion from Kai Unger <kai.unger@hacon.de> (21 Sept 2004):

When the cast is done, you should check if there are unread characters left. For example, casting "1.2this_definitly_is_not_a_number" to double will not result in returning the error value, because conversion of "1.2" to 1.2d succeeds and the rest of the string is ignored.

Definition at line 42 of file strtool.hpp.

Referenced by s11n::Detail::variant::cast_to(), and s11n::io::strtool::from().

std::string s11n::io::strtool::STPrivate::to_string const std::string &  obj  )  throw () [inline]
 

Convenience/efficiency overload.

Definition at line 100 of file strtool.hpp.

std::string s11n::io::strtool::STPrivate::to_string const char *  obj  )  throw () [inline]
 

Convenience/efficiency overload.

Definition at line 92 of file strtool.hpp.

template<typename value_type>
std::string s11n::io::strtool::STPrivate::to_string const value_type &  obj  )  throw ()
 

Returns a string representation of the given object, which must be ostreamble.

Definition at line 58 of file strtool.hpp.

Referenced by s11n::Detail::variant::operator=(), s11n::io::strtool::to(), and s11n::Detail::variant::variant().


Generated on Sat Dec 10 13:42:30 2005 for libs11n-1.2.1 by  doxygen 1.4.4