|
|
| version 1.23, 2003/01/21 15:51:07 | version 1.35, 2024/11/04 03:53:25 |
|---|---|
| Line 1 | Line 1 |
| /** @file | /** @file |
| Parser: @b response parser class. | Parser: @b response parser class. |
| Copyright (c) 2001, 2003 ArtLebedev Group (http://www.artlebedev.com) | Copyright (c) 2001-2024 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> |
| */ | */ |
| static const char* IDENT_RESPONSE_C="$Date$"; | |
| #include "classes.h" | #include "classes.h" |
| #include "pa_vmethod_frame.h" | |
| #include "pa_request.h" | #include "pa_request.h" |
| #include "pa_vresponse.h" | |
| volatile const char * IDENT_RESPONSE_C="$Id$"; | |
| // class | // class |
| class MResponse : public Methoded { | class MResponse: public Methoded { |
| public: | public: |
| MResponse(Pool& pool); | MResponse(); |
| public: // Methoded | public: // Methoded |
| bool used_directly() { return false; } | bool used_directly() { return false; } |
| }; | }; |
| // global variable | |
| DECLARE_CLASS_VAR(response, new MResponse); | |
| // methods | // methods |
| static void _clear(Request& r, const String& method_name, MethodParams *) { | static void _clear(Request& r, MethodParams&) { |
| r.get_self()/*VResponse*/->get_hash(&method_name)/*sure not 0*/->clear(); | GET_SELF(r, VResponse).fields().clear(); |
| } | } |
| // constructor | // constructor |
| MResponse::MResponse(Pool& apool) : Methoded(apool, "response") { | MResponse::MResponse(): Methoded("response") { |
| // ^clear[] | // ^clear[] |
| add_native_method("clear", Method::CT_DYNAMIC, _clear, 0, 0); | add_native_method("clear", Method::CT_STATIC, _clear, 0, 0); |
| } | |
| // global variable | |
| Methoded *response_class; | |
| // creator | |
| Methoded *MResponse_create(Pool& pool) { | |
| return response_class=new(pool) MResponse(pool); | |
| } | } |