--- parser3/src/classes/void.C 2002/04/10 09:53:14 1.18 +++ parser3/src/classes/void.C 2002/08/20 08:17:28 1.21.2.1 @@ -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.18 2002/04/10 09:53:14 paf Exp $ */ +static const char* IDENT_VOID_C="$Date: 2002/08/20 08:17:28 $"; + #include "classes.h" #include "pa_request.h" #include "pa_vint.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 { @@ -29,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); @@ -88,9 +89,9 @@ 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.length[] + add_native_method("length", Method::CT_DYNAMIC, _length, 0, 0); // ^void.int[] // ^void.int(default)