Permalink
Browse files

Remove old interface remains from Buffer.

These were all lacking implementation, so deprecating wouldn't help.
  • Loading branch information...
1 parent b2969a9 commit d9b08d66d6a7999601bc05a20f477e40c9dc1d71 @stephank stephank committed with ry Oct 21, 2010
Showing with 2 additions and 22 deletions.
  1. +0 −1 src/node_buffer.cc
  2. +2 −21 src/node_buffer.h
View
@@ -168,7 +168,6 @@ Handle<Value> Buffer::New(const Arguments &args) {
Buffer::Buffer(size_t length) : ObjectWrap() {
- off_ = 0;
length_ = length;
data_ = new char[length_];
View
@@ -13,22 +13,11 @@ namespace node {
* individual bytes with [] and slice it into substrings or sub-buffers
* without copying memory.
*
- * // return an ascii encoded string - no memory iscopied
- * buffer.asciiSlide(0, 3)
- *
- * // returns another buffer - no memory is copied
- * buffer.slice(0, 3)
- *
- * Interally, each javascript buffer object is backed by a "struct buffer"
- * object. These "struct buffer" objects are either a root buffer (in the
- * case that buffer->root == NULL) or slice objects (in which case
- * buffer->root != NULL). A root buffer is only GCed once all its slices
- * are GCed.
+ * // return an ascii encoded string - no memory is copied
+ * buffer.asciiSlice(0, 3)
*/
-struct Blob_;
-
class Buffer : public ObjectWrap {
public:
~Buffer();
@@ -46,20 +35,15 @@ class Buffer : public ObjectWrap {
return NULL;
}
-
size_t length() const {
assert(0 && "v0.3 API change: Use node::Buffer::Length().");
return 0;
}
- int AsciiWrite(char *string, int offset, int length);
- int Utf8Write(char *string, int offset, int length);
-
private:
static v8::Persistent<v8::FunctionTemplate> constructor_template;
static v8::Handle<v8::Value> New(const v8::Arguments &args);
- static v8::Handle<v8::Value> Slice(const v8::Arguments &args);
static v8::Handle<v8::Value> BinarySlice(const v8::Arguments &args);
static v8::Handle<v8::Value> AsciiSlice(const v8::Arguments &args);
static v8::Handle<v8::Value> Base64Slice(const v8::Arguments &args);
@@ -70,13 +54,10 @@ class Buffer : public ObjectWrap {
static v8::Handle<v8::Value> Utf8Write(const v8::Arguments &args);
static v8::Handle<v8::Value> ByteLength(const v8::Arguments &args);
static v8::Handle<v8::Value> MakeFastBuffer(const v8::Arguments &args);
- static v8::Handle<v8::Value> Unpack(const v8::Arguments &args);
static v8::Handle<v8::Value> Copy(const v8::Arguments &args);
Buffer(size_t length);
- Buffer(Buffer *parent, size_t start, size_t end);
- size_t off_;
size_t length_;
char* data_;
};

0 comments on commit d9b08d6

Please sign in to comment.