comet::registry::info< error_policy > Class Template Reference

#include <comet/registry.h>

List of all members.

Public Types

typedef collection< error_policy,
value_iterator< error_policy >,
const_value_iterator< error_policy > > 
values_type
 Type returned by values().
typedef collection< error_policy,
name_iterator< error_policy,
impl::next_value > > 
value_names_type
 Type returned by value_names().
typedef collection< error_policy,
name_iterator< error_policy,
impl::next_key > > 
subkeys_type
 Type returned by subkeys().

Public Member Functions

 info (const impl::key_base &key)
void swap (info &rhs)
 Exception safe swap.
size_t num_values () const
 Number of values under this key (excluding the default value).
size_t num_subkeys () const
 Number of subkeys under this key.
size_t max_value_name () const
 Length of the longest value_name under this key (in TCHARs).
size_t max_subkey_name () const
 Length of the longest subkey name under this key (in TCHARs).
values_type values () const
 Return the collection of values.
value_names_type value_names () const
 Returns the collection of value names.
subkeys_type subkeys () const
 Returns the collection of subkey names.


Detailed Description

template<typename error_policy>
class comet::registry::info< error_policy >

Structure returned by regkey.enumerate()


Member Function Documentation

template<typename error_policy>
subkeys_type comet::registry::info< error_policy >::subkeys  )  const [inline]
 

Returns the collection of subkey names.

The value_type of the collection is std::basic_string<TCHAR>. Example - copy all subkeys of HKEY_LOCAL_MACHINE into a list

                        regkey::info_type info(regkey(HKEY_LOCAL_MACHINE).enumerate());
                        vector<string> subkey_names;
                        copy(info.subkeys().begin(), info.subkeys().end(), back_inserter(subkey_names));

template<typename error_policy>
value_names_type comet::registry::info< error_policy >::value_names  )  const [inline]
 

Returns the collection of value names.

The value_type of the collection is std::basic_string<TCHAR>. Example - copy all value names of HKEY_LOCAL_MACHINE into a list

                        regkey::info_type info(regkey(HKEY_LOCAL_MACHINE).enumerate());
                        vector<string> value_names;
                        copy(info.value_names().begin(), info.value_names().end(), back_inserter(value_names));

template<typename error_policy>
values_type comet::registry::info< error_policy >::values  )  const [inline]
 

Return the collection of values.

The value_type of the collection is std::pair<const std::basic_string<TCHAR>, regkey::mapped_type> regkey::mapped_type has implicit conversions to unsigned int and std::basic_string however. Example - copy all value-name/value pairs into a map

                        typedef std::basic_string<TCHAR> tstring;
                        regkey::info_type info(regkey(HKEY_LOCAL_MACHINE).enumerate());
                        map<tstring, regkey::mapped_type> values_map;
                        copy(info.values().begin(), info.values().end(), inserter(values_map, values_map.end()));
Example - copy all value-name/value pairs into a string map - exception will be thrown if a non string value is encountered.
                        typedef std::basic_string<TCHAR> tstring;
                        regkey::info_type info(regkey(HKEY_LOCAL_MACHINE).enumerate());
                        map<bstr_t, bstr_t> values_map;
                        copy(info.values().begin(), info.values().end(), inserter(values_map, values_map.end()));
Example - copy all value-name/value pairs into a string/int map - exception will be thrown if a non string value is encountered.
                        typedef std::basic_string<TCHAR> tstring;
                        regkey::info_type info(regkey(HKEY_LOCAL_MACHINE).enumerate());
                        map<bstr_t, int> values_map;
                        copy(info.values().begin(), info.values().end(), inserter(values_map, values_map.end()));


The documentation for this class was generated from the following file: