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

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: Rebase Created 6 years, 11 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
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »
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 1610 matching lines...) Expand 10 before | Expand all | Expand 10 after
1621 * \param options Various options that might affect performance of this or 1621 * \param options Various options that might affect performance of this or
1622 * subsequent operations. 1622 * subsequent operations.
1623 * \return The number of characters copied to the buffer excluding the null 1623 * \return The number of characters copied to the buffer excluding the null
1624 * terminator. For WriteUtf8: The number of bytes copied to the buffer 1624 * terminator. For WriteUtf8: The number of bytes copied to the buffer
1625 * including the null terminator (if written). 1625 * including the null terminator (if written).
1626 */ 1626 */
1627 enum WriteOptions { 1627 enum WriteOptions {
1628 NO_OPTIONS = 0, 1628 NO_OPTIONS = 0,
1629 HINT_MANY_WRITES_EXPECTED = 1, 1629 HINT_MANY_WRITES_EXPECTED = 1,
1630 NO_NULL_TERMINATION = 2, 1630 NO_NULL_TERMINATION = 2,
1631 PRESERVE_ASCII_NULL = 4 1631 PRESERVE_ASCII_NULL = 4,
1632 // Used by WriteUtf8 to replace orphan surrogate code units with the
1633 // unicode replacement character. Needs to be set to guarantee valid UTF-8
1634 // output.
1635 REPLACE_INVALID_UTF8 = 8
1632 }; 1636 };
1633 1637
1634 // 16-bit character codes. 1638 // 16-bit character codes.
1635 int Write(uint16_t* buffer, 1639 int Write(uint16_t* buffer,
1636 int start = 0, 1640 int start = 0,
1637 int length = -1, 1641 int length = -1,
1638 int options = NO_OPTIONS) const; 1642 int options = NO_OPTIONS) const;
1639 // One byte characters. 1643 // One byte characters.
1640 int WriteOneByte(uint8_t* buffer, 1644 int WriteOneByte(uint8_t* buffer,
1641 int start = 0, 1645 int start = 0,
(...skipping 4782 matching lines...) Expand 10 before | Expand all | Expand 10 after
6424 */ 6428 */
6425 6429
6426 6430
6427 } // namespace v8 6431 } // namespace v8
6428 6432
6429 6433
6430 #undef TYPE_CHECK 6434 #undef TYPE_CHECK
6431 6435
6432 6436
6433 #endif // V8_H_ 6437 #endif // V8_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698