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

1.1     ! paf         1: /*
        !             2:        Parser
        !             3:        Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com)
        !             4:        Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf)
        !             5: 
        !             6:        $Id: pa_vresponse.h,v 1.2 2001/03/16 12:46:37 paf Exp $
        !             7: */
        !             8: 
        !             9: #ifndef PA_VRESPONSE_H
        !            10: #define PA_VRESPONSE_H
        !            11: 
        !            12: #include "pa_vstateless_class.h"
        !            13: #include "pa_string.h"
        !            14: #include "_response.h"
        !            15: 
        !            16: class Response;
        !            17: 
        !            18: class VResponse : public VStateless_class {
        !            19: public: // Value
        !            20:        
        !            21:        // all: for error reporting after fail(), etc
        !            22:        const char *type() const { return "response"; }
        !            23: 
        !            24:        // response: CLASS,BASE,method,fields
        !            25:        Value *get_element(const String& name) {
        !            26:                // $CLASS,$BASE,$method
        !            27:                if(Value *result=VStateless_class::get_element(name))
        !            28:                        return result;
        !            29:                
        !            30:                // $field
        !            31:                return static_cast<Value *>(ffields.get(name));
        !            32:        }
        !            33: 
        !            34:        // response: (attribute)=value
        !            35:        void put_element(const String& name, Value *value) { 
        !            36:                ffields.put(name, value);
        !            37:        }
        !            38: 
        !            39: public: // usage
        !            40: 
        !            41:        VResponse(Pool& apool) : VStateless_class(apool, response_base_class),
        !            42:                ffields(apool) {
        !            43:        }
        !            44:        
        !            45:        Hash& fields() { return ffields; }
        !            46: 
        !            47: private:
        !            48: 
        !            49:        Hash ffields;
        !            50: 
        !            51: };
        !            52: 
        !            53: #endif

E-mail: