now we can:
- parse short options, those beginning with a hypnen '-'
- parse long options, those beginning with two hyphens '--'
- long options can have arguments in two forms:
- either with an equal sign, e.g.: --opion-name=argument
- or with a space, e.g: --option argument
in the latter case we can have more than one argument, e.g: --option argument1 argument2
- parse non-option arguments, those after two hyphens to the end of a string, e.g: -- arg1 arg2
- 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