Annotation of parser3/src/types/pa_vresponse.h, revision 1.54

1.3       paf         1: /** @file
                      2:        Parser: response class.
                      3: 
1.51      moko        4:        Copyright (c) 2001-2026 Art. Lebedev Studio (https://www.artlebedev.com)
1.49      moko        5:        Authors: Konstantin Morshnev <moko@design.ru>, Alexandr Petrosian <paf@design.ru>
1.1       paf         6: */
                      7: 
                      8: #ifndef PA_VRESPONSE_H
                      9: #define PA_VRESPONSE_H
1.23      paf        10: 
1.54    ! moko       11: #define IDENT_PA_VRESPONSE_H "$Id: pa_vresponse.h,v 1.53 2026/10/16 13:55:16 moko Exp $"
1.1       paf        12: 
1.3       paf        13: #include "pa_vstateless_object.h"
1.1       paf        14: #include "pa_string.h"
1.19      paf        15: #include "classes.h"
                     16: 
1.41      misha      17: // defines
                     18: #define RESPONSE_CLASS_NAME "response"
                     19: 
1.19      paf        20: // forwards
                     21: 
                     22: class Response;
1.33      paf        23: class Request_info;
                     24: class Request_charsets;
1.9       paf        25: 
1.11      parser     26: // externals
                     27: 
1.33      paf        28: extern Methoded* response_class;
1.1       paf        29: 
1.5       paf        30: /// value of type 'response'
1.46      moko       31: class VResponse: public VStateless_class {
1.33      paf        32: 
                     33:        Request_info& finfo;
                     34:        Request_charsets& fcharsets;
                     35: 
                     36:        HashStringValue ffields;
                     37: 
1.1       paf        38: public: // Value
                     39:        
1.41      misha      40:        override const char* type() const { return RESPONSE_CLASS_NAME; }
1.2       paf        41: 
1.5       paf        42:        /// Response: ffields
1.33      paf        43:        override HashStringValue* get_hash() { return &ffields; }
1.1       paf        44: 
1.8       paf        45:        /// Response: method,fields
1.42      misha      46:        override Value* get_element(const String& aname);
1.1       paf        47: 
1.5       paf        48:        /// Response: (attribute)=value
1.44      moko       49:        override const VJunction* put_element(const String& name, Value* value);
1.1       paf        50: 
1.33      paf        51: public:        // usage
1.1       paf        52: 
1.52      moko       53:        /// $response:untaint, response data untainting lang
                     54:        String::Language lang;
                     55:        /// $response:untaint is reset to it in @unhandled_exception
                     56:        const String::Language default_lang;
                     57: 
1.53      moko       58:        /// if not UNSTARTED, the headers are already sent and the result of @main or exception is not sent
                     59:        enum Started { UNSTARTED=0, STREAM, WEBSOCKET };
                     60:        /// $response:started
                     61:        Started started;
                     62: 
1.54    ! moko       63:        /// $response:timeout in seconds, 0 is none, the assignment calls SAPI::set_response_timeout
        !            64:        int timeout;
        !            65: 
        !            66:        VResponse(Request_info& ainfo, Request_charsets& acharsets, String::Language alang): VStateless_class(response_class), finfo(ainfo), fcharsets(acharsets), lang(alang), default_lang(alang), started(UNSTARTED), timeout(0) {}
1.12      parser     67: 
1.33      paf        68:        /// used in pa_request.C
                     69:        HashStringValue& fields() { return ffields; }
1.1       paf        70: 
1.33      paf        71: };
1.1       paf        72: 
                     73: 
                     74: #endif

E-mail: