|
|
| version 1.1.2.1, 2004/03/25 14:46:19 | version 1.10, 2016/12/21 21:14:43 |
|---|---|
| Line 1 | Line 1 |
| /** @file | /** @file |
| Parser: Stylesheet connection implementation. | Parser: Stylesheet connection implementation. |
| Copyright (c) 2001-2004 ArtLebedev Group (http://www.artlebedev.com) | Copyright (c) 2001-2015 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" |
| #ifdef XML | #ifdef XML |
| static const char * const IDENT_STYLESHEET_CONNECTION_C="$Date$"; | |
| #include "pa_stylesheet_connection.h" | #include "pa_stylesheet_connection.h" |
| #include "pa_xml_exception.h" | #include "pa_xml_exception.h" |
| volatile const char * IDENT_PA_STYLESHEET_CONNECTION_C="$Id$" IDENT_PA_STYLESHEET_CONNECTION_H; | |
| void Stylesheet_connection::load(time_t new_disk_time) { | void Stylesheet_connection::load(time_t new_disk_time) { |
| xsltStylesheet *nstylesheet; | xsltStylesheet *nstylesheet; |
| { | { |
| Line 24 void Stylesheet_connection::load(time_t | Line 25 void Stylesheet_connection::load(time_t |
| } | } |
| dependencies=pa_xmlGetDependencies(); | dependencies=pa_xmlGetDependencies(); |
| } | } |
| if(xmlHaveGenericErrors()) { | if(xmlHaveGenericErrors()) |
| GdomeException exc=0; | throw XmlException(new String(ffile_spec, String::L_TAINTED), pa_thread_request()); |
| throw XmlException(new String(ffile_spec, String::L_TAINTED), exc); | |
| } | |
| if(!nstylesheet) | if(!nstylesheet) |
| throw Exception("file.missing", | throw Exception("file.missing", |
| new String(ffile_spec, String::L_TAINTED), | new String(ffile_spec, String::L_TAINTED), |
| Line 38 void Stylesheet_connection::load(time_t | Line 37 void Stylesheet_connection::load(time_t |
| prev_disk_time=new_disk_time; | prev_disk_time=new_disk_time; |
| } | } |
| static void update_max_mtime(const String::Body stat_file_spec_cstr, bool /*value*/, time_t* max) { | static void update_max_mtime(HashStringValue::key_type stat_file_spec_cstr, bool /*value*/, time_t* max) { |
| size_t size; | uint64_t size; |
| time_t atime, mtime, ctime; | time_t atime, mtime, ctime; |
| file_stat(*new String(stat_file_spec_cstr, String::L_AS_IS), | file_stat(*new String(stat_file_spec_cstr, String::L_AS_IS), size, atime, mtime, ctime, true/*exception on error*/); |
| size, | |
| atime, mtime, ctime, | |
| true/*exception on error*/); | |
| if(mtime>*max) | if(mtime>*max) |
| *max=mtime; | *max=mtime; |
| Line 54 time_t Stylesheet_connection::get_disk_t | Line 50 time_t Stylesheet_connection::get_disk_t |
| assert(dependencies); | assert(dependencies); |
| time_t result=0; | time_t result=0; |
| dependencies->for_each(update_max_mtime, &result); | dependencies->for_each<time_t*>(update_max_mtime, &result); |
| return result; | return result; |
| } | } |