Commit Graph

15 Commits

Author SHA1 Message Date
Tomasz Sowa 8e9f83e377 changed: when parsing date skip 'Z' character if exists (iso format)
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1126 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-09-19 21:24:23 +00:00
Tomasz Sowa 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




git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1093 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-04-22 21:22:55 +00:00
Tomasz Sowa 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)




git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1089 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-04-20 09:33:53 +00:00
Tomasz Sowa 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)

added: functions to converting from a string to an integer:
       unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
       long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
       unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
       unsigned int  Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
       long          Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
       int           Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)

changed: some work in Space (new Api)       
       now Text() methods returns std::wstring by value (before they were returned by reference)
       added std::wstring & TextRef() methods
       added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
       GetValue() renamed to GetFirstValue()
       AText() renamed to TextA() and they return std::string by value now
       



git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 16:32:21 +00:00
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 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 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 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