OLD | NEW |
1 // Copyright 2007-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2009 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 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 * the contents of the string and the NULL terminator into the | 848 * the contents of the string and the NULL terminator into the |
849 * buffer. | 849 * buffer. |
850 * | 850 * |
851 * Copies up to length characters into the output buffer. | 851 * Copies up to length characters into the output buffer. |
852 * Only null-terminates if there is enough space in the buffer. | 852 * Only null-terminates if there is enough space in the buffer. |
853 * | 853 * |
854 * \param buffer The buffer into which the string will be copied. | 854 * \param buffer The buffer into which the string will be copied. |
855 * \param start The starting position within the string at which | 855 * \param start The starting position within the string at which |
856 * copying begins. | 856 * copying begins. |
857 * \param length The number of bytes to copy from the string. | 857 * \param length The number of bytes to copy from the string. |
858 * \return The number of characters copied to the buffer | 858 * \param nchars The number of characters written. |
| 859 * \return The number of bytes copied to the buffer |
859 * excluding the NULL terminator. | 860 * excluding the NULL terminator. |
860 */ | 861 */ |
861 int Write(uint16_t* buffer, int start = 0, int length = -1) const; // UTF-16 | 862 int Write(uint16_t* buffer, int start = 0, int length = -1) const; // UTF-16 |
862 int WriteAscii(char* buffer, int start = 0, int length = -1) const; // ASCII | 863 int WriteAscii(char* buffer, int start = 0, int length = -1) const; // ASCII |
863 int WriteUtf8(char* buffer, int length = -1) const; // UTF-8 | 864 int WriteUtf8(char* buffer, |
| 865 int length = -1, |
| 866 int* nchars_ref = NULL) const; // UTF-8 |
864 | 867 |
865 /** | 868 /** |
866 * A zero length string. | 869 * A zero length string. |
867 */ | 870 */ |
868 static v8::Local<v8::String> Empty(); | 871 static v8::Local<v8::String> Empty(); |
869 | 872 |
870 /** | 873 /** |
871 * Returns true if the string is external | 874 * Returns true if the string is external |
872 */ | 875 */ |
873 bool IsExternal() const; | 876 bool IsExternal() const; |
(...skipping 2515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3389 | 3392 |
3390 } // namespace v8 | 3393 } // namespace v8 |
3391 | 3394 |
3392 | 3395 |
3393 #undef V8EXPORT | 3396 #undef V8EXPORT |
3394 #undef V8EXPORT_INLINE | 3397 #undef V8EXPORT_INLINE |
3395 #undef TYPE_CHECK | 3398 #undef TYPE_CHECK |
3396 | 3399 |
3397 | 3400 |
3398 #endif // V8_H_ | 3401 #endif // V8_H_ |
OLD | NEW |