sbuild
1.7.1
|
Format names and values for output. More...
#include <format-detail.h>
Public Member Functions | |
format_detail (const std::string &title, std::locale locale) | |
The constructor. More... | |
format_detail & | add (const std::string &name, const std::string &value) |
Add a name-value pair (string specialisation). More... | |
format_detail & | add (const std::string &name, bool value) |
Add a name-value pair (bool specialisation). More... | |
format_detail & | add (const std::string &name, const string_list &value) |
Add a name-value pair (string_list specialisation). More... | |
template<typename T > | |
format_detail & | add (const std::string &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, const format_detail &rhs) |
Output the format_detail to an ostream. More... | |
Format names and values for output.
sbuild::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 & sbuild::format_detail::add | ( | const std::string & | name, |
const std::string & | 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::facet::personality::get_details(), sbuild::chroot::facet::userdata::get_details(), sbuild::chroot::facet::directory_base::get_details(), sbuild::chroot::facet::block_device_base::get_details(), sbuild::chroot::facet::loopback::get_details(), sbuild::chroot::facet::session::get_details(), sbuild::chroot::facet::mountable::get_details(), sbuild::chroot::facet::lvm_snapshot::get_details(), sbuild::chroot::facet::unshare::get_details(), sbuild::chroot::facet::file::get_details(), sbuild::chroot::facet::btrfs_snapshot::get_details(), sbuild::chroot::facet::source_clonable::get_details(), sbuild::chroot::facet::fsunion::get_details(), and sbuild::chroot::chroot::get_details().
format_detail & sbuild::format_detail::add | ( | const std::string & | name, |
bool | value | ||
) |
Add a name-value pair (bool specialisation).
name | the name. |
value | the bool value. |
References sbuild::_(), and add().
format_detail & sbuild::format_detail::add | ( | const std::string & | name, |
const string_list & | 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().
Referenced by add().
|
inline |
Add a name-value pair.
name | the name. |
value | the value. |
References add().
|
private |
Get the title of the chroot.
The title is formatted for output.
References sbuild::_(), and title.
|
friend |
Output the format_detail to an ostream.
stream | the stream to output to. |
rhs | the format_detail to output. |