Commit Graph

17 Commits

Author SHA1 Message Date
Tomasz Sowa 297940ff7c fix in SpaceParser when parsing json format: floating point values such as 1.123e+01 where not correctly parsed ('+' character was not correctly parsed)
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;
2021-04-12 18:49:34 +02:00
Tomasz Sowa a2339eed34 fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
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)
2021-04-08 17:16:37 +02:00
Tomasz Sowa 1c643a08b0 added a test whether we have reach the end of the input string
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
2021-03-18 17:55:30 +01:00
Tomasz Sowa 4119461f8e fixed: when reading a non-escaped space token we should check whether a delimiter was escaped or not
also a '#' was not tested
2021-03-18 16:26:56 +01:00
Tomasz Sowa ba82ac7cbe renamed: JSONToSpaceParser -> SpaceParser 2021-03-17 18:33:41 +01:00
Tomasz Sowa 961a02ab39 removed: old SpaceParser 2021-03-17 18:26:13 +01:00
Tomasz Sowa df88d4c0fc temporarily blocked for compilation: mainspaceparser, jsontospaceparser, spaceparser, spacetojson 2021-03-15 19:25:04 +01:00
Tomasz Sowa cde990ba82 start changing the Space API
removed table_single from Space



git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1065 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-06-27 16:51:55 +00:00
Tomasz Sowa d655c7c872 removed: svn:executable attribute from files
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@985 e52654a7-88a9-db11-a3e9-0013d4bc506e
2014-11-01 17:11:00 +00:00
Tomasz Sowa 02abfe62fa changed: in SpaceParser: now we do not parse special characters when reading commentaries
so we can parse:
         # such a \n string
         beforehand this \n was treated as a new line character
         and the parser was returning syntax error when reading above 'string'



git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@432 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-09-25 16:50:01 +00:00
Tomasz Sowa 2af6c28a54 added: JSONToSpaceParser -- a parser for JSON format to Space structure
added: SpaceToJSON -- a serializer from Space structure to JSON (not finished yet)



git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@427 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-07-12 15:01:15 +00:00
Tomasz Sowa 5d9ce6e093 changed: in SpaceParser:
white characters can be escaped by '\ ' and in such a case this is not a delimiter
         (when reading single token)


git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@410 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-05-12 18:20:39 +00:00
Tomasz Sowa 11ddf0f6d9 fixed: in Space serializer: we have to escape more characters
fixed: in SpaceParser::ReadTokenSingle
       the delimiter can be only if the character was not escaped


git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@409 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-05-12 15:54:20 +00:00
Tomasz Sowa e195145394 changed: now in SpaceParser 'split_single' and utf8 are default
removed: some errors checking at the end of a line
         now we can have in the same line: value="option" value2="option2"



git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@408 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-05-12 14:54:19 +00:00
Tomasz Sowa e620c8f95d changed: SpaceParser -- parser's engine has been rewritten
now we can map all strings to all strings
         documentation in space.h need to be updated yet


git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@407 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-05-10 21:16:19 +00:00
Tomasz Sowa e15bae9fac changed: in space/spaceparser.cpp the correct include file (spaceparser.h now)
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@403 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-04-30 13:17:50 +00:00
Tomasz Sowa cd3a1b853f changed: class name: ConfParser -> SpaceParser
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@402 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-04-30 13:10:55 +00:00