|
|
| version 1.261, 2009/07/06 12:13:30 | version 1.265, 2009/08/31 08:28:53 |
|---|---|
| Line 17 using namespace std; | Line 17 using namespace std; |
| #include "pa_common.h" | #include "pa_common.h" |
| #include "pa_request.h" | #include "pa_request.h" |
| #include "pa_charsets.h" | |
| #include "pa_vtable.h" | #include "pa_vtable.h" |
| #include "pa_vint.h" | #include "pa_vint.h" |
| #include "pa_sql_connection.h" | #include "pa_sql_connection.h" |
| Line 26 using namespace std; | Line 27 using namespace std; |
| class MTable: public Methoded { | class MTable: public Methoded { |
| public: // VStateless_class | public: // VStateless_class |
| Value* create_new_value(Pool&, HashStringValue*) { return new VTable(); } | Value* create_new_value(Pool&) { return new VTable(); } |
| public: | public: |
| MTable(); | MTable(); |
| Line 39 public: // Methoded | Line 40 public: // Methoded |
| DECLARE_CLASS_VAR(table, new MTable, 0); | DECLARE_CLASS_VAR(table, new MTable, 0); |
| // externs | |
| extern String cycle_data_name; | |
| #define TABLE_REVERSE_NAME "reverse" | #define TABLE_REVERSE_NAME "reverse" |
| // globals | // globals |
| Line 611 static void _offset(Request& r, MethodPa | Line 608 static void _offset(Request& r, MethodPa |
| } | } |
| static void _menu(Request& r, MethodParams& params) { | static void _menu(Request& r, MethodParams& params) { |
| Temp_hash_value<const String::Body, void*> | InCycle temp(r); |
| cycle_data_setter(r.classes_conf, cycle_data_name, /*any not null flag*/&r); | |
| Value& body_code=params.as_junction(0, "body must be code"); | Value& body_code=params.as_junction(0, "body must be code"); |
| Line 916 static void _sort(Request& r, MethodPara | Line 912 static void _sort(Request& r, MethodPara |
| else | else |
| seq[i].value.d=value.as_double(); | seq[i].value.d=value.as_double(); |
| } | } |
| // sort keys | |
| // @todo: handle this elsewhere | |
| if(r.charsets.source().NAME()=="KOI8-R" && key_values_are_strings) { | |
| for(i=0; i<old_count; i++) | |
| if(*seq[i].value.c_str) | |
| seq[i].value.c_str=Charset::transcode(seq[i].value.c_str, r.charsets.source(), UTF8_charset).cstr(); | |
| } | |
| // sort keys | |
| _qsort(seq, old_count, sizeof(Table_seq_item), | _qsort(seq, old_count, sizeof(Table_seq_item), |
| key_values_are_strings?sort_cmp_string:sort_cmp_double); | key_values_are_strings?sort_cmp_string:sort_cmp_double); |
| Line 1164 static void _sql(Request& r, MethodParam | Line 1168 static void _sql(Request& r, MethodParam |
| Temp_lang temp_lang(r, String::L_SQL); | Temp_lang temp_lang(r, String::L_SQL); |
| const String& statement_string=r.process_to_string(statement); | const String& statement_string=r.process_to_string(statement); |
| const char* statement_cstr=statement_string.untaint_cstr(String::L_AS_IS, r.connection()); | const char* statement_cstr=statement_string.untaint_cstr(r.flang, r.connection()); |
| Table_sql_event_handlers handlers; | Table_sql_event_handlers handlers; |
| #ifdef RESOURCES_DEBUG | #ifdef RESOURCES_DEBUG |