--- parser3/src/classes/int.C 2001/04/27 16:48:20 1.19.4.2 +++ parser3/src/classes/int.C 2001/05/08 06:07:47 1.24 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: int.C,v 1.19.4.2 2001/04/27 16:48:20 paf Exp $ + $Id: int.C,v 1.24 2001/05/08 06:07:47 paf Exp $ */ #include "classes.h" @@ -26,23 +26,26 @@ void _string_format(Request& r, const St class MInt : public Methoded { public: MInt(Pool& pool); +public: // Methoded bool used_directly() { return false; } }; // methods -static void _int(Request& r, const String&, MethodParams *) { +static void _int(Request& r, const String& method_name, MethodParams *) { Pool& pool=r.pool(); VInt *vint=static_cast(r.self); - Value& value=*new(pool) VInt(pool, vint->get_int()); - r.write_no_lang(value); + Value& result=*new(pool) VInt(pool, vint->get_int()); + result.set_name(method_name); + r.write_no_lang(result); } -static void _double(Request& r, const String&, MethodParams *) { +static void _double(Request& r, const String& method_name, MethodParams *) { Pool& pool=r.pool(); VInt *vint=static_cast(r.self); - Value& value=*new(pool) VDouble(pool, vint->as_double()); - r.write_no_lang(value); + Value& result=*new(pool) VDouble(pool, vint->as_double()); + result.set_name(method_name); + r.write_no_lang(result); } typedef void (*vint_op_func_ptr)(VInt& vint, double param); @@ -72,8 +75,8 @@ static void _mod(Request& r, const Strin // constructor -MInt::MInt(Pool& pool) : Methoded(pool) { - set_name(new(pool) String(pool, INT_CLASS_NAME)); +MInt::MInt(Pool& apool) : Methoded(apool) { + set_name(*NEW String(pool(), INT_CLASS_NAME)); // ^int.int[] @@ -105,6 +108,6 @@ Methoded *int_class; // creator -Methoded *MTable_create(Pool& pool) { +Methoded *MInt_create(Pool& pool) { return int_class=new(pool) MInt(pool); }