--- parser3/src/classes/op.C 2005/08/26 11:08:30 1.152.4.2 +++ parser3/src/classes/op.C 2005/11/18 11:44:04 1.152.4.4 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_OP_C="$Date: 2005/08/26 11:08:30 $"; +static const char * const IDENT_OP_C="$Date: 2005/11/18 11:44:04 $"; #include "classes.h" #include "pa_vmethod_frame.h" @@ -379,7 +379,7 @@ static void _case(Request& r, MethodPara for(int i=0; i_default=&code; break; } @@ -608,6 +608,18 @@ static const String& as_file_spec(Reques return r.absolute(params.as_string(index, "filespec must be string")); } static void _cache(Request& r, MethodParams& params) { + if(params.count()==0) + { + // return current expiration time + Cache_scope* scope=static_cast(r.classes_conf.get(cache_data_name)); + if(!scope) + throw Exception("parser.runtime", + 0, + "expire-time get without cache"); + r.write_no_lang(*new VDate(scope->expires)); + return; + } + time_t now=time(0); // ^cache[filename] ^cache(seconds) ^cache[expires date] @@ -811,7 +823,8 @@ VClassMAIN::VClassMAIN(): VClass() { // ^cache[file_spec](time){code}[{catch code}] time=0 no cache // ^cache[file_spec] delete cache - add_native_method("cache", Method::CT_ANY, _cache, 1, 4); + // ^cache[] get current expiration time + add_native_method("cache", Method::CT_ANY, _cache, 0, 4); // switch