| 51 | } |
| 52 | |
| 53 | std::string getStringFromWinReg(std::string const& name, std::string const& defaultValue) |
| 54 | { |
| 55 | try { |
| 56 | auto key = getOrCreateAlienRegKey(); |
| 57 | auto regResult = key.TryGetStringValue(ConvertUtf8ToWide(name)); |
| 58 | if (regResult.IsValid()) { |
| 59 | return ConvertWideToUtf8(regResult.GetValue()); |
| 60 | } else { |
| 61 | return defaultValue; |
| 62 | } |
| 63 | |
| 64 | } catch (std::exception const& exception) { |
| 65 | log(Priority::Important, exception.what()); |
| 66 | return defaultValue; |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | void setStringToWinReg(std::string const& name, std::string const& value) |
| 71 | { |
no test coverage detected