sbuild::parse_value Class Reference

Parse a text string value. More...

#include <sbuild-parse-value.h>

Collaboration diagram for sbuild::parse_value:

Collaboration graph
[legend]
List of all members.

Public Types

typedef runtime_error_custom<
parse_value
error
 Exception type.

Public Member Functions

 parse_value (std::string const &value)
 The constructor.
virtual ~parse_value ()
 The destructor.
template<typename T>
 operator T (void)
 Convert object into any type T.

Private Member Functions

bool parse (bool &parsed_value) const
 Parse a boolean value.
bool parse (std::string &parsed_value) const
 Parse a string value.
template<typename T>
bool parse (T &parsed_value) const
 Parse a value of type T.

Private Attributes

std::string value

Detailed Description

Parse a text string value.

This is a wrapper around a string value, to convert it into any desired type.


Member Typedef Documentation

typedef runtime_error_custom<parse_value> sbuild::parse_value::error
 

Exception type.


Constructor & Destructor Documentation

parse_value::parse_value std::string const &  value  ) 
 

The constructor.

Parameters:
value the value to parse.

parse_value::~parse_value  )  [virtual]
 

The destructor.


Member Function Documentation

template<typename T>
sbuild::parse_value::operator T void   )  [inline]
 

Convert object into any type T.

Returns:
an object of type T; an exception will be thrown on parse failure.

Here is the call graph for this function:

template<typename T>
bool sbuild::parse_value::parse T &  parsed_value  )  const [inline, private]
 

Parse a value of type T.

Parameters:
parsed_value the variable to store the parsed value.
Returns:
true on success, false on failure.

Here is the call graph for this function:

bool parse_value::parse std::string &  parsed_value  )  const [private]
 

Parse a string value.

Parameters:
parsed_value the variable to store the parsed value.
Returns:
true on success, false on failure.

bool parse_value::parse bool &  parsed_value  )  const [private]
 

Parse a boolean value.

Parameters:
parsed_value the variable to store the parsed value.
Returns:
true on success, false on failure.


Member Data Documentation

std::string sbuild::parse_value::value [private]
 


The documentation for this class was generated from the following files:
Generated on Sat May 27 15:56:55 2006 for schroot by  doxygen 1.4.6