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

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

Issue 1511813004: Refactor StringImpl::{start,end}sWith(StringImpl*, ...) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/text/StringImpl.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved.
4 * Copyright (C) 2009 Google Inc. All rights reserved. 4 * Copyright (C) 2009 Google Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 size_t findIgnoringCase(StringImpl*, unsigned index = 0); 376 size_t findIgnoringCase(StringImpl*, unsigned index = 0);
377 377
378 size_t findNextLineStart(unsigned index = UINT_MAX); 378 size_t findNextLineStart(unsigned index = UINT_MAX);
379 379
380 size_t reverseFind(UChar, unsigned index = UINT_MAX); 380 size_t reverseFind(UChar, unsigned index = UINT_MAX);
381 size_t reverseFind(StringImpl*, unsigned index = UINT_MAX); 381 size_t reverseFind(StringImpl*, unsigned index = UINT_MAX);
382 size_t reverseFindIgnoringCase(StringImpl*, unsigned index = UINT_MAX); 382 size_t reverseFindIgnoringCase(StringImpl*, unsigned index = UINT_MAX);
383 383
384 size_t count(LChar) const; 384 size_t count(LChar) const;
385 385
386 bool startsWith(StringImpl* str, TextCaseSensitivity caseSensitivity = TextC aseSensitive) { return ((caseSensitivity == TextCaseSensitive) ? reverseFind(str , 0) : reverseFindIgnoringCase(str, 0)) == 0; }
387 bool startsWith(UChar) const; 386 bool startsWith(UChar) const;
388 bool startsWith(const char*, unsigned matchLength) const; 387 bool startsWith(const char*, unsigned matchLength) const;
388 bool startsWith(const StringImpl*) const;
389 bool startsWithIgnoringCase(const StringImpl*) const;
389 390
390 bool endsWith(StringImpl*, TextCaseSensitivity = TextCaseSensitive);
391 bool endsWith(UChar) const; 391 bool endsWith(UChar) const;
392 bool endsWith(const char*, unsigned matchLength) const; 392 bool endsWith(const char*, unsigned matchLength) const;
393 bool endsWith(const StringImpl*) const;
394 bool endsWithIgnoringCase(const StringImpl*) const;
393 395
394 PassRefPtr<StringImpl> replace(UChar, UChar); 396 PassRefPtr<StringImpl> replace(UChar, UChar);
395 PassRefPtr<StringImpl> replace(UChar, StringImpl*); 397 PassRefPtr<StringImpl> replace(UChar, StringImpl*);
396 ALWAYS_INLINE PassRefPtr<StringImpl> replace(UChar pattern, const char* repl acement, unsigned replacementLength) { return replace(pattern, reinterpret_cast< const LChar*>(replacement), replacementLength); } 398 ALWAYS_INLINE PassRefPtr<StringImpl> replace(UChar pattern, const char* repl acement, unsigned replacementLength) { return replace(pattern, reinterpret_cast< const LChar*>(replacement), replacementLength); }
397 PassRefPtr<StringImpl> replace(UChar, const LChar*, unsigned replacementLeng th); 399 PassRefPtr<StringImpl> replace(UChar, const LChar*, unsigned replacementLeng th);
398 PassRefPtr<StringImpl> replace(UChar, const UChar*, unsigned replacementLeng th); 400 PassRefPtr<StringImpl> replace(UChar, const UChar*, unsigned replacementLeng th);
399 PassRefPtr<StringImpl> replace(StringImpl*, StringImpl*); 401 PassRefPtr<StringImpl> replace(StringImpl*, StringImpl*);
400 PassRefPtr<StringImpl> replace(unsigned index, unsigned len, StringImpl*); 402 PassRefPtr<StringImpl> replace(unsigned index, unsigned len, StringImpl*);
401 PassRefPtr<StringImpl> upconvertedString(); 403 PassRefPtr<StringImpl> upconvertedString();
402 404
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 } 766 }
765 767
766 using WTF::StringImpl; 768 using WTF::StringImpl;
767 using WTF::equal; 769 using WTF::equal;
768 using WTF::equalNonNull; 770 using WTF::equalNonNull;
769 using WTF::TextCaseSensitivity; 771 using WTF::TextCaseSensitivity;
770 using WTF::TextCaseSensitive; 772 using WTF::TextCaseSensitive;
771 using WTF::TextCaseInsensitive; 773 using WTF::TextCaseInsensitive;
772 774
773 #endif 775 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/text/StringImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698