Logo Search packages:      
Sourcecode: schroot version File versions  Download package

template<typename T>
bool sbuild::keyfile::get_value ( std::string const &  group,
std::string const &  key,
T &  value 
) const [inline]

Get a key value.

Parameters:
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.
Returns:
true if the key was found, otherwise false (in which case value will be unchanged).

Definition at line 179 of file sbuild-keyfile.h.

References find_item().

Referenced by get_list_value(), get_locale_string(), get_value(), sbuild::chroot_config::parse_data(), sbuild::chroot::set_keyfile(), sbuild::chroot_plain::set_keyfile(), sbuild::chroot_lvm_snapshot::set_keyfile(), sbuild::chroot_file::set_keyfile(), and sbuild::chroot_block_device::set_keyfile().

    {
      log_debug(DEBUG_INFO) << "Getting keyfile group=" << group
                      << ", key=" << key << std::endl;
      const item_type *found_item = find_item(group, key);
      if (found_item)
      {
        std::string const& strval(std::tr1::get<1>(*found_item));
        return parse_value(strval, value);
      }
      log_debug(DEBUG_NOTICE) << "key not found" << std::endl;
      return false;
    }


Generated by  Doxygen 1.6.0   Back to index