pikotools/src/convert/text.h

211 lines
7.6 KiB
C
Raw Normal View History

added: functions for dealing with white characters: bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too) CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true) IsDigit(wchar_t c, int base, int * digit) added: functions to converting from a string to an integer: unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) changed: some work in Space (new Api) now Text() methods returns std::wstring by value (before they were returned by reference) added std::wstring & TextRef() methods added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong() GetValue() renamed to GetFirstValue() AText() renamed to TextA() and they return std::string by value now git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
/*
* This file is a part of PikoTools
* and is distributed under the 2-Clause BSD licence.
added: functions for dealing with white characters: bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too) CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true) IsDigit(wchar_t c, int base, int * digit) added: functions to converting from a string to an integer: unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) changed: some work in Space (new Api) now Text() methods returns std::wstring by value (before they were returned by reference) added std::wstring & TextRef() methods added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong() GetValue() renamed to GetFirstValue() AText() renamed to TextA() and they return std::string by value now git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
* Author: Tomasz Sowa <t.sowa@ttmath.org>
*/
/*
* Copyright (c) 2017-2022, Tomasz Sowa
added: functions for dealing with white characters: bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too) CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true) IsDigit(wchar_t c, int base, int * digit) added: functions to converting from a string to an integer: unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) changed: some work in Space (new Api) now Text() methods returns std::wstring by value (before they were returned by reference) added std::wstring & TextRef() methods added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong() GetValue() renamed to GetFirstValue() AText() renamed to TextA() and they return std::string by value now git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
added: functions for dealing with white characters: bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too) CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true) IsDigit(wchar_t c, int base, int * digit) added: functions to converting from a string to an integer: unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) changed: some work in Space (new Api) now Text() methods returns std::wstring by value (before they were returned by reference) added std::wstring & TextRef() methods added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong() GetValue() renamed to GetFirstValue() AText() renamed to TextA() and they return std::string by value now git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
added: functions for dealing with white characters: bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too) CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true) IsDigit(wchar_t c, int base, int * digit) added: functions to converting from a string to an integer: unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) changed: some work in Space (new Api) now Text() methods returns std::wstring by value (before they were returned by reference) added std::wstring & TextRef() methods added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong() GetValue() renamed to GetFirstValue() AText() renamed to TextA() and they return std::string by value now git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
added: functions for dealing with white characters: bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too) CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true) IsDigit(wchar_t c, int base, int * digit) added: functions to converting from a string to an integer: unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) changed: some work in Space (new Api) now Text() methods returns std::wstring by value (before they were returned by reference) added std::wstring & TextRef() methods added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong() GetValue() renamed to GetFirstValue() AText() renamed to TextA() and they return std::string by value now git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
added: functions for dealing with white characters: bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too) CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true) IsDigit(wchar_t c, int base, int * digit) added: functions to converting from a string to an integer: unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) changed: some work in Space (new Api) now Text() methods returns std::wstring by value (before they were returned by reference) added std::wstring & TextRef() methods added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong() GetValue() renamed to GetFirstValue() AText() renamed to TextA() and they return std::string by value now git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
*/
#ifndef headerfile_pikotools_src_convert_text
#define headerfile_pikotools_src_convert_text
added: functions for dealing with white characters: bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too) CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true) IsDigit(wchar_t c, int base, int * digit) added: functions to converting from a string to an integer: unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) changed: some work in Space (new Api) now Text() methods returns std::wstring by value (before they were returned by reference) added std::wstring & TextRef() methods added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong() GetValue() renamed to GetFirstValue() AText() renamed to TextA() and they return std::string by value now git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
#include <string>
added: functions for dealing with white characters: bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too) CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true) IsDigit(wchar_t c, int base, int * digit) added: functions to converting from a string to an integer: unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) changed: some work in Space (new Api) now Text() methods returns std::wstring by value (before they were returned by reference) added std::wstring & TextRef() methods added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong() GetValue() renamed to GetFirstValue() AText() renamed to TextA() and they return std::string by value now git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
2021-05-20 16:11:12 +02:00
namespace pt
added: functions for dealing with white characters: bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too) CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true) IsDigit(wchar_t c, int base, int * digit) added: functions to converting from a string to an integer: unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) changed: some work in Space (new Api) now Text() methods returns std::wstring by value (before they were returned by reference) added std::wstring & TextRef() methods added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong() GetValue() renamed to GetFirstValue() AText() renamed to TextA() and they return std::string by value now git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
{
bool is_white(wchar_t c, bool check_additional_chars = true, bool treat_new_line_as_white = true);
bool is_digit(wchar_t c, int base = 10, int * digit = 0);
// IMPROVEME add tests
template<typename HexStringPointerType, typename BytesStringType>
bool hex_string_pointer_to_bytes(const HexStringPointerType * hex_string, BytesStringType & bytes, bool clear_bytes = true)
{
bool converted_correctly = true;
size_t i = 0;
if( clear_bytes )
bytes.clear();
for( ; converted_correctly && hex_string[i] != 0 && hex_string[i+1] != 0 ; i += 2)
{
int c1, c2;
converted_correctly = converted_correctly && is_digit(hex_string[i], 16, &c1);
converted_correctly = converted_correctly && is_digit(hex_string[i+1], 16, &c2);
if( converted_correctly )
{
bytes += (char)(unsigned char)(((c1 << 4) | c2));
}
}
if( hex_string[i] != 0 )
{
// one digit has left
converted_correctly = false;
}
return converted_correctly;
}
// IMPROVEME add tests
template<typename HexStringType, typename BytesStringType>
bool hex_string_to_bytes(const HexStringType & hex_string, BytesStringType & bytes, bool clear_bytes = true)
{
return hex_string_pointer_to_bytes(hex_string.c_str(), bytes, clear_bytes);
}
const char * skip_white(const char * str, bool check_additional_chars = true, bool treat_new_line_as_white = true);
const wchar_t * skip_white(const wchar_t * str, bool check_additional_chars = true, bool treat_new_line_as_white = true);
added: functions for dealing with white characters: bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too) CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true) IsDigit(wchar_t c, int base, int * digit) added: functions to converting from a string to an integer: unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) changed: some work in Space (new Api) now Text() methods returns std::wstring by value (before they were returned by reference) added std::wstring & TextRef() methods added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong() GetValue() renamed to GetFirstValue() AText() renamed to TextA() and they return std::string by value now git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
/*
*
* str_end is pointing at the end of the string (the last item + one)
*
* return value is a pointer to the first white character after a non-white character at the end
* or to the last+one if there is no any white characters
*
*/
const char * skip_white_from_back(const char * str_begin, const char * str_end, bool check_additional_chars = true, bool treat_new_line_as_white = true);
const wchar_t * skip_white_from_back(const wchar_t * str_begin, const wchar_t * str_end, bool check_additional_chars = true, bool treat_new_line_as_white = true);
const char * skip_white_from_back(const char * str, bool check_additional_chars = true, bool treat_new_line_as_white = true);
const wchar_t * skip_white_from_back(const wchar_t * str, bool check_additional_chars = true, bool treat_new_line_as_white = true);
char to_lower(char c);
wchar_t to_lower(wchar_t c);
char to_upper(char c);
wchar_t to_upper(wchar_t c);
void to_lower_emplace(std::string & str);
void to_lower_emplace(std::wstring & str);
void to_upper_emplace(std::string & str);
void to_upper_emplace(std::wstring & str);
std::string to_lower(const std::string & str);
std::wstring to_lower(const std::wstring & str);
std::string to_upper(const std::string & str);
std::wstring to_upper(const std::wstring & str);
int compare(const char * str1, const char * str2);
int compare(const wchar_t * str1, const wchar_t * str2);
int compare(const std::string & str1, const std::string & str2);
int compare(const std::wstring & str1, const std::wstring & str2);
int compare(const char * str1_begin, const char * str1_end, const char * str2);
int compare(const wchar_t * str1_begin, const wchar_t * str1_end, const wchar_t * str2);
/*
* compare no case
*/
int compare_nc(const char * str1, const char * str2);
int compare_nc(const wchar_t * str1, const wchar_t * str2);
int compare_nc(const std::string & str1, const std::string & str2);
int compare_nc(const std::wstring & str1, const std::wstring & str2);
int compare_nc(const char * str1_begin, const char * str1_end, const char * str2);
int compare_nc(const wchar_t * str1_begin, const wchar_t * str1_end, const wchar_t * str2);
bool is_equal(const char * str1, const char * str2);
bool is_equal(const wchar_t * str1, const wchar_t * str2);
bool is_equal(const std::string & str1, const std::string & str2);
bool is_equal(const std::wstring & str1, const std::wstring & str2);
bool is_equal(const char * str1_begin, const char * str1_end, const char * str2);
bool is_equal(const wchar_t * str1_begin, const wchar_t * str1_end, const wchar_t * str2);
bool is_equal_nc(const char * str1, const char * str2);
bool is_equal_nc(const wchar_t * str1, const wchar_t * str2);
bool is_equal_nc(const std::string & str1, const std::string & str2);
bool is_equal_nc(const std::wstring & str1, const std::wstring & str2);
bool is_equal_nc(const char * str1_begin, const char * str1_end, const char * str2);
bool is_equal_nc(const wchar_t * str1_begin, const wchar_t * str1_end, const wchar_t * str2);
bool is_substr(const char * short_str, const char * long_str);
bool is_substr(const wchar_t * short_str, const wchar_t * long_str);
bool is_substr(const std::string & short_str, const std::string & long_str);
bool is_substr(const std::wstring & short_str, const std::wstring & long_str);
bool is_substr_nc(const char * short_str, const char * long_str);
bool is_substr_nc(const wchar_t * short_str, const wchar_t * long_str);
bool is_substr_nc(const std::string & short_str, const std::string & long_str);
bool is_substr_nc(const std::wstring & short_str, const std::wstring & long_str);
void trim_first_white(std::string & str, bool check_additional_chars = true, bool treat_new_line_as_white = true);
void trim_first_white(std::wstring & str, bool check_additional_chars = true, bool treat_new_line_as_white = true);
void trim_last_white(std::string & str, bool check_additional_chars = true, bool treat_new_line_as_white = true);
void trim_last_white(std::wstring & str, bool check_additional_chars = true, bool treat_new_line_as_white = true);
void trim_white(std::string & str, bool check_additional_chars = true, bool treat_new_line_as_white = true);
void trim_white(std::wstring & str, bool check_additional_chars = true, bool treat_new_line_as_white = true);
void trim_first(std::string & str, wchar_t c);
void trim_first(std::wstring & str, wchar_t c);
void trim_last(std::string & str, wchar_t c);
void trim_last(std::wstring & str, wchar_t c);
void trim(std::string & str, wchar_t c);
void trim(std::wstring & str, wchar_t c);
added: functions for dealing with white characters: bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too) CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true) IsDigit(wchar_t c, int base, int * digit) added: functions to converting from a string to an integer: unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0) changed: some work in Space (new Api) now Text() methods returns std::wstring by value (before they were returned by reference) added std::wstring & TextRef() methods added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong() GetValue() renamed to GetFirstValue() AText() renamed to TextA() and they return std::string by value now git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
}
#endif