Annotation of truecrypt/platform/stringconverter.h, revision 1.1.1.3

1.1       root        1: /*
                      2:  Copyright (c) 2008 TrueCrypt Foundation. All rights reserved.
                      3: 
1.1.1.3 ! root        4:  Governed by the TrueCrypt License 2.5 the full text of which is contained
1.1       root        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);
1.1.1.3 ! root       30:                static string ToLower (const string &str);
1.1       root       31:                static uint32 ToUInt32 (const string &str);
                     32:                static uint32 ToUInt32 (const wstring &str);
                     33:                static uint64 ToUInt64 (const string &str);
                     34:                static uint64 ToUInt64 (const wstring &str);
1.1.1.3 ! root       35:                static string ToSingle (double number) { return ToSingle (FromNumber (number)); }
        !            36:                static string ToSingle (int32 number) { return ToSingle (FromNumber (number)); }
        !            37:                static string ToSingle (uint32 number) { return ToSingle (FromNumber (number)); }
        !            38:                static string ToSingle (int64 number) { return ToSingle (FromNumber (number)); }
        !            39:                static string ToSingle (uint64 number) { return ToSingle (FromNumber (number)); }
1.1       root       40:                static string ToSingle (const wstring &str, bool noThrow = false);
1.1.1.3 ! root       41:                static string ToUpper (const string &str);
        !            42:                static wstring ToWide (double number) { return FromNumber (number); }
        !            43:                static wstring ToWide (int32 number) { return FromNumber (number); }
        !            44:                static wstring ToWide (uint32 number) { return FromNumber (number); }
        !            45:                static wstring ToWide (int64 number) { return FromNumber (number); }
        !            46:                static wstring ToWide (uint64 number) { return FromNumber (number); }
1.1       root       47:                static wstring ToWide (const string &str, bool noThrow = false);
                     48:                static void ToWideBuffer (const wstring &str, wchar_t *buffer, size_t bufferSize);
                     49:                static string Trim (const string &str);
                     50: 
                     51:        private:
                     52:                StringConverter ();
                     53:        };
                     54: }
                     55: 
                     56: #endif // TC_HEADER_Platform_StringConverter

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.