Removed superflouous files
[lispp.git] / LispString.h
blob64f76b99650b909faeb4ded8438488e5e703d318
1 #if !defined(H_LISPSTRING)
2 #define H_LISPSTRING
4 namespace Lisp
6 class String;
8 class String : public LispObj
10 public:
11 void make(const CharType *value)
13 int i = 0;
15 object.setType(eStringObj);
17 // calc length
18 while (*value != '\0')
20 ++i;
21 ++value;
24 // insert the pigs (string manipulation will not be this things forte)
25 object.values.resize(i);
26 value = value - i;
27 i = 0;
28 while(*value != '\0')
30 object.values.push_back( LispValue( *value ) );
31 ++i;
32 ++value;
36 std::size_t length() const
38 return object.values.size();
41 bool operator==(const String& str)
43 if (str.length() == length())
45 bool result = true;
46 std::size_t i = 0;
48 while ((i < length()) && result)
50 result = (
51 CharType(str.object.values[i]) ==
52 CharType(object.values[i]) );
53 i++;
55 return result;
57 return false;
62 #endif