MCPcopy Create free account
hub / github.com/NtQuery/Scylla / readNumericFromConfigFile

Method readNumericFromConfigFile

Scylla/ConfigurationHolder.cpp:108–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108bool ConfigurationHolder::readNumericFromConfigFile(Configuration & configObject, int nBase)
109{
110 WCHAR buf[21]; // UINT64_MAX in dec has 20 digits
111 DWORD read = GetPrivateProfileString(CONFIG_FILE_SECTION_NAME, configObject.getName(), L"", buf, _countof(buf), configPath);
112
113 if (read > 0 && wcslen(buf) > 0)
114 {
115#ifdef _WIN64
116 configObject.setNumeric(_wcstoui64(buf, NULL, nBase));
117#else
118 configObject.setNumeric(wcstoul(buf, NULL, nBase));
119#endif
120 return true;
121 }
122
123 return false;
124}
125
126bool ConfigurationHolder::saveStringToConfigFile(const Configuration & configObject) const
127{

Callers

nothing calls this directly

Calls 2

getNameMethod · 0.80
setNumericMethod · 0.80

Tested by

no test coverage detected