--- parser3/src/include/Attic/pa_vhash.h 2001/02/24 11:20:32 1.2 +++ parser3/src/include/Attic/pa_vhash.h 2001/03/08 17:14:51 1.9 @@ -1,5 +1,5 @@ /* - $Id: pa_vhash.h,v 1.2 2001/02/24 11:20:32 paf Exp $ + $Id: pa_vhash.h,v 1.9 2001/03/08 17:14:51 paf Exp $ */ #ifndef PA_VHASH_H @@ -12,24 +12,31 @@ class VHash : public Value { public: // value // all: for error reporting after fail(), etc - const char *type() const { return "Hash"; } + const char *type() const { return "fvalue"; } - // hash: (key)=value + // fvalue: (key)=value Value *get_element(const String& name) { - return static_cast(hash.get(name)); + return static_cast(fvalue.get(name)); } - // hash: (key)=value + // fvalue: (key)=value void put_element(const String& name, Value *value) { - hash.put(name, value); + fvalue.put(name, value); } + // fvalue: size!=0 + bool get_bool() { return fvalue.size()!=0; } + public: // usage - VHash(Pool& apool) : Value(apool), hash(apool) {} + VHash(Pool& apool) : Value(apool), + fvalue(*new(apool) Hash(apool)) {} + + VHash(Pool& apool, Hash& avalue) : Value(apool), + fvalue(avalue) {} private: - Hash hash; + Hash& fvalue; }; #endif