Annotation of parser3/src/types/pa_vhash.h, revision 1.12

1.10      paf         1: /** @file
                      2:        Parser: @b hash parser type decl.
                      3: 
1.1       paf         4:        Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com)
1.3       paf         5:        Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf)
1.1       paf         6: 
1.12    ! paf         7:        $Id: pa_vhash.h,v 1.11 2001/04/26 14:55:35 paf Exp $
1.1       paf         8: */
                      9: 
                     10: #ifndef PA_VHASH_H
                     11: #define PA_VHASH_H
                     12: 
                     13: #include "pa_value.h"
                     14: #include "pa_hash.h"
                     15: 
1.11      paf        16: /// value of type 'hash', implemented with Hash
1.1       paf        17: class VHash : public Value {
                     18: public: // value
                     19: 
1.2       paf        20:        const char *type() const { return "hash"; }
1.1       paf        21: 
1.11      paf        22:        /// VHash: fhash
1.8       paf        23:        Hash *get_hash() { return &fhash; }
1.7       paf        24: 
1.11      paf        25:        /// VHash: (key)=value
1.1       paf        26:        Value *get_element(const String& name) { 
1.5       paf        27:                return static_cast<Value *>(fhash.get(name));
1.1       paf        28:        }
                     29:        
1.11      paf        30:        /// VHash: (key)=value
1.1       paf        31:        void put_element(const String& name, Value *value) { 
1.5       paf        32:                fhash.put(name, value);
1.1       paf        33:        }
                     34: 
                     35: public: // usage
                     36: 
1.9       paf        37:        VHash(Pool& apool) : Value(apool), 
                     38:                fhash(apool) {}
1.7       paf        39: 
                     40:        Hash& hash() { return fhash; }
1.1       paf        41: 
                     42: private:
1.6       paf        43: 
1.9       paf        44:        Hash fhash;
1.6       paf        45: 
1.1       paf        46: };
                     47: 
                     48: #endif

E-mail: