Diff for /parser3/src/classes/date.C between versions 1.3 and 1.7

version 1.3, 2001/07/09 16:13:17 version 1.7, 2001/09/21 14:46:09
Line 4 Line 4
         Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com)          Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com)
   
         Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf)          Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf)
   
         $Id$  
 */  */
 static const char *RCSId="$Id$";   static const char *RCSId="$Id$"; 
   
Line 71  static void _set(Request& r, const Strin Line 69  static void _set(Request& r, const Strin
         vdate->set_time(time);          vdate->set_time(time);
 }  }
   
 static void _string(Request& r, const String& method_name, MethodParams *) {  static void _sql_string(Request& r, const String& method_name, MethodParams *) {
         Pool& pool=r.pool();          Pool& pool=r.pool();
         VDate *vdate=static_cast<VDate *>(r.self);          VDate *vdate=static_cast<VDate *>(r.self);
         int size=1+ 4+1+2+1+2 +1+ 2+1+2+1+2 +1 +1;          int size=1+ 4+1+2+1+2 +1+ 2+1+2+1+2 +1 +1;
         char *buf=(char *)pool.malloc(size);          char *buf=(char *)pool.malloc(size);
         time_t time=vdate->get_time();          time_t time=vdate->get_time();
         size=strftime(buf, size, "'%Y-%m-%d %H:%M:%S'", gmtime(&time));          size=strftime(buf, size, "%Y-%m-%d %H:%M:%S", gmtime(&time));
                   
         Value& result=*new(pool) VString(*new(pool) String(pool, buf, size));          String& string=*new(pool) String(pool);
           string.APPEND_CLEAN(buf, size, 
                   method_name.origin().file, 
                   method_name.origin().line);
           Value& result=*new(pool) VString(string);
         r.write_assign_lang(result);          r.write_assign_lang(result);
 }  }
   
Line 132  MDate::MDate(Pool& apool) : Methoded(apo Line 134  MDate::MDate(Pool& apool) : Methoded(apo
         // ^set(float days)          // ^set(float days)
         add_native_method("set", Method::CT_DYNAMIC, _set, 1, 6);          add_native_method("set", Method::CT_DYNAMIC, _set, 1, 6);
   
         // ^string[]          // ^sql-string[]
         add_native_method("string", Method::CT_DYNAMIC, _string, 0, 0);          add_native_method("sql-string", Method::CT_DYNAMIC, _sql_string, 0, 0);
   
         // ^roll(year|month|day;+/- 1)          // ^roll(year|month|day;+/- 1)
         add_native_method("roll", Method::CT_DYNAMIC, _roll, 2, 2);          add_native_method("roll", Method::CT_DYNAMIC, _roll, 2, 2);

Removed from v.1.3  
changed lines
  Added in v.1.7


E-mail: