|
|
| version 1.352, 2020/12/14 20:58:15 | version 1.355, 2020/12/17 19:51:21 |
|---|---|
| Line 1 | Line 1 |
| /** @file | /** @file |
| Parser: @b table parser class. | Parser: @b table parser class. |
| Copyright (c) 2001-2017 Art. Lebedev Studio (http://www.artlebedev.com) | Copyright (c) 2001-2020 Art. Lebedev Studio (http://www.artlebedev.com) |
| Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru) | Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru) |
| */ | */ |
| #include "pa_config_includes.h" | #include "pa_config_includes.h" |
| #define NO_STRINGSTREAM | |
| #if (!defined(NO_STRINGSTREAM) && !defined(FREEBSD4) && !defined(PA_DEBUG_DISABLE_GC)) | #if (!defined(NO_STRINGSTREAM) && !defined(FREEBSD4) && !defined(PA_DEBUG_DISABLE_GC)) |
| #include <sstream> | #include <sstream> |
| #include "../lib/gc/include/gc_allocator.h" | #include "../lib/gc/include/gc_allocator.h" |
| Line 1261 static void join_nameless_row(Table& src | Line 1259 static void join_nameless_row(Table& src |
| *dest+=src[src.current()]; | *dest+=src[src.current()]; |
| } | } |
| static void _join(Request& r, MethodParams& params) { | static void _join(Request& r, MethodParams& params) { |
| Table& src=*params.as_table(0, "source"); | if(Table* src=params.as_table(0, "source")){ |
| Table::Action_options o=get_action_options(r, params, 1, *src); | |
| Table::Action_options o=get_action_options(r, params, 1, src); | |
| Table& dest=GET_SELF(r, VTable).table(); | Table& dest=GET_SELF(r, VTable).table(); |
| if(&src == &dest) | if(src == &dest) |
| throw Exception(PARSER_RUNTIME, 0, "source and destination are same table"); | throw Exception(PARSER_RUNTIME, 0, "source and destination are same table"); |
| if(dest.columns()) // dest is named | if(dest.columns()) // dest is named |
| src.table_for_each(join_named_row, &dest, o); | src->table_for_each(join_named_row, &dest, o); |
| else // dest is nameless | else // dest is nameless |
| src.table_for_each(join_nameless_row, &dest, o); | src->table_for_each(join_nameless_row, &dest, o); |
| } | |
| } | } |
| #ifndef DOXYGEN | #ifndef DOXYGEN |