- changed function names: PascalCase to snake_case
- templates functions moved to a seperate file (text_private.h)
- as a public api only available functions with char/wchar_t/std::string/std::wstring
- ToLower(...) changed to to_lower_emplace(...), similar ToUpper(...) to to_upper_emplace(...)
- added functions:
std::string to_lower(const std::string & str);
std::string to_upper(const std::string & str);
and with std::wstring too
- functions with postfix 'NoCase' changed to 'nc'
Those characters were treated as invalid characters.
UTF8ToInt_FirstOctet incorrectly checked if the first octed is zero (after removing first bits).
This is a case only if the utf-8 character consists of two bytes. For 3 or 4 bytes
the first part can have all bits equal zero.
added to Space: some methods for searching a field with ignoring case:
Space * get_object_field_nc(const wchar_t * field)
Space * get_object_field_nc(const std::wstring & field);
const Space * get_object_field_nc(const wchar_t * field) const;
const Space * get_object_field_nc(const std::wstring & field) const;
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
without this such an input json (incorrect json string as there is no {} characters):
"key": "value"
would be parsed correctly: "key" would be parsed and the rest would be skipped
- utf8 auxiliary functions moved to utf8_private.h file
- in utf8.h are shown only functions available for consumers
- template functions has been moved to utf8_template.h (in utf8.h are only declarations)
utf8_template.h is included at the end of utf8.h
- functions which take std::ostream changed to template (the stream is a template argument now)
template<class StringType> void Toa(unsigned long long value, StringType & res, bool clear_string = true, int base = 10);
template<class StringType> void Toa(long long value, StringType & res, bool clear_string = true, int base = 10);
template<class StringType> void Toa(unsigned long value, StringType & res, bool clear_string = true, int base = 10);
template<class StringType> void Toa(long value, StringType & res, bool clear_string = true, int base = 10);
template<class StringType> void Toa(unsigned int value, StringType & res, bool clear_string = true, int base = 10);
template<class StringType> void Toa(int value, StringType & res, bool clear_string = true, int base = 10);
template<class StringType> void Toa(unsigned short value, StringType & res, bool clear_string = true, int base = 10);
template<class StringType> void Toa(short value, StringType & res, bool clear_string = true, int base = 10);
std::wstring Toa(unsigned long long value, int base);
std::wstring Toa(long long value, int base);
std::wstring Toa(unsigned long value, int base);
std::wstring Toa(long value, int base);
std::wstring Toa(unsigned int value, int base);
std::wstring Toa(int value, int base);
std::wstring Toa(unsigned short value, int base);
std::wstring Toa(short value, int base);
did not have 'const' modifier and there was an error when compiling with clang with -std=c++20 flag
/usr/home/tomek/roboczy/prog/web.ttmath.org/../pikotools/textstream/textstream.h:225:11: fatal error: use of overloaded operator '!=' is ambiguous (with operand types
'PT::TextStreamBase<char, 256, 4096>::const_iterator' (aka 'PT::MemBuffer<char, 256, 4096>::const_iterator') and 'PT::TextStreamBase<char, 256, 4096>::const_iterator')
for( ; i != end() ; ++i)
~ ^ ~~~~~
/usr/home/tomek/roboczy/prog/web.ttmath.org/../morm/src/finderhelper.h:78:14: note: in instantiation of member function 'PT::TextStreamBase<char, 256, 4096>::to_string' requested here
table_name.to_string(table_name_str);
^
/usr/home/tomek/roboczy/prog/web.ttmath.org/../pikotools/membuffer/membuffer.h:93:8: note: candidate function
bool operator!=(const const_iterator & i);
^
/usr/home/tomek/roboczy/prog/web.ttmath.org/../pikotools/membuffer/membuffer.h:92:8: note: candidate function
bool operator==(const const_iterator & i);
^
/usr/home/tomek/roboczy/prog/web.ttmath.org/../pikotools/membuffer/membuffer.h:92:8: note: candidate function (with reversed parameter order)
minimal width for integers
added: to Log: operator<<(long long s)
added: to TextStreamBase:
operator<<(long long);
operator<<(unsigned long long);
int_min_width(size_t min_width); // minimal width for integers
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1167 e52654a7-88a9-db11-a3e9-0013d4bc506e
for replacing parameters in patterns e.g. Replace("param %0", "first param")
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1163 e52654a7-88a9-db11-a3e9-0013d4bc506e
renamed Logger -> Log
this class has an api (<< operators) for taking what should be put to the log file
as the buffer is used WTextStream which should be allocated elsewhere
added: FileLog - this class saves to a file log
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1149 e52654a7-88a9-db11-a3e9-0013d4bc506e