Commit Graph

206 Commits

Author SHA1 Message Date
Tomasz Sowa d9b583df76 instead of directly using 'ar' program we are using the AR macro now
(which defaults to 'ar' if you do not define it)



git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@991 e52654a7-88a9-db11-a3e9-0013d4bc506e
2014-11-12 04:11:28 +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 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()

added: functions for converting from a wide string into an utf8 c-string:
       bool WideToUTF8(const wchar_t * wide_string, size_t string_len, char * utf8, size_t utf8_len, size_t & utf8_written, int mode = 1);
       bool WideToUTF8(const wchar_t * wide_string,                    char * utf8, size_t utf8_len, size_t & utf8_written, int mode = 1);
       bool WideToUTF8(const std::wstring & wide_string,               char * utf8, size_t utf8_len, size_t & utf8_written, int mode = 1);

       bool WideToUTF8(const wchar_t * wide_string, size_t string_len, char * utf8, size_t utf8_len, int mode = 1);
       bool WideToUTF8(const wchar_t * wide_string,                    char * utf8, size_t utf8_len, int mode = 1);
       bool WideToUTF8(const std::wstring & wide_string,               char * utf8, size_t utf8_len, int mode = 1);




git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@962 e52654a7-88a9-db11-a3e9-0013d4bc506e
2014-10-04 11:18:33 +00:00
Tomasz Sowa 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)




git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@448 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-11-28 22:21:10 +00:00
Tomasz Sowa 3cc5fd5e12 added: -I.. flag for Makefiles when compiling
changed: in SpaceToJSON::PrintToken():
         slash doesn't have to be escaped when serializing to JSON




git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@444 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-10-15 23:53:57 +00:00
Tomasz Sowa aa394b1e4f dummy commit (testing a new repository)
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@439 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-05-07 05:13:08 +00:00
Tomasz Sowa 6e57002a90 fixed: in MemBuffer::MemBuffer(const MemBuffer<> & arg)
we have to initialize some variables before calling the operator=



git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@434 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-10-27 07:45:39 +00:00
Tomasz Sowa 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)



git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@433 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-10-17 19:55:16 +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 c6c079f8aa some commentaries
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@431 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-09-11 21:41:48 +00:00
Tomasz Sowa 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);




git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@430 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-07-25 10:27:20 +00:00
Tomasz Sowa f8d5a962ed changed: rewritten the Serialize method in SpaceToJSON class
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@429 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-07-15 22:53:24 +00:00
Tomasz Sowa 2b88d011f6 updated: SpaceToJSON (not finished yet)
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@428 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-07-13 12:26:09 +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 600d0fc34a added: some work in membuffer and textstreambase
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@426 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-07-10 16:53:26 +00:00
Tomasz Sowa d2d30cf640 added: convert (functions for converting) currently only int(long) -> string
added: textstream (an efficient memory stream for creating strings -- it's using MemBuffer)



git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@425 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-07-03 14:58:18 +00:00
Tomasz Sowa 64b05fe8d1 added: some work in MemBuffer (copy cctor and assignment operator)
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@424 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-07-02 20:27:31 +00:00
Tomasz Sowa 862dd01ea9 fixed: friend keyword should be used with a type name like 'class'
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@423 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-07-01 22:49:08 +00:00
Tomasz Sowa 4d968f5a85 added: some work in MemBuffer
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@422 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-07-01 22:38:27 +00:00
Tomasz Sowa 62f0624539 added: start working on MemBuffer (an efficient memory buffer)
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@421 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-07-01 00:39:41 +00:00
Tomasz Sowa be8e0d005c changed: Makefile
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@419 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-06-30 23:22:31 +00:00
Tomasz Sowa bff2ecb147 added: to Space:
const std::wstring * GetValue(const std::wstring & name) const;
       std::wstring & Add(const wchar_t * name,        size_t value);
       std::wstring & Add(const std::wstring & name,   size_t value);




git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@418 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-06-26 23:20:59 +00:00
Tomasz Sowa 39a1ea1007 added: to Date:
template<class Stream> void SerializeMonthDay(Stream & out) const;
       template<class Stream> void SerializeHourMin(Stream & out) const;




git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@417 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-06-22 23:35:16 +00:00
Tomasz Sowa d77db196ee added: to Date:
bool ParseMonthDayTime(const CStringType * str, const CStringType ** str_after = 0);
       parsing: MM:DD HH[:MM[:SS]]



git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@416 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-05-30 21:48:44 +00:00
Tomasz Sowa e775728f6b added: Date::ToTm() now sets tm_wday too
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@415 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-05-27 23:50:10 +00:00
Tomasz Sowa 03bac5721d added:
Date(const char * str);
       Date(const wchar_t * str);
       Date(const std::string & str);
       Date(const std::wstring & str);
 
       Date & operator=(const char * str);
       Date & operator=(const wchar_t * str);
       Date & operator=(const std::string & str);
       Date & operator=(const std::wstring & str);

       void Swap(Date&);
removed:
       templates cctors and operators=
       it is better to have directly char*, wchar_t and string, wstring



git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@414 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-05-26 22:38:18 +00:00
Tomasz Sowa 27cde22774 fixed: two operators: Date::operator=(const CStringType)
need 'return' statement


git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@413 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-05-24 19:24:37 +00:00
Tomasz Sowa 0ffb2b155f added: some methods for parsing from a string
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@412 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-05-22 23:47:41 +00:00
Tomasz Sowa e25bc826e7 changed: Date::SerializeDay outputs the date in a form of YYYY-MM-DD (before was: YYYY.MM.DD)
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@411 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-05-13 21:49:06 +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 c8cf401316 some cosmetic changes in date.h
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@406 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-05-05 15:13:45 +00:00
Tomasz Sowa 3280568594 added: Date structure -- represents year, month, day, hour, min, sec
with O(1) algorithm for converting from time_t (seconds from Unix epoch)


git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@405 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-05-05 15:08:04 +00:00
Tomasz Sowa 19da401bb0 changed Makefile dep
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@404 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-04-30 22:54:37 +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
Tomasz Sowa 02645de1f6 changed: directory name: confparser -> space
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@401 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-04-30 12:38:20 +00:00
Tomasz Sowa a2ed273090 added: to Space:
void RemoveSpace(const wchar_t * name);
       void RemoveSpace(const std::wstring & name);



git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@399 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-04-11 20:24:15 +00:00
Tomasz Sowa 0b66e6b807 added: to Space:
std::wstring & FindAdd(const wchar_t * name);
       std::wstring & FindAdd(const std::wstring & name);



git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@397 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-03-12 20:31:17 +00:00
Tomasz Sowa 0b97609811 added: Space::Remove(const wchar_t * name)
Space::Remove(const std::wstring & name)


git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@395 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-03-06 13:17:25 +00:00
Tomasz Sowa f29a7a41d4 fixed: win32 macros
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@387 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-02-15 07:57:44 +00:00
Tomasz Sowa 8b3c2904aa fixed: swprintf version for MS Visual
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@386 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-02-15 07:46:34 +00:00
Tomasz Sowa a233f8d4df added: to Space:
void RemoveSpace(size_t child_index)


git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@384 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-02-14 20:34:37 +00:00
Tomasz Sowa 29d179963e changed: in Space:
methods Add() return a reference to the inserted value now (std::wstring &)


git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@383 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-02-12 18:54:06 +00:00
Tomasz Sowa d0272485dc added: to Space:
void Add(const wchar_t * name, bool value);
       void Add(const wchar_t * name, int value);
       void Add(const wchar_t * name, long value);



git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@382 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-02-10 00:32:22 +00:00
Tomasz Sowa 04ca4692b3 added: to Space:
long Long(const wchar_t * name)
       for getting a long variable,
added: to Space:
       void Add(const wchar_t * name, long value)
       void Add(const wchar_t * name, const wchar_t * value)
       for inserting a variable,
added: to Space:
       Space & AddSpace(const wchar_t * name);
       for inserting a new space
added: to Space:
       Space * FindSpace(const wchar_t * name);
       to find a specified space
added: to Space:
       Space & FindAddSpace(const wchar_t * name);
       to find a specified space and if not exists
       automatically add a new one



git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@379 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-01-16 10:16:55 +00:00
Tomasz Sowa d0ffdd336c added: namespace PT, global Makefile file
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@374 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-01-12 02:46:16 +00:00
Tomasz Sowa f2ba48a10e importing confparser to pikotools
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@371 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-01-12 00:24:08 +00:00