OLD | NEW |
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 Loading... |
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 Loading... |
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_ |
OLD | NEW |