Changeset 2096 for trunk/src/lol/core/string.h
- Timestamp:
- Nov 20, 2012, 1:23:09 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lol/core/string.h
r2089 r2096 45 45 } 46 46 47 inline String(String const &s) 48 : Super((Super const &)s) 49 { 50 } 51 47 52 inline char &operator [](int n) 48 53 { … … 55 60 } 56 61 57 inline String operator +(String const &s) 62 inline int Count() const 63 { 64 return ((Super const &)*this).Count() - 1; 65 } 66 67 inline String operator +(String const &s) const 58 68 { 59 69 String ret(*this); … … 68 78 return *this; 69 79 } 80 81 inline String operator +(char c) const 82 { 83 String ret(*this); 84 return ret += c; 85 } 86 87 inline String operator +=(char c) 88 { 89 ((Super &)*this).Last() = c; 90 ((Super &)*this).Push('\0'); 91 return *this; 92 } 93 94 inline bool operator ==(String const &s) const 95 { 96 if (this->m_count != s.m_count) 97 return false; 98 99 for (int i = 0; i < this->m_count; ++i) 100 if ((*this)[i] != s[i]) 101 return false; 102 103 return true; 104 } 105 106 inline bool operator !=(String const &s) const 107 { 108 return !(*this == s); 109 } 70 110 }; 71 111
Note: See TracChangeset
for help on using the changeset viewer.