|
|
| version 1.36, 2002/08/08 14:35:30 | version 1.38, 2002/09/23 09:34:00 |
|---|---|
| Line 29 public: // Methoded | Line 29 public: // Methoded |
| static void _now(Request& r, const String& method_name, MethodParams *params) { | static void _now(Request& r, const String& method_name, MethodParams *params) { |
| Pool& pool=r.pool(); | Pool& pool=r.pool(); |
| VDate *vdate=static_cast<VDate *>(r.self); | VDate *vdate=static_cast<VDate *>(r.get_self()); |
| time_t t=time(0); | time_t t=time(0); |
| if(params->size()==1) // ^now(offset) | if(params->size()==1) // ^now(offset) |
| Line 49 static int NN_year_to_NNNN(int year) { | Line 49 static int NN_year_to_NNNN(int year) { |
| /// @test 09 ok? [octal maybe] | /// @test 09 ok? [octal maybe] |
| static void _create(Request& r, const String& method_name, MethodParams *params) { | static void _create(Request& r, const String& method_name, MethodParams *params) { |
| Pool& pool=r.pool(); | Pool& pool=r.pool(); |
| VDate *vdate=static_cast<VDate *>(r.self); | VDate *vdate=static_cast<VDate *>(r.get_self()); |
| time_t t; | time_t t; |
| if(params->size()==1) { | if(params->size()==1) { |
| Line 93 date_part_set: | Line 93 date_part_set: |
| sdate, | sdate, |
| "invalid datetime"); | "invalid datetime"); |
| } else { // ^create(float days) | } else { // ^create(float days) |
| t=(time_t)(params->as_double(0, "float days must be double", r)*SECS_PER_DAY); | t=(time_t)round(params->as_double(0, "float days must be double", r)*SECS_PER_DAY); |
| if(t<0 || !localtime(&t)) | if(t<0 || !localtime(&t)) |
| throw Exception(0, | throw Exception(0, |
| &method_name, | &method_name, |
| Line 122 date_part_set: | Line 122 date_part_set: |
| static void _sql_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.get_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(); |
| Line 138 static void _sql_string(Request& r, cons | Line 138 static void _sql_string(Request& r, cons |
| static void _roll(Request& r, const String& method_name, MethodParams *params) { | static void _roll(Request& r, const String& method_name, MethodParams *params) { |
| Pool& pool=r.pool(); | Pool& pool=r.pool(); |
| VDate *vdate=static_cast<VDate *>(r.self); | VDate *vdate=static_cast<VDate *>(r.get_self()); |
| const String& what=params->as_string(0, "'what' must be string"); | const String& what=params->as_string(0, "'what' must be string"); |
| int oyear=0; | int oyear=0; |