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

@@ -44,6 +44,12 @@ TEST_CASE("wxRegConfig::ReadWrite", "[regconfig][config][registry]")
CHECK( config->Write("int32", 1234567) );
// Note that type of wxLL(0x8000000000000008) literal is somehow unsigned
// long long with MinGW, not sure if it's a bug or not, but work around it
// by specifying the type explicitly.
const wxLongLong_t val64 = wxLL(0x8000000000000008);
CHECK( config->Write("int64", val64) );
// test reading
wxString str;
long dummy;
@@ -57,6 +63,7 @@ TEST_CASE("wxRegConfig::ReadWrite", "[regconfig][config][registry]")
CHECK( config->Read("group2/entry1", "INVALID DEFAULT") == "bar" );
CHECK( config->ReadLong("group2/int32", 0) == 1234567 );
CHECK( config->ReadLongLong("group2/int64", 0) == val64 );
config->DeleteAll();
}