"Fossies" - the Fresh Open Source Software Archive

Member "src/Platform/StringConverter.h" (10 Oct 2018, 3049 Bytes) of package /windows/misc/VeraCrypt_1.23-Hotfix-2_Source.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "StringConverter.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  Derived from source code of TrueCrypt 7.1a, which is
    3  Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
    4  by the TrueCrypt License 3.0.
    5 
    6  Modifications and additions to the original source code (contained in this file)
    7  and all other portions of this file are Copyright (c) 2013-2017 IDRIX
    8  and are governed by the Apache License 2.0 the full text of which is
    9  contained in the file License.txt included in VeraCrypt binary and source
   10  code distribution packages.
   11 */
   12 
   13 #ifndef TC_HEADER_Platform_StringConverter
   14 #define TC_HEADER_Platform_StringConverter
   15 
   16 #include <stdlib.h>
   17 #include "PlatformBase.h"
   18 
   19 namespace VeraCrypt
   20 {
   21     class StringConverter
   22     {
   23     public:
   24         static void Erase (string &str);
   25         static void Erase (wstring &str);
   26         static wstring FromNumber (double number);
   27         static wstring FromNumber (int32 number);
   28         static wstring FromNumber (uint32 number);
   29         static wstring FromNumber (int64 number);
   30         static wstring FromNumber (uint64 number);
   31         static string GetTrailingNumber (const string &str);
   32         static string GetTypeName (const type_info &typeInfo);
   33         static wstring QuoteSpaces (const wstring &str);
   34         static vector <string> Split (const string &str, const string &separators = " \t\r\n", bool returnEmptyFields = false);
   35         static string StripTrailingNumber (const string &str);
   36         static wstring ToExceptionString (const exception &ex);
   37         static string ToLower (const string &str);
   38         static uint32 ToUInt32 (const string &str);
   39         static uint32 ToUInt32 (const wstring &str);
   40         static int32  ToInt32 (const string &str);
   41         static int32  ToInt32 (const wstring &str);
   42         static uint64 ToUInt64 (const string &str);
   43         static uint64 ToUInt64 (const wstring &str);
   44         static int64  ToInt64 (const string &str);
   45         static int64  ToInt64 (const wstring &str);
   46         static string ToSingle (double number) { return ToSingle (FromNumber (number)); }
   47         static string ToSingle (int32 number) { return ToSingle (FromNumber (number)); }
   48         static string ToSingle (uint32 number) { return ToSingle (FromNumber (number)); }
   49         static string ToSingle (int64 number) { return ToSingle (FromNumber (number)); }
   50         static string ToSingle (uint64 number) { return ToSingle (FromNumber (number)); }
   51         static string ToSingle (const wstring &wstr, bool noThrow = false);
   52         static void ToSingle (const wstring &wstr, string &str, bool noThrow = false);
   53         static string ToUpper (const string &str);
   54         static wstring ToWide (double number) { return FromNumber (number); }
   55         static wstring ToWide (int32 number) { return FromNumber (number); }
   56         static wstring ToWide (uint32 number) { return FromNumber (number); }
   57         static wstring ToWide (int64 number) { return FromNumber (number); }
   58         static wstring ToWide (uint64 number) { return FromNumber (number); }
   59         static wstring ToWide (const string &str, bool noThrow = false);
   60         static void ToWideBuffer (const wstring &str, wchar_t *buffer, size_t bufferSize);
   61         static string Trim (const string &str);
   62 
   63     private:
   64         StringConverter ();
   65     };
   66 }
   67 
   68 #endif // TC_HEADER_Platform_StringConverter