|
|
1.1 root 1: /*
2: Copyright (c) 2008 TrueCrypt Foundation. All rights reserved.
3:
4: Governed by the TrueCrypt License 2.4 the full text of which is contained
5: in the file License.txt included in TrueCrypt binary and source code
6: distribution packages.
7: */
8:
9: #ifndef TC_HEADER_Platform_StringConverter
10: #define TC_HEADER_Platform_StringConverter
11:
12: #include <stdlib.h>
13: #include "PlatformBase.h"
14:
15: namespace TrueCrypt
16: {
17: class StringConverter
18: {
19: public:
20: static wstring FromNumber (double number);
1.1.1.2 ! root 21: static wstring FromNumber (int32 number);
! 22: static wstring FromNumber (uint32 number);
1.1 root 23: static wstring FromNumber (int64 number);
24: static wstring FromNumber (uint64 number);
25: static string GetTrailingNumber (const string &str);
26: static string GetTypeName (const type_info &typeInfo);
27: static wstring QuoteSpaces (const wstring &str);
28: static vector <string> Split (const string &str, const string &separators = " \t\r\n", bool returnEmptyFields = false);
29: static wstring ToExceptionString (const exception &ex);
30: static uint32 ToUInt32 (const string &str);
31: static uint32 ToUInt32 (const wstring &str);
32: static uint64 ToUInt64 (const string &str);
33: static uint64 ToUInt64 (const wstring &str);
34: static string ToSingle (const wstring &str, bool noThrow = false);
35: static wstring ToWide (const string &str, bool noThrow = false);
36: static void ToWideBuffer (const wstring &str, wchar_t *buffer, size_t bufferSize);
37: static string Trim (const string &str);
38:
39: private:
40: StringConverter ();
41: };
42: }
43:
44: #endif // TC_HEADER_Platform_StringConverter
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.