--- parser3/src/classes/table.C 2019/11/23 23:48:41 1.349 +++ parser3/src/classes/table.C 2020/12/17 19:51:21 1.355 @@ -1,10 +1,18 @@ /** @file 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 (http://paf.design.ru) */ +#include "pa_config_includes.h" + +#if (!defined(NO_STRINGSTREAM) && !defined(FREEBSD4) && !defined(PA_DEBUG_DISABLE_GC)) +#include +#include "../lib/gc/include/gc_allocator.h" +#define USE_STRINGSTREAM +#endif + #include "classes.h" #include "pa_vmethod_frame.h" @@ -17,12 +25,7 @@ #include "pa_vbool.h" #include "pa_array.h" -#if (!defined(NO_STRINGSTREAM) && !defined(FREEBSD4) && !defined(PA_DEBUG_DISABLE_GC)) -#include -#define USE_STRINGSTREAM -#endif - -volatile const char * IDENT_TABLE_C="$Id: table.C,v 1.349 2019/11/23 23:48:41 moko Exp $"; +volatile const char * IDENT_TABLE_C="$Id: table.C,v 1.355 2020/12/17 19:51:21 moko Exp $"; // class @@ -410,7 +413,7 @@ static void _load(Request& r, MethodPara control_chars.load(*options); // loading text - char *data=file_load_text(r, r.absolute(params.as_string(filename_param_index, FILE_NAME_MUST_BE_STRING)), true, options); + char *data=file_load_text(r, r.full_disk_path(params.as_string(filename_param_index, FILE_NAME_MUST_BE_STRING)), true, options); Skip_lines_action skip_lines_action = (control_chars.separator=='#' || control_chars.encloser=='#') ? skip_empty_lines : skip_empty_and_comment_lines; @@ -454,7 +457,6 @@ static void _load(Request& r, MethodPara } #ifdef USE_STRINGSTREAM -#include "../lib/gc/include/gc_allocator.h" typedef std::basic_stringstream, gc_allocator > pa_stringstream; typedef std::basic_string, gc_allocator > pa_string; @@ -633,7 +635,7 @@ static void _save(Request& r, MethodPara --param_index; const String& file_name=params.as_string(param_index++, FILE_NAME_MUST_NOT_BE_CODE); - String file_spec=r.absolute(file_name); + String file_spec=r.full_disk_path(file_name); if(do_append && file_exist(file_spec)) output_column_names=false; @@ -1257,18 +1259,18 @@ static void join_nameless_row(Table& src *dest+=src[src.current()]; } static void _join(Request& r, MethodParams& params) { - Table& src=*params.as_table(0, "source"); - - Table::Action_options o=get_action_options(r, params, 1, src); + if(Table* src=params.as_table(0, "source")){ + Table::Action_options o=get_action_options(r, params, 1, *src); - Table& dest=GET_SELF(r, VTable).table(); - if(&src == &dest) - throw Exception(PARSER_RUNTIME, 0, "source and destination are same table"); - - if(dest.columns()) // dest is named - src.table_for_each(join_named_row, &dest, o); - else // dest is nameless - src.table_for_each(join_nameless_row, &dest, o); + Table& dest=GET_SELF(r, VTable).table(); + if(src == &dest) + throw Exception(PARSER_RUNTIME, 0, "source and destination are same table"); + + if(dest.columns()) // dest is named + src->table_for_each(join_named_row, &dest, o); + else // dest is nameless + src->table_for_each(join_nameless_row, &dest, o); + } } #ifndef DOXYGEN