Annotation of parser3/src/include/pa_vbool.h, revision 1.2

1.1       paf         1: /*
1.2     ! paf         2:   $Id: pa_vbool.h,v 1.1 2001/03/06 15:55:46 paf Exp $
1.1       paf         3: */
                      4: 
                      5: #ifndef PA_VBOOL_H
                      6: #define PA_VBOOL_H
                      7: 
                      8: #include "pa_value.h"
                      9: #include "pa_common.h"
                     10: 
                     11: #define MAX_BOOL_AS_STRING 20
                     12: 
                     13: class VBool : public Value {
                     14: public: // Value
                     15: 
                     16:        // all: for error reporting after fail(), etc
                     17:        const char *type() const { return "bool"; }
1.2     ! paf        18:        // bool: fvalue
1.1       paf        19:        String *get_string() {
                     20:                String *result=NEW String(pool());
1.2     ! paf        21:                result->APPEND_CONST(fvalue?"TRUE":"FALSE");
1.1       paf        22:                return result;
                     23:        };
1.2     ! paf        24:        // bool: fvalue
        !            25:        bool get_bool() { return fvalue; };
        !            26:        // bool: fvalue
        !            27:        double get_double() { return fvalue; };
1.1       paf        28: 
                     29: public: // usage
                     30: 
                     31:        VBool(Pool& apool, bool avalue/*=false*/) : Value(apool), 
1.2     ! paf        32:                fvalue(avalue) {
1.1       paf        33:        }
                     34: 
                     35: private:
                     36: 
1.2     ! paf        37:        bool fvalue;
1.1       paf        38: 
                     39: };
                     40: 
                     41: #endif

E-mail: