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

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

Issue 2025503002: Revert of Expand WTF::StringView's API to be more like StringPiece. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 12 matching lines...) Expand all
23 #define WTFString_h 23 #define WTFString_h
24 24
25 // This file would be called String.h, but that conflicts with <string.h> 25 // This file would be called String.h, but that conflicts with <string.h>
26 // on systems without case-sensitive file systems. 26 // on systems without case-sensitive file systems.
27 27
28 #include "wtf/Allocator.h" 28 #include "wtf/Allocator.h"
29 #include "wtf/HashTableDeletedValueType.h" 29 #include "wtf/HashTableDeletedValueType.h"
30 #include "wtf/WTFExport.h" 30 #include "wtf/WTFExport.h"
31 #include "wtf/text/ASCIIFastPath.h" 31 #include "wtf/text/ASCIIFastPath.h"
32 #include "wtf/text/StringImpl.h" 32 #include "wtf/text/StringImpl.h"
33 #include "wtf/text/StringView.h"
33 #include <algorithm> 34 #include <algorithm>
34 #include <iosfwd> 35 #include <iosfwd>
35 36
36 #ifdef __OBJC__ 37 #ifdef __OBJC__
37 #include <objc/objc.h> 38 #include <objc/objc.h>
38 #endif 39 #endif
39 40
40 namespace WTF { 41 namespace WTF {
41 42
42 class CString; 43 class CString;
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 336
336 void ensure16Bit(); 337 void ensure16Bit();
337 338
338 void truncate(unsigned len); 339 void truncate(unsigned len);
339 void remove(unsigned pos, int len = 1); 340 void remove(unsigned pos, int len = 1);
340 341
341 String substring(unsigned pos, unsigned len = UINT_MAX) const; 342 String substring(unsigned pos, unsigned len = UINT_MAX) const;
342 String left(unsigned len) const { return substring(0, len); } 343 String left(unsigned len) const { return substring(0, len); }
343 String right(unsigned len) const { return substring(length() - len, len); } 344 String right(unsigned len) const { return substring(length() - len, len); }
344 345
346 StringView createView() const { return StringView(impl()); }
347 StringView createView(unsigned offset, unsigned length) const { return Strin gView(impl(), offset, length); }
348
345 // Returns a lowercase/uppercase version of the string 349 // Returns a lowercase/uppercase version of the string
346 String lower() const; 350 String lower() const;
347 String upper() const; 351 String upper() const;
348 352
349 String lower(const AtomicString& localeIdentifier) const; 353 String lower(const AtomicString& localeIdentifier) const;
350 String upper(const AtomicString& localeIdentifier) const; 354 String upper(const AtomicString& localeIdentifier) const;
351 355
352 String stripWhiteSpace() const; 356 String stripWhiteSpace() const;
353 String stripWhiteSpace(IsWhiteSpaceFunctionPtr) const; 357 String stripWhiteSpace(IsWhiteSpaceFunctionPtr) const;
354 String simplifyWhiteSpace(StripBehavior = StripExtraWhiteSpace) const; 358 String simplifyWhiteSpace(StripBehavior = StripExtraWhiteSpace) const;
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 using WTF::charactersToFloat; 707 using WTF::charactersToFloat;
704 using WTF::equal; 708 using WTF::equal;
705 using WTF::equalIgnoringCase; 709 using WTF::equalIgnoringCase;
706 using WTF::find; 710 using WTF::find;
707 using WTF::isAllSpecialCharacters; 711 using WTF::isAllSpecialCharacters;
708 using WTF::isSpaceOrNewline; 712 using WTF::isSpaceOrNewline;
709 using WTF::reverseFind; 713 using WTF::reverseFind;
710 714
711 #include "wtf/text/AtomicString.h" 715 #include "wtf/text/AtomicString.h"
712 #endif // WTFString_h 716 #endif // WTFString_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringViewTest.cpp ('k') | third_party/WebKit/Source/wtf/wtf.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698