DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Loading...
Searching...
No Matches
DotNetDupe::System::Convert Class Reference

Converts a base data type to another base data type. More...

#include <Convert.h>

Inheritance diagram for DotNetDupe::System::Convert:

Static Public Member Functions

static Array< char > FromBase64String (const char *s)
static Array< char > FromBase64String (const String &s)
static String ToBase64String (const Array< char > &inArray)
static bool ToBoolean (bool value)
static bool ToBoolean (const char *value)
static bool ToBoolean (const String &value)
static bool ToBoolean (double value)
static bool ToBoolean (int value)
static bool ToBoolean (long long value)
static unsigned char ToByte (bool value)
static unsigned char ToByte (const char *value)
static unsigned char ToByte (const char *value, int fromBase)
static unsigned char ToByte (const String &value)
static unsigned char ToByte (const String &value, int fromBase)
static unsigned char ToByte (double value)
static unsigned char ToByte (int value)
static unsigned char ToByte (long long value)
static unsigned char ToByte (short value)
static unsigned char ToByte (signed char value)
static unsigned char ToByte (unsigned char value)
static char ToChar (const char *value)
static char ToChar (const String &value)
static char ToChar (int value)
static char ToChar (long long value)
static char ToChar (unsigned short value)
static double ToDouble (const char *value)
static double ToDouble (const String &value)
static double ToDouble (float value)
static double ToDouble (int value)
static double ToDouble (long long value)
static short ToInt16 (bool value)
static short ToInt16 (const char *value)
static short ToInt16 (const char *value, int fromBase)
static short ToInt16 (const String &value)
static short ToInt16 (const String &value, int fromBase)
static short ToInt16 (double value)
static short ToInt16 (int value)
static short ToInt16 (long long value)
static short ToInt16 (short value)
static int ToInt32 (bool value)
static int ToInt32 (const char *value)
static int ToInt32 (const char *value, int fromBase)
static int ToInt32 (const String &value)
static int ToInt32 (const String &value, int fromBase)
static int ToInt32 (double value)
static int ToInt32 (int value)
static int ToInt32 (long long value)
static long long ToInt64 (bool value)
static long long ToInt64 (const char *value)
static long long ToInt64 (const char *value, int fromBase)
static long long ToInt64 (const String &value)
static long long ToInt64 (const String &value, int fromBase)
static long long ToInt64 (double value)
static long long ToInt64 (int value)
static long long ToInt64 (long long value)
static signed char ToSByte (bool value)
static signed char ToSByte (const char *value)
static signed char ToSByte (const String &value)
static signed char ToSByte (double value)
static signed char ToSByte (int value)
static signed char ToSByte (long long value)
static signed char ToSByte (short value)
static signed char ToSByte (signed char value)
static signed char ToSByte (unsigned char value)
static float ToSingle (const char *value)
static float ToSingle (const String &value)
static float ToSingle (double value)
static float ToSingle (int value)
static float ToSingle (long long value)
static String ToString (bool value)
static String ToString (char value)
static String ToString (double value)
static String ToString (float value)
static String ToString (int value)
static String ToString (int value, int toBase)
static String ToString (long long value)
static String ToString (long long value, int toBase)
static String ToString (short value)
static String ToString (signed char value)
static String ToString (unsigned char value)
static String ToString (unsigned int value)
static String ToString (unsigned long long value)
static String ToString (unsigned short value)
static unsigned short ToUInt16 (bool value)
static unsigned short ToUInt16 (const char *value)
static unsigned short ToUInt16 (const String &value)
static unsigned short ToUInt16 (double value)
static unsigned short ToUInt16 (int value)
static unsigned short ToUInt16 (long long value)
static unsigned int ToUInt32 (bool value)
static unsigned int ToUInt32 (const char *value)
static unsigned int ToUInt32 (const String &value)
static unsigned int ToUInt32 (double value)
static unsigned int ToUInt32 (int value)
static unsigned int ToUInt32 (long long value)
static unsigned long long ToUInt64 (bool value)
static unsigned long long ToUInt64 (const char *value)
static unsigned long long ToUInt64 (const String &value)
static unsigned long long ToUInt64 (double value)
static unsigned long long ToUInt64 (int value)
static unsigned long long ToUInt64 (long long value)
Static Public Member Functions inherited from DotNetDupe::System::Object
static bool Equals (const Object &obj1, const Object &obj2)
 Static helper determining whether two object instances are equal.

Additional Inherited Members

Public Member Functions inherited from DotNetDupe::System::Object
virtual ~Object ()=default
 Virtual destructor ensuring polymorphic cleanup.
virtual bool Equals (const Object &obj) const
 Determines whether the specified Object is equal to the current Object.
virtual int GetHashCode () const
 Serves as the default hash function.
bool operator== (const Object &obj) const
 Determines reference equality between two objects.
char * ToStringA () const
 Returns narrow-character string representation.
wchar_t * ToStringW () const
 Returns wide-character string representation.

Detailed Description

Converts a base data type to another base data type.

Provides static conversion methods between primitives (bool, byte, int, long, double, string), arbitrary number base radix conversions (binary, octal, decimal, hexadecimal), and RFC 4648 Base64 encoding. Thread-safe for all concurrent operations.

Note
Conforms to ECMA-335 Partition IV Section 5.11 (System.Convert) and RFC 4648 (The Base16, Base32, and Base64 Data Encodings).
See also
BitConverter, String

Definition at line 21 of file Convert.h.

Member Function Documentation

◆ FromBase64String() [1/2]

Array< char > DotNetDupe::System::Convert::FromBase64String ( const char * s)
static

Definition at line 388 of file Convert.cpp.

References DotNetDupe::System::String::String(), and FromBase64String().

◆ FromBase64String() [2/2]

Array< char > DotNetDupe::System::Convert::FromBase64String ( const String & s)
static

◆ ToBase64String()

◆ ToBoolean() [1/6]

bool DotNetDupe::System::Convert::ToBoolean ( bool value)
static

Definition at line 26 of file Convert.cpp.

Referenced by ToBoolean().

◆ ToBoolean() [2/6]

bool DotNetDupe::System::Convert::ToBoolean ( const char * value)
static

Definition at line 30 of file Convert.cpp.

References DotNetDupe::System::String::String(), and ToBoolean().

◆ ToBoolean() [3/6]

bool DotNetDupe::System::Convert::ToBoolean ( const String & value)
static

◆ ToBoolean() [4/6]

bool DotNetDupe::System::Convert::ToBoolean ( double value)
static

Definition at line 29 of file Convert.cpp.

◆ ToBoolean() [5/6]

bool DotNetDupe::System::Convert::ToBoolean ( int value)
static

Definition at line 27 of file Convert.cpp.

◆ ToBoolean() [6/6]

bool DotNetDupe::System::Convert::ToBoolean ( long long value)
static

Definition at line 28 of file Convert.cpp.

◆ ToByte() [1/11]

unsigned char DotNetDupe::System::Convert::ToByte ( bool value)
static

Definition at line 40 of file Convert.cpp.

Referenced by ToByte(), ToByte(), and ToByte().

◆ ToByte() [2/11]

unsigned char DotNetDupe::System::Convert::ToByte ( const char * value)
static

Definition at line 42 of file Convert.cpp.

References DotNetDupe::System::String::String(), and ToByte().

◆ ToByte() [3/11]

unsigned char DotNetDupe::System::Convert::ToByte ( const char * value,
int fromBase )
static

Definition at line 43 of file Convert.cpp.

References DotNetDupe::System::String::String(), and ToByte().

◆ ToByte() [4/11]

unsigned char DotNetDupe::System::Convert::ToByte ( const String & value)
static

Definition at line 49 of file Convert.cpp.

References ToByte().

◆ ToByte() [5/11]

unsigned char DotNetDupe::System::Convert::ToByte ( const String & value,
int fromBase )
static

◆ ToByte() [6/11]

unsigned char DotNetDupe::System::Convert::ToByte ( double value)
static

Definition at line 48 of file Convert.cpp.

References DotNetDupe::System::CheckRange().

◆ ToByte() [7/11]

unsigned char DotNetDupe::System::Convert::ToByte ( int value)
static

Definition at line 46 of file Convert.cpp.

References DotNetDupe::System::CheckRange().

◆ ToByte() [8/11]

unsigned char DotNetDupe::System::Convert::ToByte ( long long value)
static

Definition at line 47 of file Convert.cpp.

References DotNetDupe::System::CheckRange().

◆ ToByte() [9/11]

unsigned char DotNetDupe::System::Convert::ToByte ( short value)
static

Definition at line 45 of file Convert.cpp.

References DotNetDupe::System::CheckRange().

◆ ToByte() [10/11]

unsigned char DotNetDupe::System::Convert::ToByte ( signed char value)
static

Definition at line 44 of file Convert.cpp.

References DotNetDupe::System::CheckRange().

◆ ToByte() [11/11]

unsigned char DotNetDupe::System::Convert::ToByte ( unsigned char value)
static

Definition at line 41 of file Convert.cpp.

◆ ToChar() [1/5]

char DotNetDupe::System::Convert::ToChar ( const char * value)
static

Definition at line 89 of file Convert.cpp.

References DotNetDupe::System::String::String(), and ToChar().

◆ ToChar() [2/5]

char DotNetDupe::System::Convert::ToChar ( const String & value)
static

◆ ToChar() [3/5]

char DotNetDupe::System::Convert::ToChar ( int value)
static

Definition at line 87 of file Convert.cpp.

References DotNetDupe::System::CheckRange().

◆ ToChar() [4/5]

char DotNetDupe::System::Convert::ToChar ( long long value)
static

Definition at line 88 of file Convert.cpp.

References DotNetDupe::System::CheckRange().

◆ ToChar() [5/5]

char DotNetDupe::System::Convert::ToChar ( unsigned short value)
static

Definition at line 86 of file Convert.cpp.

Referenced by ToChar().

◆ ToDouble() [1/5]

double DotNetDupe::System::Convert::ToDouble ( const char * value)
static

Definition at line 99 of file Convert.cpp.

References DotNetDupe::System::String::String(), and ToDouble().

◆ ToDouble() [2/5]

double DotNetDupe::System::Convert::ToDouble ( const String & value)
static

◆ ToDouble() [3/5]

double DotNetDupe::System::Convert::ToDouble ( float value)
static

Definition at line 98 of file Convert.cpp.

◆ ToDouble() [4/5]

double DotNetDupe::System::Convert::ToDouble ( int value)
static

Definition at line 96 of file Convert.cpp.

Referenced by ToDouble().

◆ ToDouble() [5/5]

double DotNetDupe::System::Convert::ToDouble ( long long value)
static

Definition at line 97 of file Convert.cpp.

◆ ToInt16() [1/9]

short DotNetDupe::System::Convert::ToInt16 ( bool value)
static

Definition at line 132 of file Convert.cpp.

Referenced by ToInt16(), ToInt16(), and ToInt16().

◆ ToInt16() [2/9]

short DotNetDupe::System::Convert::ToInt16 ( const char * value)
static

Definition at line 137 of file Convert.cpp.

References DotNetDupe::System::String::String(), and ToInt16().

◆ ToInt16() [3/9]

short DotNetDupe::System::Convert::ToInt16 ( const char * value,
int fromBase )
static

Definition at line 138 of file Convert.cpp.

References DotNetDupe::System::String::String(), and ToInt16().

◆ ToInt16() [4/9]

short DotNetDupe::System::Convert::ToInt16 ( const String & value)
static

Definition at line 139 of file Convert.cpp.

References ToInt16().

◆ ToInt16() [5/9]

short DotNetDupe::System::Convert::ToInt16 ( const String & value,
int fromBase )
static

◆ ToInt16() [6/9]

short DotNetDupe::System::Convert::ToInt16 ( double value)
static

Definition at line 136 of file Convert.cpp.

References DotNetDupe::System::CheckRange().

◆ ToInt16() [7/9]

short DotNetDupe::System::Convert::ToInt16 ( int value)
static

Definition at line 134 of file Convert.cpp.

References DotNetDupe::System::CheckRange().

◆ ToInt16() [8/9]

short DotNetDupe::System::Convert::ToInt16 ( long long value)
static

Definition at line 135 of file Convert.cpp.

References DotNetDupe::System::CheckRange().

◆ ToInt16() [9/9]

short DotNetDupe::System::Convert::ToInt16 ( short value)
static

Definition at line 133 of file Convert.cpp.

◆ ToInt32() [1/8]

◆ ToInt32() [2/8]

int DotNetDupe::System::Convert::ToInt32 ( const char * value)
static

Definition at line 158 of file Convert.cpp.

References DotNetDupe::System::String::String(), and ToInt32().

◆ ToInt32() [3/8]

int DotNetDupe::System::Convert::ToInt32 ( const char * value,
int fromBase )
static

Definition at line 159 of file Convert.cpp.

References DotNetDupe::System::String::String(), and ToInt32().

◆ ToInt32() [4/8]

int DotNetDupe::System::Convert::ToInt32 ( const String & value)
static

Definition at line 160 of file Convert.cpp.

References ToInt32().

◆ ToInt32() [5/8]

int DotNetDupe::System::Convert::ToInt32 ( const String & value,
int fromBase )
static

◆ ToInt32() [6/8]

int DotNetDupe::System::Convert::ToInt32 ( double value)
static

Definition at line 157 of file Convert.cpp.

References DotNetDupe::System::CheckRange().

◆ ToInt32() [7/8]

int DotNetDupe::System::Convert::ToInt32 ( int value)
static

Definition at line 155 of file Convert.cpp.

◆ ToInt32() [8/8]

int DotNetDupe::System::Convert::ToInt32 ( long long value)
static

Definition at line 156 of file Convert.cpp.

References DotNetDupe::System::CheckRange().

◆ ToInt64() [1/8]

long long DotNetDupe::System::Convert::ToInt64 ( bool value)
static

Definition at line 175 of file Convert.cpp.

Referenced by ToInt64(), ToInt64(), and ToInt64().

◆ ToInt64() [2/8]

long long DotNetDupe::System::Convert::ToInt64 ( const char * value)
static

Definition at line 179 of file Convert.cpp.

References DotNetDupe::System::String::String(), and ToInt64().

◆ ToInt64() [3/8]

long long DotNetDupe::System::Convert::ToInt64 ( const char * value,
int fromBase )
static

Definition at line 180 of file Convert.cpp.

References DotNetDupe::System::String::String(), and ToInt64().

◆ ToInt64() [4/8]

long long DotNetDupe::System::Convert::ToInt64 ( const String & value)
static

Definition at line 181 of file Convert.cpp.

References ToInt64().

◆ ToInt64() [5/8]

long long DotNetDupe::System::Convert::ToInt64 ( const String & value,
int fromBase )
static

◆ ToInt64() [6/8]

long long DotNetDupe::System::Convert::ToInt64 ( double value)
static

Definition at line 178 of file Convert.cpp.

◆ ToInt64() [7/8]

long long DotNetDupe::System::Convert::ToInt64 ( int value)
static

Definition at line 176 of file Convert.cpp.

◆ ToInt64() [8/8]

long long DotNetDupe::System::Convert::ToInt64 ( long long value)
static

Definition at line 177 of file Convert.cpp.

◆ ToSByte() [1/9]

signed char DotNetDupe::System::Convert::ToSByte ( bool value)
static

Definition at line 64 of file Convert.cpp.

Referenced by ToSByte().

◆ ToSByte() [2/9]

signed char DotNetDupe::System::Convert::ToSByte ( const char * value)
static

Definition at line 66 of file Convert.cpp.

References DotNetDupe::System::String::String(), and ToSByte().

◆ ToSByte() [3/9]

signed char DotNetDupe::System::Convert::ToSByte ( const String & value)
static

◆ ToSByte() [4/9]

signed char DotNetDupe::System::Convert::ToSByte ( double value)
static

Definition at line 71 of file Convert.cpp.

References DotNetDupe::System::CheckRange().

◆ ToSByte() [5/9]

signed char DotNetDupe::System::Convert::ToSByte ( int value)
static

Definition at line 69 of file Convert.cpp.

References DotNetDupe::System::CheckRange().

◆ ToSByte() [6/9]

signed char DotNetDupe::System::Convert::ToSByte ( long long value)
static

Definition at line 70 of file Convert.cpp.

References DotNetDupe::System::CheckRange().

◆ ToSByte() [7/9]

signed char DotNetDupe::System::Convert::ToSByte ( short value)
static

Definition at line 68 of file Convert.cpp.

References DotNetDupe::System::CheckRange().

◆ ToSByte() [8/9]

signed char DotNetDupe::System::Convert::ToSByte ( signed char value)
static

Definition at line 67 of file Convert.cpp.

◆ ToSByte() [9/9]

signed char DotNetDupe::System::Convert::ToSByte ( unsigned char value)
static

Definition at line 65 of file Convert.cpp.

References DotNetDupe::System::CheckRange().

◆ ToSingle() [1/5]

float DotNetDupe::System::Convert::ToSingle ( const char * value)
static

Definition at line 117 of file Convert.cpp.

References DotNetDupe::System::String::String(), and ToSingle().

◆ ToSingle() [2/5]

float DotNetDupe::System::Convert::ToSingle ( const String & value)
static

◆ ToSingle() [3/5]

float DotNetDupe::System::Convert::ToSingle ( double value)
static

Definition at line 116 of file Convert.cpp.

◆ ToSingle() [4/5]

float DotNetDupe::System::Convert::ToSingle ( int value)
static

Definition at line 114 of file Convert.cpp.

Referenced by ToSingle().

◆ ToSingle() [5/5]

float DotNetDupe::System::Convert::ToSingle ( long long value)
static

Definition at line 115 of file Convert.cpp.

◆ ToString() [1/14]

◆ ToString() [2/14]

String DotNetDupe::System::Convert::ToString ( char value)
static

Definition at line 256 of file Convert.cpp.

References DotNetDupe::System::String::String().

◆ ToString() [3/14]

String DotNetDupe::System::Convert::ToString ( double value)
static

Definition at line 257 of file Convert.cpp.

References DotNetDupe::System::String::String().

◆ ToString() [4/14]

String DotNetDupe::System::Convert::ToString ( float value)
static

Definition at line 262 of file Convert.cpp.

References DotNetDupe::System::String::String().

◆ ToString() [5/14]

String DotNetDupe::System::Convert::ToString ( int value)
static

Definition at line 268 of file Convert.cpp.

References DotNetDupe::System::String::String().

◆ ToString() [6/14]

String DotNetDupe::System::Convert::ToString ( int value,
int toBase )
static

Definition at line 290 of file Convert.cpp.

References DotNetDupe::System::ToBaseString().

◆ ToString() [7/14]

String DotNetDupe::System::Convert::ToString ( long long value)
static

Definition at line 269 of file Convert.cpp.

References DotNetDupe::System::String::String().

◆ ToString() [8/14]

String DotNetDupe::System::Convert::ToString ( long long value,
int toBase )
static

Definition at line 293 of file Convert.cpp.

References DotNetDupe::System::ToBaseString().

◆ ToString() [9/14]

String DotNetDupe::System::Convert::ToString ( short value)
static

Definition at line 267 of file Convert.cpp.

References DotNetDupe::System::String::String().

◆ ToString() [10/14]

String DotNetDupe::System::Convert::ToString ( signed char value)
static

Definition at line 255 of file Convert.cpp.

References DotNetDupe::System::String::String().

◆ ToString() [11/14]

String DotNetDupe::System::Convert::ToString ( unsigned char value)
static

Definition at line 254 of file Convert.cpp.

References DotNetDupe::System::String::String().

◆ ToString() [12/14]

String DotNetDupe::System::Convert::ToString ( unsigned int value)
static

Definition at line 271 of file Convert.cpp.

References DotNetDupe::System::String::String().

◆ ToString() [13/14]

String DotNetDupe::System::Convert::ToString ( unsigned long long value)
static

Definition at line 272 of file Convert.cpp.

References DotNetDupe::System::String::String().

◆ ToString() [14/14]

String DotNetDupe::System::Convert::ToString ( unsigned short value)
static

Definition at line 270 of file Convert.cpp.

References DotNetDupe::System::String::String().

◆ ToUInt16() [1/6]

unsigned short DotNetDupe::System::Convert::ToUInt16 ( bool value)
static

Definition at line 196 of file Convert.cpp.

Referenced by ToUInt16().

◆ ToUInt16() [2/6]

unsigned short DotNetDupe::System::Convert::ToUInt16 ( const char * value)
static

Definition at line 200 of file Convert.cpp.

References DotNetDupe::System::String::String(), and ToUInt16().

◆ ToUInt16() [3/6]

unsigned short DotNetDupe::System::Convert::ToUInt16 ( const String & value)
static

◆ ToUInt16() [4/6]

unsigned short DotNetDupe::System::Convert::ToUInt16 ( double value)
static

Definition at line 199 of file Convert.cpp.

References DotNetDupe::System::CheckRange().

◆ ToUInt16() [5/6]

unsigned short DotNetDupe::System::Convert::ToUInt16 ( int value)
static

Definition at line 197 of file Convert.cpp.

References DotNetDupe::System::CheckRange().

◆ ToUInt16() [6/6]

unsigned short DotNetDupe::System::Convert::ToUInt16 ( long long value)
static

Definition at line 198 of file Convert.cpp.

References DotNetDupe::System::CheckRange().

◆ ToUInt32() [1/6]

unsigned int DotNetDupe::System::Convert::ToUInt32 ( bool value)
static

Definition at line 215 of file Convert.cpp.

Referenced by ToUInt32().

◆ ToUInt32() [2/6]

unsigned int DotNetDupe::System::Convert::ToUInt32 ( const char * value)
static

Definition at line 219 of file Convert.cpp.

References DotNetDupe::System::String::String(), and ToUInt32().

◆ ToUInt32() [3/6]

unsigned int DotNetDupe::System::Convert::ToUInt32 ( const String & value)
static

◆ ToUInt32() [4/6]

unsigned int DotNetDupe::System::Convert::ToUInt32 ( double value)
static

Definition at line 218 of file Convert.cpp.

References DotNetDupe::System::CheckRange().

◆ ToUInt32() [5/6]

unsigned int DotNetDupe::System::Convert::ToUInt32 ( int value)
static

Definition at line 216 of file Convert.cpp.

References DotNetDupe::System::CheckRange().

◆ ToUInt32() [6/6]

unsigned int DotNetDupe::System::Convert::ToUInt32 ( long long value)
static

Definition at line 217 of file Convert.cpp.

References DotNetDupe::System::CheckRange().

◆ ToUInt64() [1/6]

unsigned long long DotNetDupe::System::Convert::ToUInt64 ( bool value)
static

Definition at line 234 of file Convert.cpp.

Referenced by ToUInt64().

◆ ToUInt64() [2/6]

unsigned long long DotNetDupe::System::Convert::ToUInt64 ( const char * value)
static

Definition at line 238 of file Convert.cpp.

References DotNetDupe::System::String::String(), and ToUInt64().

◆ ToUInt64() [3/6]

unsigned long long DotNetDupe::System::Convert::ToUInt64 ( const String & value)
static

◆ ToUInt64() [4/6]

unsigned long long DotNetDupe::System::Convert::ToUInt64 ( double value)
static

Definition at line 237 of file Convert.cpp.

◆ ToUInt64() [5/6]

unsigned long long DotNetDupe::System::Convert::ToUInt64 ( int value)
static

Definition at line 235 of file Convert.cpp.

References DotNetDupe::System::CheckRange().

◆ ToUInt64() [6/6]

unsigned long long DotNetDupe::System::Convert::ToUInt64 ( long long value)
static

Definition at line 236 of file Convert.cpp.

References DotNetDupe::System::CheckRange().


The documentation for this class was generated from the following files: