tetengo 1.8.2
A multipurpose library set
Loading...
Searching...
No Matches
windows_X.hpp
Go to the documentation of this file.
1
7#if !defined(TETENGO_PLATFORMDEPENDENT_WINDOWSREGISTRY_HPP)
8#define TETENGO_PLATFORMDEPENDENT_WINDOWSREGISTRY_HPP
9
10#include <cstdint>
11#include <filesystem>
12#include <memory>
13#include <optional>
14#include <string>
15#include <string_view>
16#include <vector>
17
18#include <boost/core/noncopyable.hpp>
19
20
22{
30 class windows_registry_reader : private boost::noncopyable
31 {
32 public:
33 // constructors and destructor
34
40 explicit windows_registry_reader(const std::filesystem::path& subkey);
41
46
47
48 // functions
49
55 std::vector<std::string> child_subkeys() const;
56
62 std::vector<std::string> value_names() const;
63
72 std::optional<std::uint32_t> dword_value_of(const std::string_view& name) const;
73
82 std::optional<std::string> string_value_of(const std::string_view& name) const;
83
84
85 private:
86 // types
87
88 class impl;
89
90
91 // variables
92
93 const std::unique_ptr<impl> m_p_impl;
94 };
95
96
104 class windows_registry_writer : private boost::noncopyable
105 {
106 public:
107 // constructors and destructor
108
114 explicit windows_registry_writer(const std::filesystem::path& subkey);
115
120
121
122 // functions
123
130 void set_dword_value_of(const std::string_view& name, std::uint32_t value) const;
131
138 void set_string_value_of(const std::string_view& name, const std::string_view& value) const;
139
140
141 private:
142 // types
143
144 class impl;
145
146
147 // variables
148
149 const std::unique_ptr<impl> m_p_impl;
150 };
151
152
153}
154
155
156#endif
A Windows registry reader.
Definition windows_X.hpp:31
std::vector< std::string > value_names() const
Returns the value name list.
windows_registry_reader(const std::filesystem::path &subkey)
Creates a Windows registry reader.
std::vector< std::string > child_subkeys() const
Returns the child subkeys.
std::optional< std::uint32_t > dword_value_of(const std::string_view &name) const
Returns the DWORD value.
std::optional< std::string > string_value_of(const std::string_view &name) const
Returns the string value.
~windows_registry_reader()
Destroys the Windows registry reader.
A Windows registry writer.
Definition windows_X.hpp:105
void set_string_value_of(const std::string_view &name, const std::string_view &value) const
Sets a string value.
void set_dword_value_of(const std::string_view &name, std::uint32_t value) const
Sets a DWORD value.
~windows_registry_writer()
Destroys the Windows registry writer.
windows_registry_writer(const std::filesystem::path &subkey)
Creates a Windows registry writer.
Platform dependent processings.