Chromium Code Reviews

Side by Side Diff: include/v8.h

Issue 121173009: String:WriteUtf8: Add REPLACE_INVALID_UTF8 option (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Latest version Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/api.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1628 matching lines...)
1639 * \param options Various options that might affect performance of this or 1639 * \param options Various options that might affect performance of this or
1640 * subsequent operations. 1640 * subsequent operations.
1641 * \return The number of characters copied to the buffer excluding the null 1641 * \return The number of characters copied to the buffer excluding the null
1642 * terminator. For WriteUtf8: The number of bytes copied to the buffer 1642 * terminator. For WriteUtf8: The number of bytes copied to the buffer
1643 * including the null terminator (if written). 1643 * including the null terminator (if written).
1644 */ 1644 */
1645 enum WriteOptions { 1645 enum WriteOptions {
1646 NO_OPTIONS = 0, 1646 NO_OPTIONS = 0,
1647 HINT_MANY_WRITES_EXPECTED = 1, 1647 HINT_MANY_WRITES_EXPECTED = 1,
1648 NO_NULL_TERMINATION = 2, 1648 NO_NULL_TERMINATION = 2,
1649 PRESERVE_ASCII_NULL = 4 1649 PRESERVE_ASCII_NULL = 4,
1650 // Used by WriteUtf8 to replace invalid code points, i.e. lone surrogate
1651 // code units, with the unicode replacement character.
1652 // @TODO Rename to REPLACE_INVALID_UTF8?
dcarney 2014/01/13 09:19:56 sure
haimuiba 2014/01/15 10:52:34 Done.
1653 DISALLOW_INVALID_UTF8 = 8
1650 }; 1654 };
1651 1655
1652 // 16-bit character codes. 1656 // 16-bit character codes.
1653 int Write(uint16_t* buffer, 1657 int Write(uint16_t* buffer,
1654 int start = 0, 1658 int start = 0,
1655 int length = -1, 1659 int length = -1,
1656 int options = NO_OPTIONS) const; 1660 int options = NO_OPTIONS) const;
1657 // One byte characters. 1661 // One byte characters.
1658 int WriteOneByte(uint8_t* buffer, 1662 int WriteOneByte(uint8_t* buffer,
1659 int start = 0, 1663 int start = 0,
(...skipping 4776 matching lines...)
6436 */ 6440 */
6437 6441
6438 6442
6439 } // namespace v8 6443 } // namespace v8
6440 6444
6441 6445
6442 #undef TYPE_CHECK 6446 #undef TYPE_CHECK
6443 6447
6444 6448
6445 #endif // V8_H_ 6449 #endif // V8_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/api.cc » ('J')

Powered by Google App Engine