2 Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
4 Governed by the TrueCrypt License 3.0 the full text of which is contained in
5 the file License.txt included in TrueCrypt binary and source code distribution
9 #ifndef TC_HEADER_Platform_StringConverter
10 #define TC_HEADER_Platform_StringConverter
13 #include "PlatformBase.h"
20 static void Erase (string &str);
21 static void Erase (wstring &str);
22 static wstring FromNumber (double number);
23 static wstring FromNumber (int32 number);
24 static wstring FromNumber (uint32 number);
25 static wstring FromNumber (int64 number);
26 static wstring FromNumber (uint64 number);
27 static string GetTrailingNumber (const string &str);
28 static string GetTypeName (const type_info &typeInfo);
29 static wstring QuoteSpaces (const wstring &str);
30 static vector <string> Split (const string &str, const string &separators = " \t\r\n", bool returnEmptyFields = false);
31 static string StripTrailingNumber (const string &str);
32 static wstring ToExceptionString (const exception &ex);
33 static string ToLower (const string &str);
34 static uint32 ToUInt32 (const string &str);
35 static uint32 ToUInt32 (const wstring &str);
36 static uint64 ToUInt64 (const string &str);
37 static uint64 ToUInt64 (const wstring &str);
38 static string ToSingle (double number) { return ToSingle (FromNumber (number)); }
39 static string ToSingle (int32 number) { return ToSingle (FromNumber (number)); }
40 static string ToSingle (uint32 number) { return ToSingle (FromNumber (number)); }
41 static string ToSingle (int64 number) { return ToSingle (FromNumber (number)); }
42 static string ToSingle (uint64 number) { return ToSingle (FromNumber (number)); }
43 static string ToSingle (const wstring &wstr, bool noThrow = false);
44 static void ToSingle (const wstring &wstr, string &str, bool noThrow = false);
45 static string ToUpper (const string &str);
46 static wstring ToWide (double number) { return FromNumber (number); }
47 static wstring ToWide (int32 number) { return FromNumber (number); }
48 static wstring ToWide (uint32 number) { return FromNumber (number); }
49 static wstring ToWide (int64 number) { return FromNumber (number); }
50 static wstring ToWide (uint64 number) { return FromNumber (number); }
51 static wstring ToWide (const string &str, bool noThrow = false);
52 static void ToWideBuffer (const wstring &str, wchar_t *buffer, size_t bufferSize);
53 static string Trim (const string &str);
60 #endif // TC_HEADER_Platform_StringConverter