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

1.1       paf         1: /*
                      2:        Parser
                      3:        Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com)
1.3     ! paf         4:        Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf)
1.1       paf         5: 
1.3     ! paf         6:        $Id: pa_vhash.h,v 1.2 2001/03/11 08:12:12 paf Exp $
1.1       paf         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
1.2       paf        19:        const char *type() const { return "hash"; }
1.1       paf        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: