--- parser3/src/include/Attic/pa_vstring.h 2001/02/22 13:52:25 1.2 +++ parser3/src/include/Attic/pa_vstring.h 2001/03/06 15:02:47 1.7 @@ -1,36 +1,39 @@ /* - $Id: pa_vstring.h,v 1.2 2001/02/22 13:52:25 paf Exp $ + $Id: pa_vstring.h,v 1.7 2001/03/06 15:02:47 paf Exp $ */ #ifndef PA_VSTRING_H #define PA_VSTRING_H +#include + #include "pa_value.h" class VString : public Value { public: // Value // all: for error reporting after fail(), etc - const char *type() const { return "VString"; } + const char *type() const { return "string"; } + // string: value + String *get_string() { return &string; }; // string: value - String *get_string() { return string; }; + //void put_string(String *astring) { string=astring; } + // string: value - void put_string(String *astring) { string=astring; } + double get_double() { return atof(string.cstr()); } public: // usage VString(Pool& apool) : Value(apool), - string(new(apool) String(apool)) { + string(*new(apool) String(apool)) { } - VString(String *astring) : Value(astring->pool()), + VString(String& astring) : Value(astring.pool()), string(astring) { } - operator String() { return *string; } - private: - String *string; + String& string; };