MCPcopy Create free account
hub / github.com/Kitware/CMake / KeyHandler

Class KeyHandler

Source/cmWindowsRegistry.cxx:107–137  ·  view source on GitHub ↗

Class KeyHandler

Source from the content-addressed store, hash-verified

105
106// Class KeyHandler
107class KeyHandler
108{
109public:
110 using View = cmWindowsRegistry::View;
111 using ValueTypeSet = cmWindowsRegistry::ValueTypeSet;
112
113 KeyHandler(HKEY hkey)
114 : Handler(hkey)
115 {
116 }
117 ~KeyHandler() { RegCloseKey(this->Handler); }
118
119 static KeyHandler OpenKey(cm::string_view rootKey, cm::string_view subKey,
120 View view);
121 static KeyHandler OpenKey(cm::string_view key, View view);
122
123 std::string ReadValue(
124 cm::string_view name,
125 ValueTypeSet supportedTypes = cmWindowsRegistry::AllTypes,
126 cm::string_view separator = "\0"_s);
127
128 std::vector<std::string> GetValueNames();
129 std::vector<std::string> GetSubKeys();
130
131private:
132 static std::string FormatSystemError(LSTATUS status);
133 static std::wstring ToWide(cm::string_view str);
134 static std::string ToNarrow(wchar_t const* str, int size = -1);
135
136 HKEY Handler;
137};
138
139KeyHandler KeyHandler::OpenKey(cm::string_view rootKey, cm::string_view subKey,
140 View view)

Callers 1

OpenKeyMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…