Changeset 59196 in webkit for trunk/JavaScriptCore/wtf/text/WTFString.cpp
- Timestamp:
- May 11, 2010, 7:25:40 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/wtf/text/WTFString.cpp
r57904 r59196 38 38 namespace WebCore { 39 39 40 String::String(const UChar* str, unsigned len)41 {42 if (!str)43 return;44 m_impl = StringImpl::create(str, len);45 }46 47 40 String::String(const UChar* str) 48 41 { … … 55 48 56 49 m_impl = StringImpl::create(str, len); 57 }58 59 String::String(const char* str)60 {61 if (!str)62 return;63 m_impl = StringImpl::create(str);64 }65 66 String::String(const char* str, unsigned length)67 {68 if (!str)69 return;70 m_impl = StringImpl::create(str, length);71 50 } 72 51 … … 203 182 } 204 183 205 UChar String::operator[](unsigned i) const184 UChar32 String::characterStartingAt(unsigned i) const 206 185 { 207 186 if (!m_impl || i >= m_impl->length()) 208 187 return 0; 209 return m_impl->characters()[i];210 }211 212 UChar32 String::characterStartingAt(unsigned i) const213 {214 if (!m_impl || i >= m_impl->length())215 return 0;216 188 return m_impl->characterStartingAt(i); 217 }218 219 unsigned String::length() const220 {221 if (!m_impl)222 return 0;223 return m_impl->length();224 189 } 225 190 … … 310 275 result = charactersToIntStrict(m_impl->characters(), m_impl->length() - 1); 311 276 return true; 312 }313 314 const UChar* String::characters() const315 {316 if (!m_impl)317 return 0;318 return m_impl->characters();319 277 } 320 278 … … 592 550 } 593 551 594 bool String::isEmpty() const595 {596 return !m_impl || !m_impl->length();597 }598 599 552 void String::split(const String& separator, bool allowEmptyEntries, Vector<String>& result) const 600 553 {
Note:
See TracChangeset
for help on using the changeset viewer.