|
|
| version 1.64, 2012/03/16 09:24:06 | version 1.67, 2013/07/29 15:02:17 |
|---|---|
| Line 32 DECLARE_CLASS_VAR(double, new MDouble, 0 | Line 32 DECLARE_CLASS_VAR(double, new MDouble, 0 |
| // methods | // methods |
| static void _int(Request& r, MethodParams& params) { | static void _int(Request& r, MethodParams&) { |
| // just checking (default) syntax validity, never really using it here, just for string.int compatibility | |
| if(params.count()>0) | |
| params.as_int(0, "default must be int", r); | |
| VDouble& vdouble=GET_SELF(r, VDouble); | VDouble& vdouble=GET_SELF(r, VDouble); |
| r.write_no_lang(*new VInt(vdouble.as_int())); | r.write_no_lang(*new VInt(vdouble.as_int())); |
| } | } |
| static void _double(Request& r, MethodParams& params) { | static void _double(Request& r, MethodParams&) { |
| // just checking (default) syntax validity, never really using it here, just for string.double compatibility | |
| if(params.count()>0) | |
| params.as_double(0, "default must be double", r); | |
| VDouble& vdouble=GET_SELF(r, VDouble); | VDouble& vdouble=GET_SELF(r, VDouble); |
| r.write_no_lang(*new VDouble(vdouble.as_double())); | r.write_no_lang(*new VDouble(vdouble.as_double())); |
| } | } |
| static void _bool(Request& r, MethodParams& params) { | static void _bool(Request& r, MethodParams&) { |
| // just checking (default) syntax validity, never really using it here, just for string.bool compatibility | |
| if(params.count()>0) | |
| 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(VBool::get(vdouble.as_bool())); | r.write_no_lang(VBool::get(vdouble.as_bool())); |
| } | } |
| Line 82 static void _div(Request& r, MethodParam | Line 70 static void _div(Request& r, MethodParam |
| static void _mod(Request& r, MethodParams& params) { vdouble_op(r, params, &__mod); } | static void _mod(Request& r, MethodParams& params) { vdouble_op(r, params, &__mod); } |
| // from string.C | // from string.C |
| extern | extern const String* sql_result_string(Request& r, MethodParams& params, Value*& default_code); |
| const String* sql_result_string(Request& r, MethodParams& params, | |
| HashStringValue*& options, Value*& default_code); | |
| static void _sql(Request& r, MethodParams& params) { | static void _sql(Request& r, MethodParams& params) { |
| double val; | double val; |
| HashStringValue* options; | |
| Value* default_code; | Value* default_code; |
| if(const String* string=sql_result_string(r, params, options, default_code)) | if(const String* string=sql_result_string(r, params, default_code)) |
| val=string->as_double(); | val=string->as_double(); |
| else | else |
| if(default_code) | if(default_code) |
| Line 107 static void _sql(Request& r, MethodParam | Line 92 static void _sql(Request& r, MethodParam |
| MDouble::MDouble(): Methoded("double") { | MDouble::MDouble(): Methoded("double") { |
| // ^double.int[] | // ^double.int[] |
| // ^double.int[default for ^string.int compatibility] | |
| add_native_method("int", Method::CT_DYNAMIC, _int, 0, 1); | add_native_method("int", Method::CT_DYNAMIC, _int, 0, 1); |
| // ^double.double[] | // ^double.double[] |
| // ^double.double[default for ^string.double compatibility] | |
| add_native_method("double", Method::CT_DYNAMIC, _double, 0, 1); | add_native_method("double", Method::CT_DYNAMIC, _double, 0, 1); |
| // ^double.bool[] | // ^double.bool[] |
| // ^double.bool[default for ^string.bool compatibility] | |
| add_native_method("bool", Method::CT_DYNAMIC, _bool, 0, 1); | add_native_method("bool", Method::CT_DYNAMIC, _bool, 0, 1); |
| // ^double.inc[] | // ^double.inc[] |