--- parser3/src/include/Attic/pa_vstring.h 2001/03/08 17:14:51 1.12 +++ 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.12 2001/03/08 17:14:51 paf Exp $ + $Id: pa_vstring.h,v 1.13 2001/03/09 04:47:27 paf Exp $ */ #ifndef PA_VSTRING_H @@ -8,26 +8,28 @@ #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"; } - // fvalue: fvalue + // value: fvalue String *get_string() { return &fvalue; }; - // fvalue: fvalue + // value: fvalue double get_double() { return atof(fvalue.cstr()); } - // fvalue: empty or not + // value: empty or not bool get_bool() { return fvalue.size()!=0; }; public: // usage - VString(Pool& apool) : Value(apool), - fvalue(*new(apool) String(apool)) { + VString() : VObject(*string_class), + fvalue(*new(string_class->pool()) String(string_class->pool())) { } - VString(String& avalue) : Value(avalue.pool()), + VString(String& avalue) : VObject(*string_class), fvalue(avalue) { }