--- parser3/src/include/Attic/pa_vstring.h 2001/02/23 10:17:28 1.4 +++ parser3/src/include/Attic/pa_vstring.h 2001/03/06 12:22:57 1.6 @@ -1,10 +1,12 @@ /* - $Id: pa_vstring.h,v 1.4 2001/02/23 10:17:28 paf Exp $ + $Id: pa_vstring.h,v 1.6 2001/03/06 12:22:57 paf Exp $ */ #ifndef PA_VSTRING_H #define PA_VSTRING_H +#include + #include "pa_value.h" class VString : public Value { @@ -13,22 +15,25 @@ public: // Value // all: for error reporting after fail(), etc const char *type() const { return "String"; } // string: value - String *get_string() { return string; }; + String *get_string() { return &string; }; // string: value //void put_string(String *astring) { string=astring; } + // string: value + 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) { } private: - String *string; + String& string; };