|
|
| version 1.348, 2019/09/11 15:26:09 | version 1.352, 2020/12/14 20:58:15 |
|---|---|
| Line 5 | Line 5 |
| 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" | |
| #define NO_STRINGSTREAM | |
| #if (!defined(NO_STRINGSTREAM) && !defined(FREEBSD4) && !defined(PA_DEBUG_DISABLE_GC)) | |
| #include <sstream> | |
| #include "../lib/gc/include/gc_allocator.h" | |
| #define USE_STRINGSTREAM | |
| #endif | |
| #include "classes.h" | #include "classes.h" |
| #include "pa_vmethod_frame.h" | #include "pa_vmethod_frame.h" |
| Line 17 | Line 27 |
| #include "pa_vbool.h" | #include "pa_vbool.h" |
| #include "pa_array.h" | #include "pa_array.h" |
| #if (!defined(NO_STRINGSTREAM) && !defined(FREEBSD4) && !defined(PA_DEBUG_DISABLE_GC)) | |
| #include <sstream> | |
| #define USE_STRINGSTREAM | |
| #endif | |
| volatile const char * IDENT_TABLE_C="$Id$"; | volatile const char * IDENT_TABLE_C="$Id$"; |
| // class | // class |
| Line 406 static void _load(Request& r, MethodPara | Line 411 static void _load(Request& r, MethodPara |
| HashStringValue *options=0; | HashStringValue *options=0; |
| TableControlChars control_chars; | TableControlChars control_chars; |
| if(options_param_index<params.count() | if(options_param_index<params.count() && (options=params.as_hash(options_param_index))) |
| && (options=params.as_hash(options_param_index))) { | |
| // cloning, so that we could change [to simplify checks on params inside file_read_text | |
| options=new HashStringValue(*options); | |
| control_chars.load(*options); | control_chars.load(*options); |
| } | |
| // loading text | // 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; | Skip_lines_action skip_lines_action = (control_chars.separator=='#' || control_chars.encloser=='#') ? skip_empty_lines : skip_empty_and_comment_lines; |
| Line 458 static void _load(Request& r, MethodPara | Line 459 static void _load(Request& r, MethodPara |
| } | } |
| #ifdef USE_STRINGSTREAM | #ifdef USE_STRINGSTREAM |
| #include "../lib/gc/include/gc_allocator.h" | |
| typedef std::basic_stringstream<char, std::char_traits<char>, gc_allocator<char> > pa_stringstream; | typedef std::basic_stringstream<char, std::char_traits<char>, gc_allocator<char> > pa_stringstream; |
| typedef std::basic_string<char, std::char_traits<char>, gc_allocator<char> > pa_string; | typedef std::basic_string<char, std::char_traits<char>, gc_allocator<char> > pa_string; |
| Line 637 static void _save(Request& r, MethodPara | Line 637 static void _save(Request& r, MethodPara |
| --param_index; | --param_index; |
| const String& file_name=params.as_string(param_index++, FILE_NAME_MUST_NOT_BE_CODE); | 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)) | if(do_append && file_exist(file_spec)) |
| output_column_names=false; | output_column_names=false; |