--- parser3/src/include/pa_request.h 2001/03/13 13:53:36 1.47 +++ parser3/src/include/pa_request.h 2001/03/14 16:47:29 1.53 @@ -3,14 +3,13 @@ Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) Author: Alexander Petrosyan (http://design.ru/paf) - $Id: pa_request.h,v 1.47 2001/03/13 13:53:36 paf Exp $ + $Id: pa_request.h,v 1.53 2001/03/14 16:47:29 paf Exp $ */ #ifndef PA_REQUEST_H #define PA_REQUEST_H #include "pa_pool.h" -#include "pa_exception.h" #include "pa_hash.h" #include "pa_wcontext.h" #include "pa_value.h" @@ -18,16 +17,7 @@ #include "pa_vclass.h" #include "pa_vobject.h" #include "pa_venv.h" - -#define UNNAMED_NAME "unnamed" - -#define MAIN_METHOD_NAME "main" -#define AUTO_METHOD_NAME "auto" -#define MAIN_CLASS_NAME "MAIN" - -#define ROOT_CLASS_NAME "ROOT" -#define ENV_CLASS_NAME "ENV" -#define TABLE_CLASS_NAME "table" +#include "pa_vform.h" #ifndef NO_STRING_ORIGIN # define COMPILE_PARAMS \ @@ -52,15 +42,29 @@ class Request : public Pooled { friend Temp_lang; public: - Request(Pool& apool); + struct Info { + const char *document_root; + const char *path_translated; + const char *request_method; + const char *query_string; + const char *request_uri; + const char *content_type; + size_t content_length; + }; + + Request(Pool& apool, + Info& ainfo, + String::Untaint_lang alang + ); ~Request() {} // global classes Hash& classes() { return fclasses; } - Array& classes_array() { return fclasses_array; } // core request processing - void core(); + char *core( + const char *sys_auto_path1, + const char *sys_auto_path2); void execute(const Array& ops); @@ -80,6 +84,10 @@ public: void write(const String& astring) { wcontext->write(astring, String::Untaint_lang::NO); // write(const) = clean } + void write_no_lang(String& astring) { + // appending, sure of clean string inside + wcontext->write(astring, String::Untaint_lang::NO); + } void write_assign_lang(Value& avalue) { // appending possible string, assigning untaint language @@ -89,6 +97,10 @@ public: // appending possible string, passing language built into string being written wcontext->write(avalue, String::Untaint_lang::PASS_APPENDED); } + void write_no_lang(Value& avalue) { + // appending sure value, no strings inside + wcontext->write(avalue, String::Untaint_lang::NO); + } void fail_if_junction_(bool is, Value& value, const String& method_name, char *msg); @@ -97,10 +109,15 @@ public: public: + // + Info& info; + // default base VClass root_class; - // $ENV:fields here + // $env:fields here VEnv env_class; + // $form:elements here + VForm form_class; // contexts Value *self, *root, *rcontext; @@ -110,7 +127,6 @@ private: // core data // classes Hash fclasses; - Array fclasses_array; // execution stack Stack stack; @@ -121,8 +137,8 @@ private: // compile.C private: // execute.C - char *execute_method(Value& aself, const Method& method, bool return_cstr); - char *execute_method(Value& aself, const String& method_name, bool return_cstr); + char *execute_method(Value& aself, const Method& method, bool return_cstr=true); + char *execute_method(Value& aself, const String& method_name, bool return_cstr=true); Value *get_element(); @@ -143,8 +159,8 @@ private: // lang manipulation private: // web - const char *document_root; - const char *page_filespec; + const char *fdocument_root; + const char *fpage_filespec; };