Diff for /parser3/src/include/pa_request.h between versions 1.247 and 1.263

version 1.247, 2017/01/26 22:57:47 version 1.263, 2023/11/17 19:12:34
Line 1 Line 1
 /** @file  /** @file
         Parser: request class decl.          Parser: request class decl.
   
         Copyright (c) 2001-2015 Art. Lebedev Studio (http://www.artlebedev.com)          Copyright (c) 2001-2023 Art. Lebedev Studio (http://www.artlebedev.com)
         Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)          Authors: Konstantin Morshnev <moko@design.ru>, Alexandr Petrosian <paf@design.ru>
 */  */
   
 #ifndef PA_REQUEST_H  #ifndef PA_REQUEST_H
Line 19 Line 19
 #include "pa_request_charsets.h"  #include "pa_request_charsets.h"
 #include "pa_sapi.h"  #include "pa_sapi.h"
   
   // defines for externs
   
   #define EXCEPTION_HANDLED_PART_NAME "handled"
   
   
   // externs
   
   extern const String main_method_name;
   extern const String auto_method_name;
   
   extern const String exception_type_part_name;
   extern const String exception_source_part_name;
   extern const String exception_comment_part_name;
   extern const String exception_handled_part_name;
   
   // defines for statics
   
   #define MAIN_CLASS_NAME "MAIN"
   #define AUTO_FILE_NAME "auto.p"
   
 // consts  // consts
   
 const size_t pseudo_file_no__process=1;  const size_t pseudo_file_no__process=1;
Line 37  class VConsole; Line 57  class VConsole;
   
 extern int pa_loop_limit;  extern int pa_loop_limit;
 extern int pa_execute_recoursion_limit;  extern int pa_execute_recoursion_limit;
   extern int pa_httpd_timeout;
 extern size_t pa_file_size_limit;  extern size_t pa_file_size_limit;
   
 /// Main workhorse.  /// Main workhorse.
Line 89  private: Line 110  private:
                 ArrayOperation& ops() const { return *fops; }                  ArrayOperation& ops() const { return *fops; }
                 VMethodFrame& method_frame() const { return *fmethod_frame; }                  VMethodFrame& method_frame() const { return *fmethod_frame; }
   
                 /// needed to fill unused Array entries  
                 StackItem() {}  
                 StackItem(Value& avalue): fvalue(&avalue) {}                  StackItem(Value& avalue): fvalue(&avalue) {}
                 StackItem(ArrayOperation& aops): fops(&aops) {}                  StackItem(ArrayOperation& aops): fops(&aops) {}
                 StackItem(VMethodFrame& amethod_frame): fmethod_frame(&amethod_frame) {}                  StackItem(VMethodFrame& amethod_frame): fmethod_frame(&amethod_frame) {}
Line 112  private: Line 131  private:
                 bool is_empty() {                  bool is_empty() {
                         return fused==fbottom;                          return fused==fbottom;
                 }                  }
   
                   Table &table(Request &r);
         };          };
   
         ///@{ core data          ///@{ core data
Line 187  public: Line 208  public:
         /// global classes          /// global classes
         HashString<VStateless_class*>& classes() { return fclasses; }          HashString<VStateless_class*>& classes() { return fclasses; }
         VStateless_class* get_class(const String& name);          VStateless_class* get_class(const String& name);
           VStateless_class& get_class_ref(const String& name);
         void put_class(VStateless_class *aclass){ classes().put(aclass->type(), aclass); }          void put_class(VStateless_class *aclass){ classes().put(aclass->type(), aclass); }
   
         /**          /**
                 core request processing                  core request processing
                 BEWARE: may throw exception to you: catch it!                  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, const String& amain_method_name = main_method_name, const String* amain_class_name = NULL);
   
         /// executes ops          /// executes ops
         void execute(ArrayOperation& ops); // execute.C          void execute(ArrayOperation& ops); // execute.C
Line 237  public: Line 259  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.          /// compiles the file in main class context by default
         void use_file(VStateless_class& aclass, const String& file_name, const String* use_filespec);          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)          /// for @USE only, calls ^use (which may be user-defined)
         void use_file(const String& file_name, const String* use_filespec, Operation::Origin origin);          void use_file(const String& file_name, const String* use_filespec, Operation::Origin origin);
Line 281  public: Line 303  public:
         /// returns relative to @a path  path to @a file           /// returns relative to @a path  path to @a file 
         const String& relative(const char* apath, const String& relative_name);          const String& relative(const char* apath, const String& relative_name);
   
         /// returns an absolute @a path to relative @a name          const String& full_disk_path(const String& relative_name);
         const String& absolute(const String& relative_name);  
   
         /// returns the mime type of 'user_file_name'          /// returns the mime type of 'user_file_name'
         const String& mime_type_of(const String* file_name);          const String& mime_type_of(const String* file_name);
Line 343  public: // status read methods Line 364  public: // status read methods
         /// public for ^reflection:copy[]          /// public for ^reflection:copy[]
         void put_element(Value& ncontext, const String& name, Value* value);          void put_element(Value& ncontext, const String& name, Value* value);
   
         /// for @main[]          /// for @main[] and parser://method/call
         const String* execute_virtual_method(Value& aself, const String& method_name);          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          //{ for @conf[filespec] and @auto[filespec]
         const String* execute_method(Value& aself, const Method& method, Value* optional_param, bool do_return_string);          bool execute_method_if_exists(VStateless_class& aclass, const String& method_name, Value* optional_param);
           bool execute_auto_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  #ifdef XML
Line 399  private: // mime types Line 414  private: // mime types
         /// $MAIN:MIME-TYPES          /// $MAIN:MIME-TYPES
         Table *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  private: // connection manipulation
   
         SQL_Connection* set_connection(SQL_Connection* aconnection) {          SQL_Connection* set_connection(SQL_Connection* aconnection) {
Line 534  public: Line 538  public:
         ~Temp_value_element();          ~Temp_value_element();
 };  };
   
 // defines for externs  
   
 #define EXCEPTION_HANDLED_PART_NAME "handled"  
   
   
 // externs  
   
 extern const String main_method_name;  
 extern const String auto_method_name;  
   
 extern const String exception_type_part_name;  
 extern const String exception_source_part_name;  
 extern const String exception_comment_part_name;  
 extern const String exception_handled_part_name;  
   
 // defines for statics  
   
 #define MAIN_CLASS_NAME "MAIN"  
 #define AUTO_FILE_NAME "auto.p"  
   
 #endif  #endif

Removed from v.1.247  
changed lines
  Added in v.1.263


E-mail: