|
|
| version 1.65, 2012/04/19 19:41:29 | 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 104 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[] |