Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: third_party/WebKit/Source/wtf/text/WTFString.h

Issue 2333933002: Move String::remove to StringImpl. (Closed)
Patch Set: types. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * (C) 1999 Lars Knoll (knoll@kde.org) 2 * (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 248
249 void fill(UChar c) 249 void fill(UChar c)
250 { 250 {
251 if (m_impl) 251 if (m_impl)
252 m_impl = m_impl->fill(c); 252 m_impl = m_impl->fill(c);
253 } 253 }
254 254
255 void ensure16Bit(); 255 void ensure16Bit();
256 256
257 void truncate(unsigned len); 257 void truncate(unsigned len);
258 void remove(unsigned pos, int len = 1); 258 void remove(unsigned start, unsigned length = 1);
259 259
260 String substring(unsigned pos, unsigned len = UINT_MAX) const; 260 String substring(unsigned pos, unsigned len = UINT_MAX) const;
261 String left(unsigned len) const { return substring(0, len); } 261 String left(unsigned len) const { return substring(0, len); }
262 String right(unsigned len) const { return substring(length() - len, len); } 262 String right(unsigned len) const { return substring(length() - len, len); }
263 263
264 // Returns a lowercase/uppercase version of the string 264 // Returns a lowercase/uppercase version of the string
265 String lower() const; 265 String lower() const;
266 String upper() const; 266 String upper() const;
267 267
268 String lower(const AtomicString& localeIdentifier) const; 268 String lower(const AtomicString& localeIdentifier) const;
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 367
368 #ifndef NDEBUG 368 #ifndef NDEBUG
369 void show() const; 369 void show() const;
370 #endif 370 #endif
371 371
372 private: 372 private:
373 typedef struct ImplicitConversionFromWTFStringToBoolDisallowed* (String::*Un specifiedBoolType); 373 typedef struct ImplicitConversionFromWTFStringToBoolDisallowed* (String::*Un specifiedBoolType);
374 operator UnspecifiedBoolType() const; 374 operator UnspecifiedBoolType() const;
375 375
376 template <typename CharacterType> 376 template <typename CharacterType>
377 void removeInternal(const CharacterType*, unsigned, int);
378
379 template <typename CharacterType>
380 void appendInternal(CharacterType); 377 void appendInternal(CharacterType);
381 378
382 RefPtr<StringImpl> m_impl; 379 RefPtr<StringImpl> m_impl;
383 }; 380 };
384 381
385 #undef DISPATCH_CASE_OP 382 #undef DISPATCH_CASE_OP
386 383
387 inline bool operator==(const String& a, const String& b) { return equal(a.impl() , b.impl()); } 384 inline bool operator==(const String& a, const String& b) { return equal(a.impl() , b.impl()); }
388 inline bool operator==(const String& a, const LChar* b) { return equal(a.impl(), b); } 385 inline bool operator==(const String& a, const LChar* b) { return equal(a.impl(), b); }
389 inline bool operator==(const String& a, const char* b) { return equal(a.impl(), reinterpret_cast<const LChar*>(b)); } 386 inline bool operator==(const String& a, const char* b) { return equal(a.impl(), reinterpret_cast<const LChar*>(b)); }
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 using WTF::emptyString16Bit; 578 using WTF::emptyString16Bit;
582 using WTF::append; 579 using WTF::append;
583 using WTF::charactersAreAllASCII; 580 using WTF::charactersAreAllASCII;
584 using WTF::equal; 581 using WTF::equal;
585 using WTF::find; 582 using WTF::find;
586 using WTF::isAllSpecialCharacters; 583 using WTF::isAllSpecialCharacters;
587 using WTF::isSpaceOrNewline; 584 using WTF::isSpaceOrNewline;
588 585
589 #include "wtf/text/AtomicString.h" 586 #include "wtf/text/AtomicString.h"
590 #endif // WTFString_h 587 #endif // WTFString_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringImpl.cpp ('k') | third_party/WebKit/Source/wtf/text/WTFString.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698