--- parser3/src/include/Attic/pa_vstring.h 2001/03/06 12:22:57 1.6 +++ parser3/src/include/Attic/pa_vstring.h 2001/03/09 04:47:27 1.13 @@ -1,5 +1,5 @@ /* - $Id: pa_vstring.h,v 1.6 2001/03/06 12:22:57 paf Exp $ + $Id: pa_vstring.h,v 1.13 2001/03/09 04:47:27 paf Exp $ */ #ifndef PA_VSTRING_H @@ -8,32 +8,33 @@ #include #include "pa_value.h" +#include "pa_vobject.h" +#include "classes/_string.h" -class VString : public Value { +class VString : public VObject { public: // Value // all: for error reporting after fail(), etc - const char *type() const { return "String"; } - // string: value - String *get_string() { return &string; }; - // string: value - //void put_string(String *astring) { string=astring; } - - // string: value - double get_double() { return atof(string.cstr()); } + const char *type() const { return "string"; } + // value: fvalue + String *get_string() { return &fvalue; }; + // value: fvalue + double get_double() { return atof(fvalue.cstr()); } + // value: empty or not + bool get_bool() { return fvalue.size()!=0; }; public: // usage - VString(Pool& apool) : Value(apool), - string(*new(apool) String(apool)) { + VString() : VObject(*string_class), + fvalue(*new(string_class->pool()) String(string_class->pool())) { } - VString(String& astring) : Value(astring.pool()), - string(astring) { + VString(String& avalue) : VObject(*string_class), + fvalue(avalue) { } private: - String& string; + String& fvalue; };