Annotation of parser3/src/types/pa_vresponse.h, revision 1.2
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:
1.2 ! paf 6: $Id: pa_vresponse.h,v 1.1 2001/03/18 11:37:54 paf Exp $
1.1 paf 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"; }
1.2 ! paf 23:
! 24: // response: ffields
! 25: Hash *get_hash() { return &ffields; }
1.1 paf 26:
27: // response: CLASS,BASE,method,fields
28: Value *get_element(const String& name) {
29: // $CLASS,$BASE,$method
30: if(Value *result=VStateless_class::get_element(name))
31: return result;
32:
33: // $field
34: return static_cast<Value *>(ffields.get(name));
35: }
36:
37: // response: (attribute)=value
38: void put_element(const String& name, Value *value) {
39: ffields.put(name, value);
40: }
41:
42: public: // usage
43:
44: VResponse(Pool& apool) : VStateless_class(apool, response_base_class),
45: ffields(apool) {
46: }
47:
48: Hash& fields() { return ffields; }
49:
50: private:
51:
52: Hash ffields;
53:
54: };
55:
56: #endif
E-mail: