--- parser3/src/include/pa_request.h 2001/09/24 14:34:25 1.97 +++ parser3/src/include/pa_request.h 2001/10/22 08:27:44 1.105 @@ -2,10 +2,9 @@ Parser: request class decl. Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) - Author: Alexander Petrosyan (http://design.ru/paf) - $Id: pa_request.h,v 1.97 2001/09/24 14:34:25 parser Exp $ + $Id: pa_request.h,v 1.105 2001/10/22 08:27:44 parser Exp $ */ #ifndef PA_REQUEST_H @@ -141,6 +140,9 @@ public: /// returns the mime type of 'user_file_name_cstr' const String& mime_type_of(const char *user_file_name_cstr); + /// PCRE character tables + const unsigned char *pcre_tables(); + public: /// info from web server @@ -173,13 +175,10 @@ public: /// connection SQL_Connection *connection; - /// PCRE character tables - unsigned char *pcre_tables; /// classes configured data Hash classes_conf; - private: // core data /// classes @@ -196,6 +195,12 @@ private: // core data */ uint anti_endless_execute_recoursion; + /// charset->pcre_tables + Hash CTYPE; + + /// stack trace + Stack trace; + private: // compile.C VStateless_class& real_compile(COMPILE_PARAMS); @@ -279,12 +284,16 @@ public: return get_as(index, false, msg); } /// handy expression auto-processing to double - double as_double(int index, Request& r) { - return get_processed(index, r).as_double(); + double as_double(int index, const char *msg, Request& r) { + return get_processed(index, msg, r).as_double(); } /// handy expression auto-processing to int - int as_int(int index, Request& r) { - return get_processed(index, r).as_int(); + int as_int(int index, const char *msg, Request& r) { + return get_processed(index, msg, r).as_int(); + } + /// handy expression auto-processing to bool + bool as_bool(int index, const char *msg, Request& r) { + return get_processed(index, msg, r).as_bool(); } /// handy string ensurer const String& as_string(int index, const char *msg) { @@ -297,14 +306,15 @@ private: Value& get_as(int index, bool as_junction, const char *msg) { Value& result=get(index); if((result.get_junction()!=0) ^ as_junction) - THROW(0, 0, + throw Exception(0, 0, &fmethod_name, "%s (parameter #%d)", msg, 1+index); + return result; } - Value& get_processed(int index, Request& r) { - return r.process(get(index), + Value& get_processed(int index, const char *msg, Request& r) { + return r.process(as_junction(index, msg), 0/*no name*/, false/*don't intercept string*/); }