--- parser3/src/classes/double.C 2001/03/12 21:54:18 1.12 +++ parser3/src/classes/double.C 2001/03/12 22:21:01 1.13 @@ -3,13 +3,14 @@ Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) Author: Alexander Petrosyan (http://design.ru/paf) - $Id: double.C,v 1.12 2001/03/12 21:54:18 paf Exp $ + $Id: double.C,v 1.13 2001/03/12 22:21:01 paf Exp $ */ #include "pa_request.h" #include "_double.h" #include "pa_vdouble.h" #include "pa_vint.h" +#include "_string.h" // global var @@ -41,21 +42,6 @@ static void _inc(Request& r, const Strin vdouble->inc(increment); } -static void _format(Request& r, const String& method_name, Array *params) { - Pool& pool=r.pool(); - - Value& fmt=*static_cast(params->get(0)); - // forcing ^format[this param type] - r.fail_if_junction_(true, fmt, - method_name, "fmt must not be junction"); - - char *buf=format(pool, r.self->get_double(), fmt.as_string().cstr()); - - String *string=new(pool) String(pool); - r.wcontext->write(string->APPEND_CONST(buf), - String::Untaint_lang::NO /*always object, not string*/); -} - void initialize_double_class(Pool& pool, VClass& vclass) { // ^double.int[] vclass.add_native_method("int", _int, 0, 0); @@ -67,6 +53,6 @@ void initialize_double_class(Pool& pool, // ^double.inc[offset] vclass.add_native_method("inc", _inc, 0, 1); - // ^string.format[] - vclass.add_native_method("format", _format, 1, 1); + // ^double.format[] + vclass.add_native_method("format", _string_format, 1, 1); }