|
|
| version 1.60, 2007/02/03 18:08:38 | version 1.63, 2010/10/21 15:06:27 |
|---|---|
| Line 1 | Line 1 |
| /** @file | /** @file |
| Parser: @b double parser class. | Parser: @b double parser class. |
| Copyright (c) 2001-2005 ArtLebedev Group (http://www.artlebedev.com) | Copyright (c) 2001-2009 ArtLebedev Group (http://www.artlebedev.com) |
| Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru) | Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru) |
| */ | */ |
| Line 24 void _string_format(Request& r, MethodPa | Line 24 void _string_format(Request& r, MethodPa |
| class MDouble: public Methoded { | class MDouble: public Methoded { |
| public: | public: |
| MDouble(); | MDouble(); |
| public: // Methoded | |
| bool used_directly() { return true; } | |
| }; | }; |
| // global variable | // global variable |
| Line 58 static void _bool(Request& r, MethodPara | Line 56 static void _bool(Request& r, MethodPara |
| params.as_double(0, "default must be bool", r); | params.as_double(0, "default must be bool", r); |
| VDouble& vdouble=GET_SELF(r, VDouble); | VDouble& vdouble=GET_SELF(r, VDouble); |
| r.write_no_lang(*new VBool(vdouble.as_bool())); | r.write_no_lang(VBool::get(vdouble.as_bool())); |
| } | } |
| typedef void (*vdouble_op_func_ptr)(VDouble& vdouble, double param); | typedef void (*vdouble_op_func_ptr)(VDouble& vdouble, double param); |
| Line 98 static void _sql(Request& r, MethodParam | Line 96 static void _sql(Request& r, MethodParam |
| if(default_code) | if(default_code) |
| val=r.process_to_value(*default_code).as_double(); | val=r.process_to_value(*default_code).as_double(); |
| else { | else { |
| throw Exception("parser.runtime", | throw Exception(PARSER_RUNTIME, |
| 0, | 0, |
| "produced no result, but no default option specified"); | "produced no result, but no default option specified"); |
| } | } |