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

Side by Side Diff: Source/wtf/text/WTFString.cpp

Issue 313993002: Bindings: Add ScalarValueString support (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« Source/wtf/text/WTFString.h ('K') | « Source/wtf/text/WTFString.h ('k') | no next file » | 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, 2010, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2012 Apple Inc. All rights reserved.
4 * Copyright (C) 2007-2009 Torch Mobile, Inc. 4 * Copyright (C) 2007-2009 Torch Mobile, Inc.
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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 return false; 428 return false;
429 429
430 if (m_impl->is8Bit()) 430 if (m_impl->is8Bit())
431 result = charactersToIntStrict(m_impl->characters8(), m_impl->length() - 1); 431 result = charactersToIntStrict(m_impl->characters8(), m_impl->length() - 1);
432 else 432 else
433 result = charactersToIntStrict(m_impl->characters16(), m_impl->length() - 1); 433 result = charactersToIntStrict(m_impl->characters16(), m_impl->length() - 1);
434 434
435 return true; 435 return true;
436 } 436 }
437 437
438 String String::toScalarValueString() const
439 {
440 if (!m_impl)
441 return String();
442 return m_impl->replaceUnpairedSurrogates();
443 }
444
438 Vector<UChar> String::charactersWithNullTermination() const 445 Vector<UChar> String::charactersWithNullTermination() const
439 { 446 {
440 if (!m_impl) 447 if (!m_impl)
441 return Vector<UChar>(); 448 return Vector<UChar>();
442 449
443 Vector<UChar> result; 450 Vector<UChar> result;
444 result.reserveInitialCapacity(length() + 1); 451 result.reserveInitialCapacity(length() + 1);
445 appendTo(result); 452 appendTo(result);
446 result.append(0); 453 result.append(0);
447 return result; 454 return result;
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after
1266 buffer.append('\0'); 1273 buffer.append('\0');
1267 return buffer; 1274 return buffer;
1268 } 1275 }
1269 1276
1270 Vector<char> asciiDebug(String& string) 1277 Vector<char> asciiDebug(String& string)
1271 { 1278 {
1272 return asciiDebug(string.impl()); 1279 return asciiDebug(string.impl());
1273 } 1280 }
1274 1281
1275 #endif 1282 #endif
OLDNEW
« Source/wtf/text/WTFString.h ('K') | « Source/wtf/text/WTFString.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698