--- parser3/src/classes/void.C 2002/04/18 10:51:00 1.19 +++ parser3/src/classes/void.C 2002/08/20 08:19:00 1.23 @@ -3,10 +3,10 @@ Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) - - $Id: void.C,v 1.19 2002/04/18 10:51:00 paf Exp $ */ +static const char* IDENT_VOID_C="$Date: 2002/08/20 08:19:00 $"; + #include "classes.h" #include "pa_request.h" #include "pa_vint.h" @@ -25,6 +25,11 @@ public: // Methoded // methods +static void _length(Request& r, const String&, MethodParams *params) { + Pool& pool=r.pool(); + r.write_no_lang(*new(pool) VInt(pool, 0)); +} + static void _int(Request& r, const String&, MethodParams *params) { Pool& pool=r.pool(); VVoid *vvoid=static_cast(r.self); @@ -70,21 +75,18 @@ static void _sql(Request& r, const Strin const char *statement_cstr= statement_string.cstr(String::UL_UNSPECIFIED, r.connection(&method_name)); Void_sql_event_handlers handlers(pool, statement_string); - try { - r.connection(&method_name)->query( - statement_cstr, 0, 0, - handlers); - } catch(const Exception& e) { - // more specific source [were url] - throw Exception("sql.execute", - &statement_string, - "%s", e.comment()); - } + r.connection(&method_name)->query( + statement_cstr, 0, 0, + handlers, + statement_string); } // constructor MVoid::MVoid(Pool& apool) : Methoded(apool, "void") { + // ^void.length[] + add_native_method("length", Method::CT_DYNAMIC, _length, 0, 0); + // ^void.int[] // ^void.int(default) add_native_method("int", Method::CT_DYNAMIC, _int, 0, 1);