- added some converting methods: esc_to_json(...), esc_to_xml(...), esc_to_csv() (convert/misc.h)

- BaseParser: added possibility to read from TextStream and WTextStream
- HTMLParser: added filter(const WTextStream & in, Stream & out, ...) method
- added utf8_stream.h with one method:
  template<typename StreamIteratorType>
  size_t utf8_to_int(
    StreamIteratorType & iterator_in,
    StreamIteratorType & iterator_end,
    int & res,
    bool & correct)
This commit is contained in:
2021-10-12 19:53:11 +02:00
parent 4902eb6037
commit 17d2c0fb25
13 changed files with 807 additions and 128 deletions

View File

@@ -74,11 +74,12 @@ int SpaceParser::get_last_parsed_line()
SpaceParser::Status SpaceParser::parse_json_file(const char * file_name, Space & out_space, bool clear_space)
{
clear_input_flags();
reading_from_file = true;
parsing_space = false;
root_space = &out_space;
file.clear();
file.open(file_name, std::ios_base::binary | std::ios_base::in);
if( file )
@@ -125,11 +126,12 @@ SpaceParser::Status SpaceParser::parse_json_file(const std::wstring & file_name,
SpaceParser::Status SpaceParser::parse_space_file(const char * file_name, Space & out_space, bool clear_space)
{
clear_input_flags();
reading_from_file = true;
parsing_space = true;
root_space = &out_space;
file.clear();
file.open(file_name, std::ios_base::binary | std::ios_base::in);
if( file )
@@ -174,10 +176,9 @@ SpaceParser::Status SpaceParser::parse_space_file(const std::wstring & file_name
SpaceParser::Status SpaceParser::parse_json(const char * str, Space & out_space, bool clear_space)
{
reading_from_file = false;
reading_from_wchar_string = false;
clear_input_flags();
pchar_ascii = str;
pchar_unicode = 0;
parsing_space = false;
root_space = &out_space;
@@ -195,10 +196,9 @@ SpaceParser::Status SpaceParser::parse_json(const std::string & str, Space & out
SpaceParser::Status SpaceParser::parse_json(const wchar_t * str, Space & out_space, bool clear_space)
{
reading_from_file = false;
reading_from_wchar_string = true;
clear_input_flags();
pchar_unicode = str;
pchar_ascii = 0;
parsing_space = false;
root_space = &out_space;
@@ -219,10 +219,9 @@ SpaceParser::Status SpaceParser::parse_json(const std::wstring & str, Space & ou
SpaceParser::Status SpaceParser::parse_space(const char * str, Space & out_space, bool clear_space)
{
reading_from_file = false;
reading_from_wchar_string = false;
clear_input_flags();
pchar_ascii = str;
pchar_unicode = 0;
parsing_space = true;
root_space = &out_space;
@@ -240,10 +239,9 @@ SpaceParser::Status SpaceParser::parse_space(const std::string & str, Space & ou
SpaceParser::Status SpaceParser::parse_space(const wchar_t * str, Space & out_space, bool clear_space)
{
reading_from_file = false;
reading_from_wchar_string = true;
clear_input_flags();
pchar_unicode = str;
pchar_ascii = 0;
parsing_space = true;
root_space = &out_space;