microsoft / wil

Windows Implementation Library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wil::reg functions need an enumeration function to walk values and keys

keith-horton opened this issue · comments

Feature Request: need to add functions to enumerate values and keys which return an object that supports iterator semantics for ranged-for loops and algorithms, as well as supporting ranges.

e.g., walking dword values under a registry key:

for (const auto& value_name : wil::reg::enumerate_values(key)
{
auto value = wil::reg::get_value_dword(key, value_name);
}

and

for (auto&& [key, value] : wil::reg::enumerate_names_and_values(key)
{

}

here was my first run at this. I'm sure it needs improvements.

We had a tested implementation earlier - it was removed as folks requested the initial commit be much simpler.
wil_iterator.txt