Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrevor Norris <trev.norris@gmail.com>2013-06-20 00:07:24 +0400
committerTrevor Norris <trev.norris@gmail.com>2013-06-20 00:15:05 +0400
commitf5e13ae9b5ca6eaacbcf9aad36552d9cd6c8bde6 (patch)
treeb4710ab727987bd160a49f69140be74c32332a45 /src/node_buffer.h
parentbf8dc0762a365302f742da85fa416886332ab73d (diff)
buffer: write strings directly from call
Buffer(<String>) used to pass the string to js where it would then be passed back to cpp for processing. Now only the buffer object instantiation is done in js and the string is processed in cpp. Also added a Buffer api that also accepts the encoding.
Diffstat (limited to 'src/node_buffer.h')
-rw-r--r--src/node_buffer.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/node_buffer.h b/src/node_buffer.h
index fe2abb9e5e0..37468f2d371 100644
--- a/src/node_buffer.h
+++ b/src/node_buffer.h
@@ -42,7 +42,8 @@ NODE_EXTERN size_t Length(v8::Handle<v8::Object> val);
// public constructor
NODE_EXTERN v8::Local<v8::Object> New(size_t length);
// public constructor from string
-NODE_EXTERN v8::Local<v8::Object> New(v8::Handle<v8::String> string);
+NODE_EXTERN v8::Local<v8::Object> New(v8::Handle<v8::String> string,
+ enum encoding enc = UTF8);
// public constructor - data is copied
// TODO(trevnorris): should be something like Copy()
NODE_EXTERN v8::Local<v8::Object> New(const char* data, size_t len);