Home | History | Annotate | Download | only in text

Lines Matching refs:StringImpl

65 class StringImpl : public StringImplBase {
77 StringImpl(const UChar* characters, unsigned length, StaticStringConstructType)
90 StringImpl(unsigned length)
100 // Create a StringImpl adopting ownership of the provided buffer (BufferOwned)
101 StringImpl(const UChar* characters, unsigned length)
111 // Used to create new strings that are a substring of an existing StringImpl (BufferSubstring)
112 StringImpl(const UChar* characters, unsigned length, PassRefPtr<StringImpl> base)
124 StringImpl(const UChar* characters, unsigned length, PassRefPtr<SharedUChar> sharedBuffer)
144 ~StringImpl();
146 static PassRefPtr<StringImpl> create(const UChar*, unsigned length);
147 static PassRefPtr<StringImpl> create(const char*, unsigned length);
148 static PassRefPtr<StringImpl> create(const char*);
149 static PassRefPtr<StringImpl> create(const UChar*, unsigned length, PassRefPtr<SharedUChar> sharedBuffer);
150 static ALWAYS_INLINE PassRefPtr<StringImpl> create(PassRefPtr<StringImpl> rep, unsigned offset, unsigned length)
158 StringImpl* ownerRep = (rep->bufferOwnership() == BufferSubstring) ? rep->m_substringBuffer : rep.get();
159 return adoptRef(new StringImpl(rep->m_data + offset, length, ownerRep));
162 static PassRefPtr<StringImpl> createUninitialized(unsigned length, UChar*& data);
163 static ALWAYS_INLINE PassRefPtr<StringImpl> tryCreateUninitialized(unsigned length, UChar*& output)
170 if (length > ((std::numeric_limits<unsigned>::max() - sizeof(StringImpl)) / sizeof(UChar))) {
174 StringImpl* resultImpl;
175 if (!tryFastMalloc(sizeof(UChar) * length + sizeof(StringImpl)).getValue(resultImpl)) {
180 return adoptRef(new(resultImpl) StringImpl(length));
183 static unsigned dataOffset() { return OBJECT_OFFSETOF(StringImpl, m_data); }
184 static PassRefPtr<StringImpl> createWithTerminatingNullCharacter(const StringImpl&);
185 static PassRefPtr<StringImpl> createStrippingNullCharacters(const UChar*, unsigned length);
188 static PassRefPtr<StringImpl> adopt(Vector<UChar, inlineCapacity>& vector)
194 return adoptRef(new StringImpl(vector.releaseBuffer(), size));
198 static PassRefPtr<StringImpl> adopt(StringBuffer&);
244 static StringImpl* empty();
255 // Returns a StringImpl suitable for use on another thread.
256 PassRefPtr<StringImpl> crossThreadString();
259 // Since StringImpl objects are immutable, there's no other reason to make a copy.
260 PassRefPtr<StringImpl> threadsafeCopy() const;
262 PassRefPtr<StringImpl> substring(unsigned pos, unsigned len = UINT_MAX);
284 PassRefPtr<StringImpl> lower();
285 PassRefPtr<StringImpl> upper();
289 PassRefPtr<StringImpl> secure(UChar, LastCharacterBehavior = ObscureLastCharacter);
290 PassRefPtr<StringImpl> foldCase();
292 PassRefPtr<StringImpl> stripWhiteSpace();
293 PassRefPtr<StringImpl> simplifyWhiteSpace();
295 PassRefPtr<StringImpl> removeCharacters(CharacterMatchFunctionPtr);
300 size_t find(StringImpl*, unsigned index = 0);
302 size_t findIgnoringCase(StringImpl*, unsigned index = 0);
305 size_t reverseFind(StringImpl*, unsigned index = UINT_MAX);
306 size_t reverseFindIgnoringCase(StringImpl*, unsigned index = UINT_MAX);
308 bool startsWith(StringImpl* str, bool caseSensitive = true) { return (caseSensitive ? reverseFind(str, 0) : reverseFindIgnoringCase(str, 0)) == 0; }
309 bool endsWith(StringImpl*, bool caseSensitive = true);
311 PassRefPtr<StringImpl> replace(UChar, UChar);
312 PassRefPtr<StringImpl> replace(UChar, StringImpl*);
313 PassRefPtr<StringImpl> replace(StringImpl*, StringImpl*);
314 PassRefPtr<StringImpl> replace(unsigned index, unsigned len, StringImpl*);
329 static PassRefPtr<StringImpl> createStrippingNullCharactersSlowCase(const UChar*, unsigned length);
336 StringImpl* m_substringBuffer;
342 bool equal(const StringImpl*, const StringImpl*);
343 bool equal(const StringImpl*, const char*);
344 inline bool equal(const char* a, StringImpl* b) { return equal(b, a); }
346 bool equalIgnoringCase(StringImpl*, StringImpl*);
347 bool equalIgnoringCase(StringImpl*, const char*);
348 inline bool equalIgnoringCase(const char* a, StringImpl* b) { return equalIgnoringCase(b, a); }
352 bool equalIgnoringNullity(StringImpl*, StringImpl*);
355 bool equalIgnoringNullity(const Vector<UChar, inlineCapacity>& a, StringImpl* b)
364 int codePointCompare(const StringImpl*, const StringImpl*);
374 inline PassRefPtr<StringImpl> StringImpl::createStrippingNullCharacters(const UChar* characters, unsigned length)
380 // searching for nulls, and then using StringImpl::create, which will
391 return StringImpl::create(characters, length);
393 return StringImpl::createStrippingNullCharactersSlowCase(characters, length);
398 // StringHash is the default hash for StringImpl* and RefPtr<StringImpl>
400 template<> struct DefaultHash<StringImpl*> {
403 template<> struct DefaultHash<RefPtr<StringImpl> > {
409 using WTF::StringImpl;