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

Unified Diff: include/v8.h

Issue 11852019: Prepare API for webkit use of Latin-1 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Changed mind Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/api.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 5d8c1952e30510ee4c72521050a7b1d0211b7edc..aab5f9c524a6e27e3560a93ed01e63346f101581 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -1064,7 +1064,8 @@ class String : public Primitive {
enum Encoding {
UNKNOWN_ENCODING = 0x1,
TWO_BYTE_ENCODING = 0x0,
- ASCII_ENCODING = 0x4
+ ASCII_ENCODING = 0x4,
+ ONE_BYTE_ENCODING = 0x4
};
/**
* Returns the number of characters in this string.
@@ -1086,6 +1087,11 @@ class String : public Primitive {
V8EXPORT bool MayContainNonAscii() const;
/**
+ * Returns whether this string contains only one byte data.
+ */
+ V8EXPORT bool IsOneByte() const;
+
+ /**
* Write the contents of the string to an external buffer.
* If no arguments are given, expects the buffer to be large
* enough to hold the entire string and NULL terminator. Copies
@@ -1127,6 +1133,11 @@ class String : public Primitive {
int start = 0,
int length = -1,
int options = NO_OPTIONS) const;
+ // One byte characters.
+ V8EXPORT int WriteOneByte(uint8_t* buffer,
+ int start = 0,
+ int length = -1,
+ int options = NO_OPTIONS) const;
// UTF-8 encoded characters.
V8EXPORT int WriteUtf8(char* buffer,
int length = -1,
@@ -1228,6 +1239,8 @@ class String : public Primitive {
ExternalAsciiStringResource() {}
};
+ typedef ExternalAsciiStringResource ExternalOneByteStringResource;
+
/**
* If the string is an external string, return the ExternalStringResourceBase
* regardless of the encoding, otherwise return NULL. The encoding of the
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698