Add 64-bit numbers support to wxRegKey

This uses the native registry support for 64-bit values available since
Windows XP.

Note that SetValue64() can't be just called SetValue() as this would
introduce ambiguities when writing an int or an enum to the registry.
This could be avoided by providing overloads for all the arithmetic
types, but it's arguably better to be more clear about what exactly is
being written to the registry in this low-level class and using a
different name is definitely simpler.
This commit is contained in:
Vadim Zeitlin
2021-03-09 21:09:42 +01:00
parent eb33447c39
commit 3f2c84d4a9
3 changed files with 76 additions and 3 deletions

View File

@@ -350,6 +350,14 @@ public:
*/
bool QueryValue(const wxString& szValue, long* plValue) const;
/**
Retrieves the 64-bit value. Returns @true if successful.
An empty @a szValue queries the default/unnamed key value.
@since 3.1.5
*/
bool QueryValue64(const wxString& szValue, wxLongLong_t* plValue) const;
/**
Retrieves the binary structure. Returns @true if successful.
An empty @a szValue queries the default/unnamed key value.
@@ -397,6 +405,17 @@ public:
An empty @a szValue sets the default/unnamed key value.
*/
bool SetValue(const wxString& szValue, long lValue);
/**
Sets a 64-bit value.
This function creates or modifies a field of @c QWORD type in the
registry.
@since 3.1.5
*/
bool SetValue64(const wxString& szValue, wxLongLong_t lValue);
/**
Sets the given @a szValue which must be string. If the value doesn't
exist, it is created. Returns @true if successful.