|
|
| version 1.35, 2005/08/09 08:14:48 | version 1.37, 2007/02/03 18:08:38 |
|---|---|
| Line 14 static const char * const IDENT_VOID_C=" | Line 14 static const char * const IDENT_VOID_C=" |
| #include "pa_vint.h" | #include "pa_vint.h" |
| #include "pa_vdouble.h" | #include "pa_vdouble.h" |
| #include "pa_vvoid.h" | #include "pa_vvoid.h" |
| #include "pa_vbool.h" | |
| #include "pa_sql_connection.h" | #include "pa_sql_connection.h" |
| // externs | // externs |
| Line 59 static void _double(Request& r, MethodPa | Line 60 static void _double(Request& r, MethodPa |
| params.count()==0?vvoid.as_double():params.as_double(0, "default must be double", r))); | params.count()==0?vvoid.as_double():params.as_double(0, "default must be double", r))); |
| } | } |
| static void _bool(Request& r, MethodParams& params) { | |
| VVoid& vvoid=GET_SELF(r, VVoid); | |
| r.write_no_lang(*new VBool( | |
| params.count()==0?vvoid.as_bool():params.as_bool(0, "default must be bool", r))); | |
| } | |
| #ifndef DOXYGEN | #ifndef DOXYGEN |
| class Void_sql_event_handlers: public SQL_Driver_query_event_handlers { | class Void_sql_event_handlers: public SQL_Driver_query_event_handlers { |
| const String& statement_string; | const String& statement_string; |
| Line 87 static void _sql(Request& r, MethodParam | Line 94 static void _sql(Request& r, MethodParam |
| HashStringValue* bind=0; | HashStringValue* bind=0; |
| if(params.count()>1) { | if(params.count()>1) { |
| Value& voptions=params.as_no_junction(1, "options must be hash, not code"); | Value& voptions=params.as_no_junction(1, "options must be hash, not code"); |
| if(!voptions.is_string()) | if(voptions.is_defined() && !voptions.is_string()) |
| if(HashStringValue* options=voptions.get_hash()) { | if(HashStringValue* options=voptions.get_hash()) { |
| int valid_options=0; | int valid_options=0; |
| if(Value* vbind=options->get(sql_bind_name)) { | if(Value* vbind=options->get(sql_bind_name)) { |
| Line 170 MVoid::MVoid(): Methoded("void") { | Line 177 MVoid::MVoid(): Methoded("void") { |
| // ^void.double(default) | // ^void.double(default) |
| add_native_method("double", Method::CT_DYNAMIC, _double, 0, 1); | add_native_method("double", Method::CT_DYNAMIC, _double, 0, 1); |
| // ^void.bool[] | |
| // ^void.bool(default) | |
| add_native_method("bool", Method::CT_DYNAMIC, _bool, 0, 1); | |
| // ^sql[query] | // ^sql[query] |
| add_native_method("sql", Method::CT_STATIC, _sql, 1, 2); | add_native_method("sql", Method::CT_STATIC, _sql, 1, 2); |