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

Side by Side Diff: sky/engine/wtf/text/WTFString.h

Issue 678683004: HTMLImportLoader should talk directly to mojo::NetworkService (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: address reviewer comments Created 6 years, 1 month 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 | « sky/engine/wtf/text/CString.h ('k') | sky/engine/wtf/text/WTFString.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 * (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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 { 172 {
173 if (!m_impl) 173 if (!m_impl)
174 return 0; 174 return 0;
175 return m_impl->length() * (is8Bit() ? sizeof(LChar) : sizeof(UChar)); 175 return m_impl->length() * (is8Bit() ? sizeof(LChar) : sizeof(UChar));
176 } 176 }
177 177
178 CString ascii() const; 178 CString ascii() const;
179 CString latin1() const; 179 CString latin1() const;
180 CString utf8(UTF8ConversionMode = LenientUTF8Conversion) const; 180 CString utf8(UTF8ConversionMode = LenientUTF8Conversion) const;
181 181
182 // We should replace CString with std::string.
183 std::string toUTF8() const;
184
182 UChar operator[](unsigned index) const 185 UChar operator[](unsigned index) const
183 { 186 {
184 if (!m_impl || index >= m_impl->length()) 187 if (!m_impl || index >= m_impl->length())
185 return 0; 188 return 0;
186 return (*m_impl)[index]; 189 return (*m_impl)[index];
187 } 190 }
188 191
189 static String number(int); 192 static String number(int);
190 static String number(unsigned); 193 static String number(unsigned);
191 static String number(long); 194 static String number(long);
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 396
394 static String make16BitFrom8BitSource(const LChar*, size_t); 397 static String make16BitFrom8BitSource(const LChar*, size_t);
395 398
396 // String::fromUTF8 will return a null string if 399 // String::fromUTF8 will return a null string if
397 // the input data contains invalid UTF-8 sequences. 400 // the input data contains invalid UTF-8 sequences.
398 static String fromUTF8(const LChar*, size_t); 401 static String fromUTF8(const LChar*, size_t);
399 static String fromUTF8(const LChar*); 402 static String fromUTF8(const LChar*);
400 static String fromUTF8(const char* s, size_t length) { return fromUTF8(reint erpret_cast<const LChar*>(s), length); }; 403 static String fromUTF8(const char* s, size_t length) { return fromUTF8(reint erpret_cast<const LChar*>(s), length); };
401 static String fromUTF8(const char* s) { return fromUTF8(reinterpret_cast<con st LChar*>(s)); }; 404 static String fromUTF8(const char* s) { return fromUTF8(reinterpret_cast<con st LChar*>(s)); };
402 static String fromUTF8(const CString&); 405 static String fromUTF8(const CString&);
406 static String fromUTF8(const std::string& s) { return fromUTF8(s.data(), s.s ize()); }
403 407
404 // Tries to convert the passed in string to UTF-8, but will fall back to Lat in-1 if the string is not valid UTF-8. 408 // Tries to convert the passed in string to UTF-8, but will fall back to Lat in-1 if the string is not valid UTF-8.
405 static String fromUTF8WithLatin1Fallback(const LChar*, size_t); 409 static String fromUTF8WithLatin1Fallback(const LChar*, size_t);
406 static String fromUTF8WithLatin1Fallback(const char* s, size_t length) { ret urn fromUTF8WithLatin1Fallback(reinterpret_cast<const LChar*>(s), length); }; 410 static String fromUTF8WithLatin1Fallback(const char* s, size_t length) { ret urn fromUTF8WithLatin1Fallback(reinterpret_cast<const LChar*>(s), length); };
407 411
408 bool containsOnlyASCII() const; 412 bool containsOnlyASCII() const;
409 bool containsOnlyLatin1() const; 413 bool containsOnlyLatin1() const;
410 bool containsOnlyWhitespace() const { return !m_impl || m_impl->containsOnly Whitespace(); } 414 bool containsOnlyWhitespace() const { return !m_impl || m_impl->containsOnly Whitespace(); }
411 415
412 // Hash table deleted values, which are only constructed and never copied or destroyed. 416 // Hash table deleted values, which are only constructed and never copied or destroyed.
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 using WTF::charactersToFloat; 683 using WTF::charactersToFloat;
680 using WTF::equal; 684 using WTF::equal;
681 using WTF::equalIgnoringCase; 685 using WTF::equalIgnoringCase;
682 using WTF::find; 686 using WTF::find;
683 using WTF::isAllSpecialCharacters; 687 using WTF::isAllSpecialCharacters;
684 using WTF::isSpaceOrNewline; 688 using WTF::isSpaceOrNewline;
685 using WTF::reverseFind; 689 using WTF::reverseFind;
686 690
687 #include "wtf/text/AtomicString.h" 691 #include "wtf/text/AtomicString.h"
688 #endif // WTFString_h 692 #endif // WTFString_h
OLDNEW
« no previous file with comments | « sky/engine/wtf/text/CString.h ('k') | sky/engine/wtf/text/WTFString.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698