Add conversion to signed/unsigned int to wxString

Add wxString::ToInt() and ToUInt() for convenience and consistency with
the existing ToLong() and ToULong().

Closes #22068.
This commit is contained in:
Gerhard Gruber
2022-01-28 11:27:29 +01:00
committed by Vadim Zeitlin
parent c10a70be67
commit 9dc7248b1d
4 changed files with 148 additions and 4 deletions

View File

@@ -2310,9 +2310,14 @@ public:
// provided, the base is the numeric base in which the conversion should be
// done and must be comprised between 2 and 36 or be 0 in which case the
// standard C rules apply (leading '0' => octal, "0x" => hex)
// convert to a signed integer
// convert to a signed integer
bool ToInt(int *val, int base = 10) const;
// convert to an unsigned integer
bool ToUInt(unsigned int *val, int base = 10) const;
// convert to a signed long
bool ToLong(long *val, int base = 10) const;
// convert to an unsigned integer
// convert to an unsigned long
bool ToULong(unsigned long *val, int base = 10) const;
// convert to wxLongLong
#if defined(wxLongLong_t)