|
|
| version 1.17.4.1, 2004/04/08 08:47:03 | version 1.21, 2008/06/04 09:18:08 |
|---|---|
| Line 1 | Line 1 |
| /** @file | /** @file |
| Parser: plugins to xml library, controlling i/o; implementation | Parser: plugins to xml library, controlling i/o; implementation |
| Copyright (c) 2001-2004 ArtLebedev Group (http://www.artlebedev.com) | Copyright (c) 2001-2005 ArtLebedev Group (http://www.artlebedev.com) |
| Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru) | Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru) |
| */ | */ |
| Line 105 xmlFileOpen_ReadIntoStream (const char* | Line 105 xmlFileOpen_ReadIntoStream (const char* |
| strcat(adjust_buf, &do_not_store_filename[16]); | strcat(adjust_buf, &do_not_store_filename[16]); |
| do_not_store_filename=adjust_buf; | do_not_store_filename=adjust_buf; |
| } else | } else |
| if(strstr(do_not_store_filename, "file://")) | if(!strstr(do_not_store_filename, "http://")) |
| do_not_store_filename+=7/*strlen("file://")*/; | if(strstr(do_not_store_filename, "file://")) |
| else if(*do_not_store_filename && do_not_store_filename[1]!=':' && strstr(do_not_store_filename, "://")) { | do_not_store_filename+=7/*strlen("file://")*/; |
| pa_xmlStopMonitoringDependencies(); | else if(*do_not_store_filename && do_not_store_filename[1]!=':' && strstr(do_not_store_filename, "://")) { |
| return 0; // plug out [do not handle other prefixes] | pa_xmlStopMonitoringDependencies(); |
| } | return 0; // plug out [do not handle other prefixes] |
| } | |
| const char* can_store_filename=pa_strdup(do_not_store_filename); | const char* can_store_filename=pa_strdup(do_not_store_filename); |
| add_dependency(can_store_filename); | add_dependency(can_store_filename); |
| const char *buf; | const char *buf; |
| try { | try { |
| buf=file_read_text(r.charsets, *new String(can_store_filename)); | //buf=file_read_text(r.charsets, *new String(can_store_filename)); |
| // load external file in binary mode: libxml cat transcode it itself and we don't need to change @encding in xml declaration | |
| File_read_result file=file_read(r.charsets, *new String(can_store_filename), false/* not text */); | |
| buf=file.success?file.str:0; | |
| } catch(const Exception& e) { | } catch(const Exception& e) { |
| if(strcmp(e.type(), "file.missing")==0) | if(strcmp(e.type(), "file.missing")==0) |
| return 0; // let the library try that and report an error properly | return 0; // let the library try that and report an error properly |