/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * Copyright 2015 Danny Robson */ #pragma once #include "windows.hpp" #include #include "../view.hpp" #include #include namespace cruft::win32 { class key { public: key (key const &root, const char *child, REGSAM rights = KEY_READ); key (HKEY root, const char *child, REGSAM rights = KEY_READ); ~key (); class child_iterator { public: using value_type = key; using difference_type = std::ptrdiff_t; using pointer = value_type*; using reference = value_type&; using iterator_category = std::input_iterator_tag; child_iterator (key const &_parent); child_iterator (key const &_parent, int _index); key operator* (void) const; child_iterator& operator++ (); bool operator== (child_iterator const&); bool operator!= (child_iterator const&); private: key const &m_parent; int m_index; }; cruft::view subkeys (void); std::string name (void) const; template T data (const char *name = nullptr) const; std::set values (void) const; private: HKEY m_handle; }; }