Add 64-bit integers support to wxConfig

Serialize them to strings in wxFileConfig, just as we always did for
long, but use wxRegKey support for storing them directly to the registry
in wxRegConfig.
This commit is contained in:
Vadim Zeitlin
2021-03-09 21:17:26 +01:00
parent 3f2c84d4a9
commit fce8780297
10 changed files with 164 additions and 3 deletions

View File

@@ -45,6 +45,14 @@ TEST_CASE("wxConfig::ReadWriteLocal", "[config]")
config->Write(wxString("long1"), 234L);
config->Write("double1", 345.67);
config->Write("bool1", true);
// See comment in regconf.cpp.
const wxLongLong_t val64 = wxLL(0x8000000000000008);
config->Write("ll", val64);
const wxULongLong_t uval64 = wxULL(0x9000000000000009);
config->Write("ull", uval64);
#ifdef wxHAS_CONFIG_TEMPLATE_RW
config->Write("color1", wxColour(11,22,33,44));
#endif // wxHAS_CONFIG_TEMPLATE_RW
@@ -93,6 +101,15 @@ TEST_CASE("wxConfig::ReadWriteLocal", "[config]")
CHECK( config->ReadBool("bool1", false) == bool1 );
wxLongLong_t ll;
CHECK( config->Read("ll", &ll) );
CHECK( ll == val64 );
CHECK( config->ReadLongLong("ll", 0) == val64 );
CHECK( config->Read("ull", &ll) );
CHECK( ll == static_cast<wxLongLong_t>(uval64) );
CHECK( config->ReadLongLong("ull", 0) == static_cast<wxLongLong_t>(uval64) );
#ifdef wxHAS_CONFIG_TEMPLATE_RW
wxColour color1;
r = config->Read("color1", &color1);