LispSymbol.h compiles.
[lispp.git] / LispString.h
blobba7cf252885010077bb0d21987320aed9a4d3c29
1 #if !defined(H_LISPSTRING)
2 #define H_LISPSTRING
4 namespace Lisp
6 class String;
8 class String : public Obj
10 public:
12 typedef String* StringPtr;
13 typedef String& StringRef;
15 String() : value_("")
16 {};
18 String( const String& other )
20 if (this != &other)
21 value_ = other.value_;
24 virtual eObjectType getObjectType() const
26 return eStringObj;
29 virtual String* create(void) const
31 StringPtr result = new String();
32 return result;
35 virtual String* clone() const
37 StringPtr result = new String(*this);
40 void print(std::ostream& out) const
42 out << "\"" << value_ << "\"";
45 StringValue value()
47 return value_;
50 void value(StringValue value)
52 value_ = value;
55 bool operator==(const Obj* other)
57 bool result = false;
58 if (other->getObjectType() == eStringObj)
59 result = ( value_ == dynamic_cast<const String*>(other)->value_ );
60 return result;
62 private:
63 StringValue value_;
67 #endif