OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. |
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> | 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> |
6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. | 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. |
9 * Copyright (C) 2012 Intel Corporation. All rights reserved. | 9 * Copyright (C) 2012 Intel Corporation. All rights reserved. |
10 * | 10 * |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 appendTo.append('\"'); | 256 appendTo.append('\"'); |
257 } | 257 } |
258 | 258 |
259 String serializeString(const String& string) | 259 String serializeString(const String& string) |
260 { | 260 { |
261 StringBuilder builder; | 261 StringBuilder builder; |
262 serializeString(string, builder); | 262 serializeString(string, builder); |
263 return builder.toString(); | 263 return builder.toString(); |
264 } | 264 } |
265 | 265 |
| 266 String serializeStringWithoutQuotations(const String& string) |
| 267 { |
| 268 StringBuilder appendTo; |
| 269 unsigned index = 0; |
| 270 while (index < string.length()) { |
| 271 UChar32 c = string.characterStartingAt(index); |
| 272 index += U16_LENGTH(c); |
| 273 if (c <= 0x1f) |
| 274 serializeCharacterAsCodePoint(c, appendTo); |
| 275 else if (c == 0x22 || c == 0x5c) |
| 276 serializeCharacter(c, appendTo); |
| 277 else |
| 278 appendTo.append(c); |
| 279 } |
| 280 return appendTo.toString(); |
| 281 } |
| 282 |
266 } // namespace blink | 283 } // namespace blink |
OLD | NEW |