Class KeyHandler
| 105 | |
| 106 | // Class KeyHandler |
| 107 | class KeyHandler |
| 108 | { |
| 109 | public: |
| 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 | |
| 131 | private: |
| 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 | |
| 139 | KeyHandler KeyHandler::OpenKey(cm::string_view rootKey, cm::string_view subKey, |
| 140 | View view) |
no outgoing calls
no test coverage detected
searching dependent graphs…