Commit Graph

  • e0565813de removed *.a from .gitignore Tomasz Sowa 2021-05-18 23:58:46 +0200
  • db93586c0e make depend Tomasz Sowa 2021-05-18 23:58:17 +0200
  • ad4e8078ae MainSpaceParser class has been renamed to MainOptionsParser Tomasz Sowa 2021-05-18 23:57:58 +0200
  • 96e60c526f moved files: mainspaceparser/mainspaceparser.(h|cpp) -> mainoptions/mainoptionsparser.(h|cpp) Tomasz Sowa 2021-05-18 23:50:42 +0200
  • a5c8833452 added tests for MainSpaceParser Tomasz Sowa 2021-05-18 22:57:26 +0200
  • 91300bb245 make depend Tomasz Sowa 2021-05-17 03:21:00 +0200
  • fe82f63efb changed the way of building in Makefiles Tomasz Sowa 2021-05-17 03:20:51 +0200
  • da6a36a205 start creating tests for MainSpaceParser Tomasz Sowa 2021-05-17 03:19:47 +0200
  • ac691bccb7 updated MainSpaceParser to the new Space format, changed api to snake case 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 Tomasz Sowa 2021-05-17 03:09:21 +0200
  • 77d7bb5e64 fixed in Space: set_empty_string(), set_empty_wstring(), set_empty_table() and set_empty_object() didn't clear its object if the same kind of object already existed Tomasz Sowa 2021-05-17 03:08:32 +0200
  • 3d6c4e27c0 added .editorconfig file with tab style and tab size information https://editorconfig.org/ Tomasz Sowa 2021-05-15 18:34:10 +0200
  • 1260b303bc added ./m to .gitignore Tomasz Sowa 2021-05-10 21:24:37 +0200
  • d3dd74b3d4 added tests/tests to .gitignore Tomasz Sowa 2021-05-10 20:16:54 +0200
  • 7bdc4d2fc7 added global Makefile Tomasz Sowa 2021-05-10 20:10:10 +0200
  • ce81670bb6 added 'tests' directory with tests for the pikotools library currently only tests for convert/text functions Tomasz Sowa 2021-05-10 20:08:50 +0200
  • cd9e501f48 make depend Tomasz Sowa 2021-05-10 20:08:19 +0200
  • b3cd4d5f7f removed definition of CXX and CXXFLAGS from Makefile Tomasz Sowa 2021-05-10 20:07:08 +0200
  • adee7d134f added macro PT_HAS_MORM in Log class where operator<<(morm::Model & model) is used Tomasz Sowa 2021-05-10 20:05:55 +0200
  • 7abe4b340a changes in convert/text functions - 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' Tomasz Sowa 2021-05-10 20:04:12 +0200
  • 3984c29fbf moved all directories to src subdirectory Tomasz Sowa 2021-05-09 20:11:37 +0200
  • 127f26884e make depend Tomasz Sowa 2021-05-08 22:40:06 +0200
  • b055c46ae8 fixed #3: CompareNoCase incorrectly returned that string1 is greater than string2 for some characters when converting from 'char' to 'int' we should first convert to 'unsigned char' and then to 'int' Tomasz Sowa 2021-05-08 22:37:31 +0200
  • 463cec3283 fixed #2: Procedures for reading an utf8 string incorrectly read some utf-8 characters. Those characters were treated as invalid characters. Tomasz Sowa 2021-05-07 15:53:19 +0200
  • 96eedd9be9 added support for morm::Model to Log: Log & operator<<(morm::Model & model); but we need some kind of a macro to allow this Tomasz Sowa 2021-04-30 01:17:47 +0200
  • f572250572 make depend Tomasz Sowa 2021-04-30 01:17:29 +0200
  • 16f6bdb358 fixed: Space::has_value(...) incorrectly compared strings Tomasz Sowa 2021-04-14 17:42:57 +0200
  • 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) Tomasz Sowa 2021-04-12 18:49:34 +0200
  • 5d34db5fcf added to Space: - methods for testing a string value if a Space is a string or a table: bool has_value(const char * val) const; bool has_value(const std::string & val) const; bool has_value(const wchar_t * val) const; bool has_value(const std::wstring & val) const; - methods for testing a string value in an object (testing a string or a table): bool has_value(const wchar_t * field, const char * val) const; bool has_value(const wchar_t * field, const std::string & val) const; bool has_value(const wchar_t * field, const wchar_t * val) const; bool has_value(const wchar_t * field, const std::wstring & val) const; - methods for removing a child space: void remove_child_space(const wchar_t * name); void remove_child_space(const std::wstring & name); void remove_child_space(size_t index); Tomasz Sowa 2021-04-09 17:49:44 +0200
  • a1e8f13f46 fixed: calculating buffer length in Space: sizeof(char) -> sizeof(wchar_t) Tomasz Sowa 2021-04-08 17:40:30 +0200
  • 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) Tomasz Sowa 2021-04-08 17:16:37 +0200
  • 0aeac12fa0 make depend Tomasz Sowa 2021-04-08 17:02:27 +0200
  • 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 Tomasz Sowa 2021-03-18 17:55:30 +0100
  • 539faa4976 changed the indentation algorithm when pretty printing the space format (no visual changes) Tomasz Sowa 2021-03-18 17:28:11 +0100
  • 679b9e6173 added some indentation when printing 'pretty Space format' Tomasz Sowa 2021-03-18 17:19:36 +0100
  • 4119461f8e fixed: when reading a non-escaped space token we should check whether a delimiter was escaped or not also a '#' was not tested Tomasz Sowa 2021-03-18 16:26:56 +0100
  • db5e516564 added to Space: serialization do Space format Tomasz Sowa 2021-03-18 15:33:43 +0100
  • 1baf5042fe removed: SpaceToJson Tomasz Sowa 2021-03-17 18:35:48 +0100
  • ba82ac7cbe renamed: JSONToSpaceParser -> SpaceParser Tomasz Sowa 2021-03-17 18:33:41 +0100
  • 961a02ab39 removed: old SpaceParser Tomasz Sowa 2021-03-17 18:26:13 +0100
  • 6e169f7650 added to JSONToSpaceParser: possibility to parse the Space format renamed: ParseFile() -> ParseJSONFile() added: ParseSpaceFile(), ParseJSON(), ParseSpace() Tomasz Sowa 2021-03-17 18:24:50 +0100
  • 31f7bdb857 added to Space: child_spaces and a name of a Space Tomasz Sowa 2021-03-17 18:09:47 +0100
  • 5b5a1dfbb6 changed the way how the library is built - now there is only one Makefile in the root directory and we have only one pikotools.a lib file - removed: mainparser Tomasz Sowa 2021-03-17 13:16:01 +0100
  • 61291cf7ad make depend Tomasz Sowa 2021-03-16 18:43:34 +0100
  • 0c0f15ab8a changed: JSONToSpaceParser can parse json string/file to the new Space format now (some minor chars escaping not ready yet) Tomasz Sowa 2021-03-16 18:40:14 +0100
  • ba7fa1c195 fixed: in serialize_json_double(): the buffer length was calculated incorrectly: sizeof(char) changed to sizeof(wchar_t) added to Space struct: void set_null(); void set_empty_string(); void set_empty_wstring(); void set_empty_table(); void set_empty_object(); void clear(); Tomasz Sowa 2021-03-16 18:36:59 +0100
  • bc9e4a3844 use PT::WideStreamToUTF8() instead of PT::WideToUTF8() for a moment Tomasz Sowa 2021-03-16 18:35:08 +0100
  • 4ef8f5a884 template<size_t stack_size, size_t heap_block_size> changed to template<typename StreamType> Tomasz Sowa 2021-03-15 20:09:23 +0100
  • f65d934e8c start working on a new version of Space struct - better support for JSON format now we have a correct model, some methods for setting/getting values and serialization to json (no serialization to Space yet) Tomasz Sowa 2021-03-15 19:36:49 +0100
  • 7ccd435e2c make depend Tomasz Sowa 2021-03-15 19:36:04 +0100
  • fac3a7eb71 reorganization in utf8 - 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) Tomasz Sowa 2021-03-15 19:34:51 +0100
  • effe9be0a3 added: typedef with char_type to TextStreamBase Tomasz Sowa 2021-03-15 19:27:03 +0100
  • df88d4c0fc temporarily blocked for compilation: mainspaceparser, jsontospaceparser, spaceparser, spacetojson Tomasz Sowa 2021-03-15 19:25:04 +0100
  • f771f12027 renamed: std::wstring Toa(...) -> std::wstring to_str(...) added: std::string to_str(...) Tomasz Sowa 2021-03-15 19:23:49 +0100
  • 448ad42961 added: Toa() methods for converting to a string (new file convert/inttostr.cpp): 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); Tomasz Sowa 2021-03-03 02:24:30 +0100
  • d9a4fa34e2 added .gitignore file Tomasz Sowa 2021-02-17 17:04:05 +0100
  • 49e49d1246 fixed: operator==() and operator!=() in iterators in MemBuffer<> template did not have 'const' modifier and there was an error when compiling with clang with -std=c++20 flag Tomasz Sowa 2021-02-17 16:53:19 +0100
  • aff698d155 a comment added in Log::~Log(), we have to consider whether calling save_log_and_clear() in ~Log() should be removed Tomasz Sowa 2021-02-17 16:51:06 +0100
  • a29cb45f6a added: in FileLog::save_log(): test whether synchro_lock() has returned true Tomasz Sowa 2019-09-25 16:12:10 +0000
  • 7309c7817d in spacetojson: if there is only one item then do not put it in the table Tomasz Sowa 2019-02-19 13:08:07 +0000
  • c2e63f9290 added: to Date: support for parsing timezone offsets Tomasz Sowa 2019-01-31 20:56:40 +0000
  • 5a63a8c0ec added: to Log: IntMinWidth(size_t min_width) 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 Tomasz Sowa 2019-01-28 18:06:18 +0000
  • e9df044f9e added to convert: PatternReplacer for replacing parameters in patterns e.g. Replace("param %0", "first param") Tomasz Sowa 2019-01-07 03:29:34 +0000
  • 6c4a76baad changed in utf8: functions taking WTextStream now take a template TextStreamBase Tomasz Sowa 2018-11-24 17:09:25 +0000
  • da4ed9c1f8 added to utf8: bool UTF8ToWide(const char * utf8, size_t utf8_len, WTextStream & res, bool clear = true, int mode = 1); bool UTF8ToWide(const char * utf8, WTextStream & res, bool clear = true, int mode = 1); bool UTF8ToWide(const std::string & utf8, WTextStream & res, bool clear = true, int mode = 1); bool UTF8ToWide(std::istream & utf8, WTextStream & res, bool clear = true, int mode = 1); Tomasz Sowa 2018-11-24 13:30:45 +0000
  • 8b3ae14d9a fixed: FileLog didn't save an utf8 sequence Tomasz Sowa 2018-11-24 10:47:13 +0000
  • e971e1ef9b changed in logger: 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 Tomasz Sowa 2018-11-23 17:07:52 +0000
  • 6984a34fcd added to convert/text.h: bool IsSubStringp(const StringType1 * short_str, const StringType2 * long_str); bool IsSubString(const StringType1 * short_str, const StringType2 * long_str); bool IsSubString(const StringType1 & short_str, const StringType2 & long_str); bool IsSubStringNoCasep(const StringType1 * short_str, const StringType2 * long_str); bool IsSubStringNoCase(const StringType1 * short_str, const StringType2 * long_str); bool IsSubStringNoCase(const StringType1 & short_str, const StringType2 & long_str); (moved from winix) Tomasz Sowa 2018-10-29 23:47:23 +0000
  • 5fe920d591 added: to convert/text.h: int CompareNoCase(const StringType1 * str1_begin, const StringType1 * str1_end, const StringType2 * str2) Tomasz Sowa 2018-10-24 16:25:47 +0000
  • 605f24420e added to convert/text.h: bool EqualNoCasep(const StringType1 * str1, const StringType2 * str) int CompareNoCasep(const StringType1 * str1, const StringType2 * str2) Tomasz Sowa 2018-10-04 13:41:07 +0000
  • 8e9f83e377 changed: when parsing date skip 'Z' character if exists (iso format) Tomasz Sowa 2018-09-19 21:24:23 +0000
  • 239e1e4674 added: CompareNoCase() to convert/text.h Tomasz Sowa 2018-08-11 17:37:35 +0000
  • 040eb12c8b added: to convert/text wchar_t ToLower(wchar_t c) wchar_t ToUpper(wchar_t c) void ToLower(std::wstring & s) void ToUpper(std::wstring & s) Tomasz Sowa 2018-05-25 17:12:28 +0000
  • 72a510ce71 fixed: JSONToSpaceParser incorrectly read the last character from an UTF8 string (a last character before terminating zero char) it caused a syntax error when parsing Tomasz Sowa 2018-04-26 16:36:15 +0000
  • dd325bd4f9 added: Logger Tomasz Sowa 2018-04-23 14:28:22 +0000
  • bf4fdf6da7 added: Toa() for long long, int, short and unsigned as well fixed: when serializing Date the year has at least 4 digits e.g. 0001 when the year is equal to one Tomasz Sowa 2018-04-22 21:22:55 +0000
  • 38355a2830 added: method Date::SerializeISO(Stream & out) outputs to the given stream: YYYY-MM-DDTHH:MM:SSZ, eg: 1990-02-12T13:05:39Z added: parsing date in a format: YYYY-MM-DDTHH:MM:SS ('T' letter given) Tomasz Sowa 2018-04-20 09:33:53 +0000
  • dc0cd13178 some work in Space - default value returned from TextRef() Tomasz Sowa 2018-04-16 22:55:58 +0000
  • c910e22c00 temporarily commented 'current_nested_level' in JSONtoSpaceParser Tomasz Sowa 2018-04-16 22:51:14 +0000
  • cb23304885 added: to methods Toull(), Toll(), Toul(), Toui(), Tol(), Toi() a new parameter: bool allow_skip_whitechars default true added: new methods: Toull_b(), Toll_b(), Toul_b(), Toui_b(), Tol_b(), Toi_b() automatically detects the base (radix): 4323 - base 10 0122 - base 8 (string starts with 0) #fff - base 16 (string starts with #) &101 - base 2 (string starts with &) added: CharType * SkipWhiteFromBack(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true) skipping white characters from the end of a string changed: Toll_b(), Toull_b(), Tol_b() and Toul_b() are used in Space now for methods ToInt() etc so we are able to use a different base now changed: some work in Space (const correctness) Tomasz Sowa 2018-01-05 20:03:11 +0000
  • e24112b79b some work in Space API: added: new GetValue() implementation Value * GetValue(const wchar_t * name) Value * GetValue(const std::wstring & name) const Value * GetValue(const wchar_t * name) const const Value * GetValue(const std::wstring & name) const added: const correctness for Text() and TextA() methods std::wstring Text(...) const; std::string TextA(...) const; added: TextA() with a wide second argument std::string TextA(const wchar_t * name, const wchar_t * def) const; std::string TextA(const std::wstring & name, const wchar_t * def) const; std::string TextA(const std::wstring & name, const std::wstring & def) const; Tomasz Sowa 2017-12-07 11:35:12 +0000
  • 7d51372844 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) Tomasz Sowa 2017-12-05 16:32:21 +0000
  • cde990ba82 start changing the Space API removed table_single from Space Tomasz Sowa 2017-06-27 16:51:55 +0000
  • 62f16ecb1b changed: using relative paths calculated with relative_path now Tomasz Sowa 2016-03-18 09:27:40 +0000
  • 9deb2ff2f2 some work in MainSpaceParser: added reading long (--longname) parameters Tomasz Sowa 2016-02-08 18:00:17 +0000
  • 7b4b576489 added: MainSpaceParser - starting writing a parser for main(argc, argv) arguments (a Space object is returned) Tomasz Sowa 2016-01-21 18:49:42 +0000
  • d9b583df76 instead of directly using 'ar' program we are using the AR macro now (which defaults to 'ar' if you do not define it) Tomasz Sowa 2014-11-12 04:11:28 +0000
  • d655c7c872 removed: svn:executable attribute from files Tomasz Sowa 2014-11-01 17:11:00 +0000
  • 39717a4dd2 fixed: in static size_t WideToInt(const wchar_t * wide_string, size_t string_len, int & z, bool & correct) we didn't test UTF8_CheckRange() Tomasz Sowa 2014-10-04 11:18:33 +0000
  • 28ea8f3c3e added: to membuffer: template<typename in_item_type> void append(const in_item_type * item_array, size_t len); when adding values from item_array are casted to the type of the internal buffer changed: some minor optimizations in Space (in Add() methods with WTextStream as an argument) changed: removed following write() methods from TextStreamBase: TextStreamBase & write(const char * buf, size_t len); TextStreamBase & write(const wchar_t * buf, size_t len); and added a template instead: template<typename in_buffer_type> TextStreamBase & write(const in_buffer_type * buf, size_t len); this allows to write char* buffer to TextStreamBase<wchar_t...> (and vice versa) added: two write() methods to TextStreamBase: write(const char * format, double val); write(const wchar_t * format, double val); converting double value to the text (format is the same as in snprintf) Tomasz Sowa 2013-11-28 22:21:10 +0000
  • 3cc5fd5e12 added: -I.. flag for Makefiles when compiling changed: in SpaceToJSON::PrintToken(): slash doesn't have to be escaped when serializing to JSON Tomasz Sowa 2013-10-15 23:53:57 +0000
  • aa394b1e4f dummy commit (testing a new repository) Tomasz Sowa 2013-05-07 05:13:08 +0000
  • 6e57002a90 fixed: in MemBuffer::MemBuffer(const MemBuffer<> & arg) we have to initialize some variables before calling the operator= Tomasz Sowa 2012-10-27 07:45:39 +0000
  • 1e48455942 added: to Space: bool HasValue(const wchar_t * name, const wchar_t * value); bool HasValue(const wchar_t * name, const std::wstring & value); bool HasValue(const std::wstring & name, const wchar_t * value); bool HasValue(const std::wstring & name, const std::wstring & value); useful when testing whether a value is in a list (or in simple table too) Tomasz Sowa 2012-10-17 19:55:16 +0000
  • 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' Tomasz Sowa 2012-09-25 16:50:01 +0000
  • c6c079f8aa some commentaries Tomasz Sowa 2012-09-11 21:41:48 +0000
  • 5ad48470b6 added: to Space: std::wstring & FindAdd(const WTextStream & name); std::wstring & Add(const wchar_t * name, const WTextStream & value); std::wstring & Add(const std::wstring & name, const WTextStream & value); std::wstring & Add(const WTextStream & name, const WTextStream & value); Tomasz Sowa 2012-07-25 10:27:20 +0000
  • f8d5a962ed changed: rewritten the Serialize method in SpaceToJSON class Tomasz Sowa 2012-07-15 22:53:24 +0000
  • 2b88d011f6 updated: SpaceToJSON (not finished yet) Tomasz Sowa 2012-07-13 12:26:09 +0000
  • 2af6c28a54 added: JSONToSpaceParser -- a parser for JSON format to Space structure added: SpaceToJSON -- a serializer from Space structure to JSON (not finished yet) Tomasz Sowa 2012-07-12 15:01:15 +0000
  • 600d0fc34a added: some work in membuffer and textstreambase Tomasz Sowa 2012-07-10 16:53:26 +0000