sbuild::format_detail Class Reference

Format names and values for output. More...

#include <sbuild-format-detail.h>

Collaboration diagram for sbuild::format_detail:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 format_detail (const std::string &title, std::locale locale)
 The constructor.
virtual ~format_detail ()
format_detailadd (std::string const &name, std::string const &value)
 Add a name-value pair (string specialisation).
format_detailadd (std::string const &name, bool value)
 Add a name-value pair (bool specialisation).
format_detailadd (std::string const &name, string_list const &value)
 Add a name-value pair (string_list specialisation).
template<typename T >
format_detailadd (std::string const &name, T const &value)
 Add a name-value pair.

Private Types

typedef std::pair< std::string,
std::string > 
value_type
 Name and value pairs.
typedef std::vector< value_typelist_type
 List of name and value pairs.

Private Member Functions

std::string get_title () const
 Get the title of the chroot.

Private Attributes

std::string title
 The title of the items to format.
std::locale locale
 The locale to use for output.
list_type items
 The items to format;.

Friends

template<class charT , class traits >
std::basic_ostream< charT,
traits > & 
operator<< (std::basic_ostream< charT, traits > &stream, format_detail const &rhs)
 Output the format_detail to an ostream.

Detailed Description

Format names and values for output.


Member Typedef Documentation

typedef std::vector<value_type> sbuild::format_detail::list_type [private]

List of name and value pairs.

typedef std::pair<std::string,std::string> sbuild::format_detail::value_type [private]

Name and value pairs.


Constructor & Destructor Documentation

format_detail::format_detail ( const std::string &  title,
std::locale  locale 
)

The constructor.

Parameters:
title the title of the set of name and value pairs.
locale the locale to use for formatting the values.
format_detail::~format_detail (  )  [virtual]

Member Function Documentation

template<typename T >
format_detail& sbuild::format_detail::add ( std::string const &  name,
T const &  value 
) [inline]

Add a name-value pair.

Parameters:
name the name.
value the value.
Returns:
a reference to the format_detail object.

References add().

format_detail & format_detail::add ( std::string const &  name,
string_list const &  value 
)

Add a name-value pair (string_list specialisation).

Parameters:
name the name.
value the string_list value.
Returns:
a reference to the format_detail object.

References add(), and sbuild::string_list_to_string().

Referenced by add().

format_detail & format_detail::add ( std::string const &  name,
bool  value 
)

Add a name-value pair (bool specialisation).

Parameters:
name the name.
value the bool value.
Returns:
a reference to the format_detail object.

References sbuild::_(), and add().

format_detail & format_detail::add ( std::string const &  name,
std::string const &  value 
)
std::string format_detail::get_title (  )  const [private]

Get the title of the chroot.

The title is formatted for output.

Returns:
the formatted title.

References sbuild::_(), and title.


Friends And Related Function Documentation

template<class charT , class traits >
std::basic_ostream<charT,traits>& operator<< ( std::basic_ostream< charT, traits > &  stream,
format_detail const &  rhs 
) [friend]

Output the format_detail to an ostream.

Parameters:
stream the stream to output to.
rhs the format_detail to output.
Returns:
the stream.

Member Data Documentation

The items to format;.

Referenced by add().

std::locale sbuild::format_detail::locale [private]

The locale to use for output.

std::string sbuild::format_detail::title [private]

The title of the items to format.

Referenced by get_title().


The documentation for this class was generated from the following files:
Generated on Sat Jul 10 22:17:07 2010 for sbuild by  doxygen 1.6.3