--- parser3/src/classes/date.C 2003/02/04 15:15:01 1.42.2.6 +++ parser3/src/classes/date.C 2003/02/17 12:13:43 1.42.2.8 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_DATE_C="$Date: 2003/02/04 15:15:01 $"; +static const char* IDENT_DATE_C="$Date: 2003/02/17 12:13:43 $"; #include "classes.h" #include "pa_vmethod_frame.h" @@ -33,10 +33,10 @@ MethodedPtr date_class(new MDate); // helpers -class Date_calendar_table_template_columns: public Array { +class Date_calendar_table_template_columns: public ArrayString { Pool pool; public: - Date_calendar_table_template_columns(): Array(6+2) { + Date_calendar_table_template_columns(): ArrayString(6+2) { for(int i=0; i<=6; i++) { char *cname=new(pool) char[1/*strlen("6")*/+1/*terminating 0*/]; StringPtr sname(new String(cname, sprintf(cname, "%d", i))); // .i column name @@ -160,7 +160,7 @@ static void _sql_string(Request& r, Stri Pool& pool=r.pool(); VDate& vdate=GET_SELF(r, VDate); int size=1+ 4+1+2+1+2 +1+ 2+1+2+1+2 +1 +1; - char *buf=(char *)pool.malloc(size); + char *buf=new(pool) char[size]; time_t time=vdate.get_time(); size=strftime(buf, size, "%Y-%m-%d %H:%M:%S", localtime(&time)); @@ -261,7 +261,7 @@ static TablePtr fill_month_days(Request& int monthDays=getMonthDays(year, month); for(int _day=1-weekDay1; _day<=monthDays;) { - Table::element_type row(new Array(7)); + Table::element_type row(new ArrayString(7)); // calculating year week no [1..54] char *weekno_buf; size_t weekno_size; @@ -287,7 +287,7 @@ static TablePtr fill_month_days(Request& // http://www.merlyn.demon.co.uk/weekinfo.htm const int FirstThurs[] = {7,5,4,3,2,7,6,5,4,2,1,7,6,4,3,2,1,6,5,4,3,1,7,6,5,3,2,1}; int n=1 + (tms.tm_yday-(FirstThurs[weekyear % 28]-3))/7; - weekno_buf=(char *)pool.malloc(weekno_buf_size); + weekno_buf=new(pool) char[weekno_buf_size]; weekno_size=snprintf(weekno_buf, weekno_buf_size, "%02d", n); } @@ -343,7 +343,7 @@ static TablePtr fill_week_days(Request& for(int curWeekDay=0; curWeekDay<7; curWeekDay++, t+=SECS_PER_DAY) { tm *tmOut=localtime(&t); - Table::element_type row(new Array(4)); + Table::element_type row(new ArrayString(4)); #define WDFILL(size, value) { \ char *buf=new(pool) char[size+1]; \ StringPtr cell(new String); \