sbuild
1.6.10
|
Format names and values for output. More...
#include <sbuild-format-detail.h>
Public Member Functions | |
format_detail (const std::string &title, std::locale locale) | |
The constructor. More... | |
format_detail & | add (std::string const &name, std::string const &value) |
Add a name-value pair (string specialisation). More... | |
format_detail & | add (std::string const &name, bool value) |
Add a name-value pair (bool specialisation). More... | |
format_detail & | add (std::string const &name, string_list const &value) |
Add a name-value pair (string_list specialisation). More... | |
template<typename T > | |
format_detail & | add (std::string const &name, T const &value) |
Add a name-value pair. More... | |
Private Types | |
typedef std::pair< std::string, std::string > | value_type |
Name and value pairs. | |
typedef std::vector< value_type > | list_type |
List of name and value pairs. | |
Private Member Functions | |
std::string | get_title () const |
Get the title of the chroot. More... | |
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. More... | |
Format names and values for output.
format_detail::format_detail | ( | const std::string & | title, |
std::locale | locale | ||
) |
The constructor.
title | the title of the set of name and value pairs. |
locale | the locale to use for formatting the values. |
format_detail & format_detail::add | ( | std::string const & | name, |
std::string const & | value | ||
) |
Add a name-value pair (string specialisation).
name | the name. |
value | the string value. |
References sbuild::DEBUG_INFO, sbuild::DEBUG_WARNING, items, and sbuild::log_debug().
Referenced by add(), sbuild::chroot_directory_base::get_details(), sbuild::chroot_block_device_base::get_details(), sbuild::chroot_facet_personality::get_details(), sbuild::chroot_facet_userdata::get_details(), sbuild::chroot_loopback::get_details(), sbuild::chroot_lvm_snapshot::get_details(), sbuild::chroot_facet_mountable::get_details(), sbuild::chroot_facet_session::get_details(), sbuild::chroot_btrfs_snapshot::get_details(), sbuild::chroot_file::get_details(), sbuild::chroot_facet_union::get_details(), sbuild::chroot_facet_source_clonable::get_details(), and sbuild::chroot::get_details().
format_detail & format_detail::add | ( | std::string const & | name, |
bool | value | ||
) |
Add a name-value pair (bool specialisation).
name | the name. |
value | the bool value. |
References sbuild::_(), and add().
format_detail & format_detail::add | ( | std::string const & | name, |
string_list const & | value | ||
) |
Add a name-value pair (string_list specialisation).
name | the name. |
value | the string_list value. |
References add(), and sbuild::string_list_to_string().
|
inline |
Add a name-value pair.
name | the name. |
value | the value. |
References add(), and get_title().
|
private |
Get the title of the chroot.
The title is formatted for output.
References sbuild::_(), and title.
Referenced by add().
|
friend |
Output the format_detail to an ostream.
stream | the stream to output to. |
rhs | the format_detail to output. |