sbuild
1.7.1
|
Configuration file parser. More...
#include <keyfile.h>
Public Types | |
enum | priority { PRIORITY_OPTIONAL, PRIORITY_REQUIRED, PRIORITY_DISALLOWED, PRIORITY_DEPRECATED, PRIORITY_OBSOLETE } |
Configuration parameter priority. More... | |
enum | error_code { BAD_FILE, DEPRECATED_KEY, DEPRECATED_KEY_NL, DISALLOWED_KEY, DISALLOWED_KEY_NL, DUPLICATE_GROUP, DUPLICATE_KEY, INVALID_GROUP, INVALID_KEY, INVALID_LINE, MISSING_KEY, MISSING_KEY_NL, NO_GROUP, NO_KEY, OBSOLETE_KEY, OBSOLETE_KEY_NL, PASSTHROUGH_G, PASSTHROUGH_GK, PASSTHROUGH_LG, PASSTHROUGH_LGK, UNKNOWN_KEY } |
Error codes. More... | |
typedef parse_error< error_code > | error |
Exception type. | |
typedef std::string | group_name_type |
Group name. | |
typedef std::string | key_type |
Key name. | |
typedef std::string | value_type |
Value. | |
typedef std::string | comment_type |
Comment. | |
typedef unsigned int | size_type |
Line number. | |
typedef std::vector < group_name_type > | group_list |
Vector of groups. | |
typedef std::vector< value_type > | value_list |
Vector of values. | |
Public Member Functions | |
keyfile () | |
The constructor. | |
virtual | ~keyfile () |
The destructor. | |
group_list | get_groups () const |
Get a list of groups. More... | |
key_list | get_keys (const group_name_type &group) const |
Get a list of keys in a group. More... | |
void | check_keys (const group_name_type &group, const key_list &keys) const |
Check for unused keys in a group. More... | |
bool | has_group (const group_name_type &group) const |
Check if a group exists. More... | |
bool | has_key (const group_name_type &group, const key_type &key) const |
Check if a key exists. More... | |
void | set_group (const group_name_type &group, const comment_type &comment) |
Set a group. More... | |
void | set_group (const group_name_type &group, const comment_type &comment, size_type line) |
Set a group. More... | |
comment_type | get_comment (const group_name_type &group) const |
Get a group comment. More... | |
comment_type | get_comment (const group_name_type &group, const key_type &key) const |
Get a key comment. More... | |
size_type | get_line (const group_name_type &group) const |
Get a group line number. More... | |
size_type | get_line (const group_name_type &group, const key_type &key) const |
Get a key line number. More... | |
template<typename T > | |
bool | get_value (const group_name_type &group, const key_type &key, T &value) const |
Get a key value. More... | |
template<typename T > | |
bool | get_value (const group_name_type &group, const key_type &key, priority priority, T &value) const |
Get a key value. More... | |
bool | get_locale_string (const group_name_type &group, const key_type &key, value_type &value) const |
Get a localised key string value. More... | |
bool | get_locale_string (const group_name_type &group, const key_type &key, priority priority, value_type &value) const |
Get a localised key string value. More... | |
bool | get_locale_string (const group_name_type &group, const key_type &key, const std::string &locale, value_type &value) const |
Get a localised key string value for a specific locale. More... | |
bool | get_locale_string (const group_name_type &group, const key_type &key, const std::string &locale, priority priority, value_type &value) const |
Get a localised key string value for a specific locale. More... | |
template<typename C > | |
bool | get_list_value (const group_name_type &group, const key_type &key, C &container) const |
Get a key value as a list. More... | |
template<typename C > | |
bool | get_list_value (const group_name_type &group, const key_type &key, priority priority, C &container) const |
Get a key value as a list. More... | |
template<typename C > | |
bool | get_set_value (const group_name_type &group, const key_type &key, C &container) const |
Get a key value as a set. More... | |
template<typename C > | |
bool | get_set_value (const group_name_type &group, const key_type &key, priority priority, C &container) const |
Get a key value as a set. More... | |
template<typename T > | |
void | set_value (const group_name_type &group, const key_type &key, T const &value) |
Set a key value. More... | |
template<typename T > | |
void | set_value (const group_name_type &group, const key_type &key, T const &value, const comment_type &comment) |
Set a key value. More... | |
template<typename T > | |
void | set_value (const group_name_type &group, const key_type &key, T const &value, const comment_type &comment, size_type line) |
Set a key value. More... | |
template<typename I > | |
void | set_list_value (const group_name_type &group, const key_type &key, I begin, I end) |
Set a key value from a list. More... | |
template<typename I > | |
void | set_list_value (const group_name_type &group, const key_type &key, I begin, I end, const comment_type &comment) |
Set a key value from a list. More... | |
template<typename I > | |
void | set_list_value (const group_name_type &group, const key_type &key, I begin, I end, const comment_type &comment, size_type line) |
Set a key value from a list. More... | |
template<typename I > | |
void | set_set_value (const group_name_type &group, const key_type &key, I begin, I end) |
Set a key value from a set. More... | |
template<typename I > | |
void | set_set_value (const group_name_type &group, const key_type &key, I begin, I end, const comment_type &comment) |
Set a key value from a set. More... | |
template<typename I > | |
void | set_set_value (const group_name_type &group, const key_type &key, I begin, I end, const comment_type &comment, size_type line) |
Set a key value from a set. More... | |
void | remove_group (const group_name_type &group) |
Remove a group. More... | |
void | remove_key (const group_name_type &group, const key_type &key) |
Remove a key. More... | |
keyfile & | operator+= (const keyfile &rhs) |
Add a keyfile to the keyfile. More... | |
Static Public Member Functions | |
template<class C , typename T > | |
static void | set_object_value (C const &object, T(C::*method)() const, keyfile &keyfile, const group_name_type &group, const key_type &key) |
Set a key value from an object method return value. More... | |
template<class C , typename T > | |
static void | set_object_value (C const &object, T const &(C::*method)() const, keyfile &keyfile, const group_name_type &group, const key_type &key) |
Set a key value from an object method return value reference. More... | |
template<class C , typename T > | |
static void | set_object_list_value (C const &object, T(C::*method)() const, keyfile &keyfile, const group_name_type &group, const key_type &key) |
Set a key list value from an object method return value. More... | |
template<class C , typename T > | |
static void | set_object_list_value (C const &object, T const &(C::*method)() const, keyfile &keyfile, const group_name_type &group, const key_type &key) |
Set a key list value from an object method return value. More... | |
template<class C , typename T > | |
static void | set_object_set_value (C const &object, T(C::*method)() const, keyfile &keyfile, const group_name_type &group, const key_type &key) |
Set a key set value from an object method return value. More... | |
template<class C , typename T > | |
static void | set_object_set_value (C const &object, T const &(C::*method)() const, keyfile &keyfile, const group_name_type &group, const key_type &key) |
Set a key set value from an object method return value. More... | |
template<class C , typename T > | |
static void | get_object_value (C &object, void(C::*method)(T param), const keyfile &keyfile, const group_name_type &group, const key_type &key, keyfile::priority priority) |
Get a key value and set it in an object using an object method. More... | |
template<class C , typename T > | |
static void | get_object_value (C &object, void(C::*method)(T const ¶m), const keyfile &keyfile, const group_name_type &group, const key_type &key, keyfile::priority priority) |
Get a key value and set it by reference in an object using an object method. More... | |
template<class C , typename T > | |
static void | get_object_list_value (C &object, void(C::*method)(T param), const keyfile &keyfile, const group_name_type &group, const key_type &key, keyfile::priority priority) |
Get a key list value and set it in an object using an object method. More... | |
template<class C , typename T > | |
static void | get_object_list_value (C &object, void(C::*method)(T const ¶m), const keyfile &keyfile, const group_name_type &group, const key_type &key, keyfile::priority priority) |
Get a key list value and set it by reference in an object using an object method. More... | |
template<class C , typename T > | |
static void | get_object_set_value (C &object, void(C::*method)(T param), const keyfile &keyfile, const group_name_type &group, const key_type &key, keyfile::priority priority) |
Get a key set value and set it in an object using an object method. More... | |
template<class C , typename T > | |
static void | get_object_set_value (C &object, void(C::*method)(T const ¶m), const keyfile &keyfile, const group_name_type &group, const key_type &key, keyfile::priority priority) |
Get a key set value and set it by reference in an object using an object method. More... | |
Protected Types | |
typedef boost::any | internal_value_type |
Internal value. | |
typedef std::tuple< key_type, internal_value_type, comment_type, size_type > | item_type |
Key-value-comment-line tuple. | |
typedef std::map< key_type, item_type > | item_map_type |
Map between key name and key-internal_value-comment tuple. | |
typedef std::tuple < group_name_type, item_map_type, comment_type, size_type > | group_type |
Group-items-comment-line tuple. | |
typedef std::map < group_name_type, group_type > | group_map_type |
Map between group name and group-items-comment tuple. | |
typedef std::vector< key_type > | key_list |
Vector of keys. | |
Protected Member Functions | |
void | set_value (const group_name_type &group, const key_type &key, const internal_value_type &value, const comment_type &comment, size_type line) |
Set a key value. More... | |
const group_type * | find_group (const group_name_type &group) const |
Find a group by it's name. More... | |
group_type * | find_group (const group_name_type &group) |
Find a group by it's name. More... | |
const item_type * | find_item (const group_name_type &group, const key_type &key) const |
Find a key by it's group and name. More... | |
item_type * | find_item (const group_name_type &group, const key_type &key) |
Find a key by it's group and name. More... | |
void | check_priority (const group_name_type &group, const key_type &key, priority priority, bool valid) const |
Check if a key is missing or present when not permitted. More... | |
Protected Attributes | |
group_map_type | groups |
The top-level groups. | |
value_type | separator |
The separator used as a list item delimiter. | |
Friends | |
keyfile | operator+ (const keyfile &lhs, const keyfile &rhs) |
Add a keyfile to the keyfile. More... | |
Configuration file parser.
This class loads an INI-style configuration file from a file or stream. The format is documented in schroot.conf(5).
Error codes.
Configuration parameter priority.
void sbuild::keyfile::check_keys | ( | const group_name_type & | group, |
const key_list & | keys | ||
) | const |
Check for unused keys in a group.
If keys other than the specified keys exist in the specified group, print a warning about unknown keys having been used.
group | the group to use. |
keys | the keys which have been used. |
References sbuild::_(), sbuild::log_exception_warning(), and sbuild::error_base::set_reason().
|
protected |
Check if a key is missing or present when not permitted.
group | the group the key is in. |
key | the key to get. |
priority | the key priority. |
valid | true if key exists, false if not existing. |
References sbuild::_(), sbuild::log_exception_warning(), and sbuild::error_base::set_reason().
Referenced by get_list_value(), get_set_value(), and get_value().
|
protected |
Find a group by it's name.
group | the group to find. |
Referenced by set_value().
|
protected |
Find a group by it's name.
group | the group to find. |
|
protected |
Find a key by it's group and name.
group | the group the key is in. |
key | the key to find |
Referenced by get_value().
|
protected |
Find a key by it's group and name.
group | the group the key is in. |
key | the key to find |
sbuild::keyfile::comment_type sbuild::keyfile::get_comment | ( | const group_name_type & | group) | const |
Get a group comment.
group | the group to find. |
Referenced by sbuild::keyfile_writer::write_stream().
sbuild::keyfile::comment_type sbuild::keyfile::get_comment | ( | const group_name_type & | group, |
const key_type & | key | ||
) | const |
Get a key comment.
group | the group to find. |
key | the key to find. |
sbuild::keyfile::group_list sbuild::keyfile::get_groups | ( | ) | const |
Get a list of groups.
Referenced by sbuild::chroot::config::load_keyfile(), and sbuild::keyfile_writer::write_stream().
sbuild::keyfile::key_list sbuild::keyfile::get_keys | ( | const group_name_type & | group) | const |
Get a list of keys in a group.
group | the group to use. |
Referenced by sbuild::chroot::facet::userdata::set_keyfile(), and sbuild::keyfile_writer::write_stream().
sbuild::keyfile::size_type sbuild::keyfile::get_line | ( | const group_name_type & | group) | const |
Get a group line number.
group | the group to find. |
Referenced by sbuild::chroot::config::add(), get_list_value(), get_object_list_value(), get_object_set_value(), get_object_value(), get_set_value(), get_value(), and sbuild::chroot::facet::userdata::set_keyfile().
sbuild::keyfile::size_type sbuild::keyfile::get_line | ( | const group_name_type & | group, |
const key_type & | key | ||
) | const |
Get a key line number.
group | the group to find. |
key | the key to find. |
|
inline |
Get a key value as a list.
group | the group the key is in. |
key | the key to get. |
container | the container to store the key's value in. The value type must be settable from an istream and be copyable. The list must be a container with a standard insert method. |
References get_line(), get_value(), sbuild::log_exception_warning(), sbuild::parse_value(), PASSTHROUGH_GK, PASSTHROUGH_LGK, separator, and sbuild::split_string().
Referenced by get_list_value(), and get_object_list_value().
|
inline |
Get a key value as a list.
If the value does not exist, is deprecated or obsolete, warn appropriately.
group | the group the key is in. |
key | the key to get. |
priority | the priority of the option. |
container | the container to store the key's value in. The value type must be settable from an istream and be copyable. The list must be a container with a standard insert method. |
References check_priority(), and get_list_value().
bool sbuild::keyfile::get_locale_string | ( | const group_name_type & | group, |
const key_type & | key, | ||
value_type & | value | ||
) | const |
Get a localised key string value.
group | the group the key is in. |
key | the key to get. |
value | the string to store the key's localised value in. |
bool sbuild::keyfile::get_locale_string | ( | const group_name_type & | group, |
const key_type & | key, | ||
priority | priority, | ||
value_type & | value | ||
) | const |
Get a localised key string value.
If the value does not exist, is deprecated or obsolete, warn appropriately.
group | the group the key is in. |
key | the key to get. |
priority | the priority of the option. |
value | the string to store the key's localised value in. |
bool sbuild::keyfile::get_locale_string | ( | const group_name_type & | group, |
const key_type & | key, | ||
const std::string & | locale, | ||
value_type & | value | ||
) | const |
Get a localised key string value for a specific locale.
group | the group the key is in. |
key | the key to get. |
locale | the locale to use. |
value | the string to store the key's localised value in. |
bool sbuild::keyfile::get_locale_string | ( | const group_name_type & | group, |
const key_type & | key, | ||
const std::string & | locale, | ||
priority | priority, | ||
value_type & | value | ||
) | const |
Get a localised key string value for a specific locale.
If the value does not exist, is deprecated or obsolete, warn appropriately.
group | the group the key is in. |
key | the key to get. |
locale | the locale to use. |
priority | the priority of the option. |
value | the string to store the key's localised value in. |
|
inlinestatic |
Get a key list value and set it in an object using an object method.
This is the same as calling get_list_value directly, but handles exceptions being thrown by the object method, and deserialisation errors, which are turned into error exceptions pointing to the group, key and line number in the input file.
object | the object to use. |
method | the object method to call. |
keyfile | the keyfile to use. |
group | the group the key is in. |
key | the key to set. |
priority | the key priority. |
References get_line(), get_list_value(), PASSTHROUGH_GK, and PASSTHROUGH_LGK.
Referenced by sbuild::chroot::facet::source_clonable::set_keyfile(), and sbuild::chroot::chroot::set_keyfile().
|
inlinestatic |
Get a key list value and set it by reference in an object using an object method.
This is the same as calling get_list_value directly, but handles exceptions being thrown by the object method, and deserialisation errors, which are turned into error exceptions pointing to the group, key and line number in the input file.
object | the object to use. |
method | the object method to call. |
keyfile | the keyfile to use. |
group | the group the key is in. |
key | the key to set. |
priority | the key priority. |
References get_line(), get_list_value(), PASSTHROUGH_GK, and PASSTHROUGH_LGK.
|
inlinestatic |
Get a key set value and set it in an object using an object method.
This is the same as calling get_set_value directly, but handles exceptions being thrown by the object method, and deserialisation errors, which are turned into error exceptions pointing to the group, key and line number in the input file.
object | the object to use. |
method | the object method to call. |
keyfile | the keyfile to use. |
group | the group the key is in. |
key | the key to set. |
priority | the key priority. |
References get_line(), get_set_value(), PASSTHROUGH_GK, and PASSTHROUGH_LGK.
Referenced by sbuild::chroot::facet::userdata::set_keyfile().
|
inlinestatic |
Get a key set value and set it by reference in an object using an object method.
This is the same as calling get_set_value directly, but handles exceptions being thrown by the object method, and deserialisation errors, which are turned into error exceptions pointing to the group, key and line number in the input file.
object | the object to use. |
method | the object method to call. |
keyfile | the keyfile to use. |
group | the group the key is in. |
key | the key to set. |
priority | the key priority. |
References get_line(), get_set_value(), PASSTHROUGH_GK, and PASSTHROUGH_LGK.
|
inlinestatic |
Get a key value and set it in an object using an object method.
This is the same as calling get_value directly, but handles exceptions being thrown by the object method, and deserialisation errors, which are turned into error exceptions pointing to the group, key and line number in the input file.
object | the object to use. |
method | the object method to call. |
keyfile | the keyfile to use. |
group | the group the key is in. |
key | the key to set. |
priority | the key priority. |
References get_line(), get_value(), PASSTHROUGH_GK, and PASSTHROUGH_LGK.
Referenced by sbuild::chroot::facet::personality::set_keyfile(), sbuild::chroot::facet::directory_base::set_keyfile(), sbuild::chroot::facet::block_device_base::set_keyfile(), sbuild::chroot::facet::loopback::set_keyfile(), sbuild::chroot::facet::session::set_keyfile(), sbuild::chroot::facet::mountable::set_keyfile(), sbuild::chroot::facet::lvm_snapshot::set_keyfile(), sbuild::chroot::facet::custom::set_keyfile(), sbuild::chroot::facet::unshare::set_keyfile(), sbuild::chroot::facet::file::set_keyfile(), sbuild::chroot::facet::btrfs_snapshot::set_keyfile(), sbuild::chroot::facet::source_clonable::set_keyfile(), sbuild::chroot::facet::fsunion::set_keyfile(), and sbuild::chroot::chroot::set_keyfile().
|
inlinestatic |
Get a key value and set it by reference in an object using an object method.
This is the same as calling get_value directly, but handles exceptions being thrown by the object method, and deserialisation errors, which are turned into error exceptions pointing to the group, key and line number in the input file.
object | the object to use. |
method | the object method to call. |
keyfile | the keyfile to use. |
group | the group the key is in. |
key | the key to set. |
priority | the key priority. |
References get_line(), get_value(), PASSTHROUGH_GK, and PASSTHROUGH_LGK.
|
inline |
Get a key value as a set.
group | the group the key is in. |
key | the key to get. |
container | the container to store the key's value in. The value type must be settable from an istream and be copyable. The set must be a container with a standard insert method. |
References get_line(), get_value(), sbuild::log_exception_warning(), sbuild::parse_value(), PASSTHROUGH_GK, PASSTHROUGH_LGK, separator, and sbuild::split_string().
Referenced by get_object_set_value(), and get_set_value().
|
inline |
Get a key value as a set.
If the value does not exist, is deprecated or obsolete, warn appropriately.
group | the group the key is in. |
key | the key to get. |
priority | the priority of the option. |
container | the container to store the key's value in. The value type must be settable from an istream and be copyable. The set must be a container with a standard insert method. |
References check_priority(), and get_set_value().
|
inline |
Get a key value.
group | the group the key is in. |
key | the key to get. |
value | the value to store the key's value in. This must be settable from an istream and be copyable. |
References sbuild::DEBUG_INFO, sbuild::DEBUG_NOTICE, find_item(), get_line(), sbuild::log_debug(), sbuild::log_exception_warning(), sbuild::parse_value(), PASSTHROUGH_GK, and PASSTHROUGH_LGK.
Referenced by get_list_value(), get_object_value(), get_set_value(), get_value(), sbuild::chroot::config::load_keyfile(), sbuild::chroot::facet::userdata::set_keyfile(), and sbuild::keyfile_writer::write_stream().
|
inline |
Get a key value.
If the value does not exist, is deprecated or obsolete, warn appropriately.
group | the group the key is in. |
key | the key to get. |
priority | the priority of the option. |
value | the value to store the key's value in. This must be settable from an istream and be copyable. |
References check_priority(), and get_value().
bool sbuild::keyfile::has_group | ( | const group_name_type & | group) | const |
Check if a group exists.
group | the group to check for. |
Referenced by sbuild::keyfile_reader::read_stream().
bool sbuild::keyfile::has_key | ( | const group_name_type & | group, |
const key_type & | key | ||
) | const |
Check if a key exists.
group | the group the key is in. |
key | the key to check for. |
Referenced by sbuild::keyfile_reader::read_stream(), and sbuild::chroot::facet::directory_base::set_keyfile().
sbuild::keyfile & sbuild::keyfile::operator+= | ( | const keyfile & | rhs) |
Add a keyfile to the keyfile.
rhs | the keyfile to add. |
References groups.
void sbuild::keyfile::remove_group | ( | const group_name_type & | group) |
Remove a group.
group | the group to remove. |
Referenced by sbuild::chroot::chroot::get_keyfile().
void sbuild::keyfile::remove_key | ( | const group_name_type & | group, |
const key_type & | key | ||
) |
Remove a key.
group | the group the key is in. |
key | the key to remove. |
void sbuild::keyfile::set_group | ( | const group_name_type & | group, |
const comment_type & | comment | ||
) |
Set a group.
The group will be created (and the comment set) only if the group does not already exist.
group | the group to set. |
comment | the comment to set. |
Referenced by sbuild::keyfile_reader::read_stream(), and set_value().
void sbuild::keyfile::set_group | ( | const group_name_type & | group, |
const comment_type & | comment, | ||
size_type | line | ||
) |
Set a group.
The group will be created (and the comment set) only if the group does not already exist.
group | the group to set. |
comment | the comment to set. |
line | the line number in the input file, or 0 otherwise. |
|
inline |
Set a key value from a list.
group | the group the key is in. |
key | the key to set. |
begin | an iterator referring to the start of the list. The value type must allow output to an ostream. |
end | an iterator referring to the end of the list. |
Referenced by set_list_value(), set_object_list_value(), and set_set_value().
|
inline |
Set a key value from a list.
group | the group the key is in. |
key | the key to set. |
begin | an iterator referring to the start of the list. The value type must allow output to an ostream. |
end | an iterator referring to the end of the list. |
comment | the comment for this key. |
References set_list_value().
|
inline |
Set a key value from a list.
group | the group the key is in. |
key | the key to set. |
begin | an iterator referring to the start of the list. The value type must allow output to an ostream. |
end | an iterator referring to the end of the list. |
comment | the comment for this key. |
line | the line number in the input file, or 0 otherwise. |
References separator, and set_value().
|
inlinestatic |
Set a key list value from an object method return value.
The method must return a container with begin() and end() methods which return forward iterators. This is the same as calling set_list_value directly, but handles exceptions being thrown by the object method, which are turned into error exceptions.
object | the object to use. |
method | the object method to call. |
keyfile | the keyfile to use. |
group | the group the key is in. |
key | the key to set. |
References PASSTHROUGH_GK, and set_list_value().
Referenced by sbuild::chroot::facet::source_clonable::get_keyfile(), and sbuild::chroot::chroot::get_keyfile().
|
inlinestatic |
Set a key list value from an object method return value.
The method must return a container reference with begin() and end() methods which return forward iterators. This is the same as calling set_list_value directly, but handles exceptions being thrown by the object method, which are turned into error exceptions.
object | the object to use. |
method | the object method to call. |
keyfile | the keyfile to use. |
group | the group the key is in. |
key | the key to set. |
References PASSTHROUGH_GK, and set_list_value().
|
inlinestatic |
Set a key set value from an object method return value.
The method must return a container with begin() and end() methods which return forward iterators. This is the same as calling set_set_value directly, but handles exceptions being thrown by the object method, which are turned into error exceptions.
object | the object to use. |
method | the object method to call. |
keyfile | the keyfile to use. |
group | the group the key is in. |
key | the key to set. |
References PASSTHROUGH_GK, and set_set_value().
Referenced by sbuild::chroot::facet::userdata::get_keyfile().
|
inlinestatic |
Set a key set value from an object method return value.
The method must return a container reference with begin() and end() methods which return forward iterators. This is the same as calling set_set_value directly, but handles exceptions being thrown by the object method, which are turned into error exceptions.
object | the object to use. |
method | the object method to call. |
keyfile | the keyfile to use. |
group | the group the key is in. |
key | the key to set. |
References PASSTHROUGH_GK, and set_set_value().
|
inlinestatic |
Set a key value from an object method return value.
This is the same as calling set_value directly, but handles exceptions being thrown by the object method, which are turned into error exceptions.
object | the object to use. |
method | the object method to call. |
keyfile | the keyfile to use. |
group | the group the key is in. |
key | the key to set. |
References PASSTHROUGH_GK, and set_value().
Referenced by sbuild::chroot::facet::personality::get_keyfile(), sbuild::chroot::facet::directory_base::get_keyfile(), sbuild::chroot::facet::block_device_base::get_keyfile(), sbuild::chroot::facet::loopback::get_keyfile(), sbuild::chroot::facet::session::get_keyfile(), sbuild::chroot::facet::mountable::get_keyfile(), sbuild::chroot::facet::lvm_snapshot::get_keyfile(), sbuild::chroot::facet::custom::get_keyfile(), sbuild::chroot::facet::unshare::get_keyfile(), sbuild::chroot::facet::file::get_keyfile(), sbuild::chroot::facet::btrfs_snapshot::get_keyfile(), sbuild::chroot::facet::source_clonable::get_keyfile(), sbuild::chroot::facet::fsunion::get_keyfile(), and sbuild::chroot::chroot::get_keyfile().
|
inlinestatic |
Set a key value from an object method return value reference.
This is the same as calling set_value directly, but handles exceptions being thrown by the object method, which are turned into error exceptions.
object | the object to use. |
method | the object method to call. |
keyfile | the keyfile to use. |
group | the group the key is in. |
key | the key to set. |
References PASSTHROUGH_GK, and set_value().
|
inline |
Set a key value from a set.
group | the group the key is in. |
key | the key to set. |
begin | an iterator referring to the start of the set. The value type must allow output to an ostream. |
end | an iterator referring to the end of the set. |
References set_list_value().
Referenced by set_object_set_value().
|
inline |
Set a key value from a set.
group | the group the key is in. |
key | the key to set. |
begin | an iterator referring to the start of the set. The value type must allow output to an ostream. |
end | an iterator referring to the end of the set. |
comment | the comment for this key. |
References set_list_value().
|
inline |
Set a key value from a set.
group | the group the key is in. |
key | the key to set. |
begin | an iterator referring to the start of the set. The value type must allow output to an ostream. |
end | an iterator referring to the end of the set. |
comment | the comment for this key. |
line | the line number in the input file, or 0 otherwise. |
References set_list_value().
|
inline |
Set a key value.
group | the group the key is in. |
key | the key to set. |
value | the value to get the key's value from. This must allow output to an ostream. |
Referenced by sbuild::chroot::facet::userdata::get_keyfile(), sbuild::keyfile_reader::read_stream(), set_list_value(), set_object_value(), and set_value().
|
inline |
Set a key value.
group | the group the key is in. |
key | the key to set. |
value | the value to get the key's value from. This must allow output to an ostream. |
comment | the comment for this key. |
References set_value().
|
inlineprotected |
Set a key value.
group | the group the key is in. |
key | the key to set. |
value | the value to get the key's value from. |
comment | the comment for this key. |
line | the line number in the input file, or 0 otherwise. |
References find_group(), and set_group().
|
inline |
Set a key value.
group | the group the key is in. |
key | the key to set. |
value | the value to get the key's value from. This must allow output to an ostream. |
comment | the comment for this key. |
line | the line number in the input file, or 0 otherwise. |
References find_group(), and set_group().
Add a keyfile to the keyfile.
lhs | the keyfile to add to. |
rhs | the values to add. |