--- parser3/src/include/pa_request.h 2017/01/17 23:53:28 1.246 +++ parser3/src/include/pa_request.h 2020/11/03 16:25:49 1.255 @@ -1,14 +1,14 @@ /** @file Parser: request class decl. - Copyright (c) 2001-2015 Art. Lebedev Studio (http://www.artlebedev.com) + Copyright (c) 2001-2017 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_REQUEST_H #define PA_REQUEST_H -#define IDENT_PA_REQUEST_H "$Id: pa_request.h,v 1.246 2017/01/17 23:53:28 moko Exp $" +#define IDENT_PA_REQUEST_H "$Id: pa_request.h,v 1.255 2020/11/03 16:25:49 moko Exp $" #include "pa_pool.h" #include "pa_hash.h" @@ -89,8 +89,6 @@ private: ArrayOperation& ops() const { return *fops; } VMethodFrame& method_frame() const { return *fmethod_frame; } - /// needed to fill unused Array entries - StackItem() {} StackItem(Value& avalue): fvalue(&avalue) {} StackItem(ArrayOperation& aops): fops(&aops) {} StackItem(VMethodFrame& amethod_frame): fmethod_frame(&amethod_frame) {} @@ -193,7 +191,7 @@ public: core request processing BEWARE: may throw exception to you: catch it! */ - void core(const char* config_filespec, bool config_fail_on_read_problem, bool header_only); + void core(const char* config_filespec, bool header_only); /// executes ops void execute(ArrayOperation& ops); // execute.C @@ -237,10 +235,10 @@ public: } /// - void use_file_directly(VStateless_class& aclass, const String& file_spec, bool fail_on_read_problem=true, bool fail_on_file_absence=true); + void use_file_directly(const String& file_spec, bool fail_on_file_absence=true, bool with_auto_p=false); - /// compiles the file, maybe forcing it's class @a name and @a base_class. - void use_file(VStateless_class& aclass, const String& file_name, const String* use_filespec); + /// compiles the file in main class context by default + void use_file(const String& file_name, const String* use_filespec, bool with_auto_p=false); /// for @USE only, calls ^use (which may be user-defined) void use_file(const String& file_name, const String* use_filespec, Operation::Origin origin); @@ -258,6 +256,7 @@ public: return process(input_value).as_string(); } //@} + const Operation::Origin get_method_origin(const Method* method); // execute.C const String* get_method_filespec(const Method* method); // execute.C const String* get_used_filespec(uint file_no); @@ -342,19 +341,12 @@ public: // status read methods /// public for ^reflection:copy[] void put_element(Value& ncontext, const String& name, Value* value); - /// for @main[] - const String* execute_virtual_method(Value& aself, const String& method_name); + /// for @main[] and parser://method/call + const String* execute_method(VStateless_class& aclass, const String& method_name, Value* optional_param = 0); - //{ for @conf[filespec] and @auto[filespec] and parser://method/call - const String* execute_method(Value& aself, const Method& method, Value* optional_param, bool do_return_string); + //{ for @conf[filespec] and @auto[filespec] + bool execute_method_if_exists(VStateless_class& aclass, const String& method_name, Value* optional_param); - struct Execute_nonvirtual_method_result { - const String* string; - Method* method; - Execute_nonvirtual_method_result(): string(0), method(0) {} - }; - - Execute_nonvirtual_method_result execute_nonvirtual_method(VStateless_class& aclass, const String& method_name, VString* optional_param, bool do_return_string); //} #ifdef XML @@ -398,17 +390,6 @@ private: // mime types /// $MAIN:MIME-TYPES Table *mime_types; -private: // lang manipulation - - String::Language set_lang(String::Language alang) { - String::Language result=flang; - flang=alang; - return result; - } - void restore_lang(String::Language alang) { - flang=alang; - } - private: // connection manipulation SQL_Connection* set_connection(SQL_Connection* aconnection) {