--- parser3/src/classes/void.C 2002/02/08 08:30:10 1.16 +++ parser3/src/classes/void.C 2002/04/18 10:51:00 1.19 @@ -4,7 +4,7 @@ Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) - $Id: void.C,v 1.16 2002/02/08 08:30:10 paf Exp $ + $Id: void.C,v 1.19 2002/04/18 10:51:00 paf Exp $ */ #include "classes.h" @@ -14,10 +14,6 @@ #include "pa_vvoid.h" #include "pa_sql_connection.h" -// defines - -#define VOID_CLASS_NAME "void" - // class class MVoid : public Methoded { @@ -52,7 +48,7 @@ public: void add_column(void *ptr, size_t size) { /* ignore */ } void before_rows() { // there are some result rows, which is wrong - throw Exception(0, 0, + throw Exception("parser.runtime", &statement_string, "must return nothing"); } @@ -70,7 +66,7 @@ static void _sql(Request& r, const Strin Value& statement=params->as_junction(0, "statement must be code"); Temp_lang temp_lang(r, String::UL_SQL); - const String& statement_string=r.process(statement).as_string(); + const String& statement_string=r.process_to_string(statement); const char *statement_cstr= statement_string.cstr(String::UL_UNSPECIFIED, r.connection(&method_name)); Void_sql_event_handlers handlers(pool, statement_string); @@ -80,7 +76,7 @@ static void _sql(Request& r, const Strin handlers); } catch(const Exception& e) { // more specific source [were url] - throw Exception(e.type(), e.code(), + throw Exception("sql.execute", &statement_string, "%s", e.comment()); } @@ -88,10 +84,7 @@ static void _sql(Request& r, const Strin // constructor -MVoid::MVoid(Pool& apool) : Methoded(apool) { - set_name(*NEW String(pool(), VOID_CLASS_NAME)); - - +MVoid::MVoid(Pool& apool) : Methoded(apool, "void") { // ^void.int[] // ^void.int(default) add_native_method("int", Method::CT_DYNAMIC, _int, 0, 1);