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

Function ToValueType

Source/cmWindowsRegistry.cxx:71–88  ·  view source on GitHub ↗

Helper to translate Windows registry value type to enum ValueType

Source from the content-addressed store, hash-verified

69
70// Helper to translate Windows registry value type to enum ValueType
71cm::optional<cmWindowsRegistry::ValueType> ToValueType(DWORD type)
72{
73 using ValueType = cmWindowsRegistry::ValueType;
74
75 static std::unordered_map<DWORD, ValueType> ValueTypes{
76 { REG_SZ, ValueType::Reg_SZ },
77 { REG_EXPAND_SZ, ValueType::Reg_EXPAND_SZ },
78 { REG_MULTI_SZ, ValueType::Reg_MULTI_SZ },
79 { REG_DWORD, ValueType::Reg_DWORD },
80 { REG_QWORD, ValueType::Reg_QWORD }
81 };
82
83 auto it = ValueTypes.find(type);
84
85 return it == ValueTypes.end()
86 ? cm::nullopt
87 : cm::optional<cmWindowsRegistry::ValueType>{ it->second };
88}
89
90// class registry_exception
91class registry_error : public std::exception

Callers 1

ReadValueMethod · 0.85

Calls 2

findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…