Annotation of parser3/src/types/pa_vhash.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>
! 5:
! 6: $Id: pa_vhash.h,v 1.12 2001/03/10 16:34:36 paf Exp $
! 7: */
! 8:
! 9: #ifndef PA_VHASH_H
! 10: #define PA_VHASH_H
! 11:
! 12: #include "pa_value.h"
! 13: #include "pa_hash.h"
! 14:
! 15: class VHash : public Value {
! 16: public: // value
! 17:
! 18: // all: for error reporting after fail(), etc
! 19: const char *type() const { return "fvalue"; }
! 20:
! 21: // value: (key)=value
! 22: Value *get_element(const String& name) {
! 23: return static_cast<Value *>(fvalue.get(name));
! 24: }
! 25:
! 26: // value: (key)=value
! 27: void put_element(const String& name, Value *value) {
! 28: fvalue.put(name, value);
! 29: }
! 30:
! 31: // value: size!=0
! 32: bool get_bool() { return fvalue.size()!=0; }
! 33:
! 34: public: // usage
! 35:
! 36: VHash(Pool& apool) : Value(apool),
! 37: fvalue(apool) {}
! 38:
! 39: private:
! 40: Hash fvalue;
! 41: };
! 42:
! 43: #endif
E-mail: