Warnings for new C++ buffer API

This commit is contained in:
Ryan Dahl
2010-10-09 12:15:14 -07:00
parent ae87007478
commit b5359e40be
2 changed files with 34 additions and 30 deletions

View File

@@ -4,6 +4,7 @@
#include <node.h>
#include <node_object_wrap.h>
#include <v8.h>
#include <assert.h>
namespace node {
@@ -39,8 +40,16 @@ class Buffer : public ObjectWrap {
static char* Data(v8::Handle<v8::Object>);
static size_t Length(v8::Handle<v8::Object>);
char* data();
size_t length() const { return length_; }
char* data() {
assert(0 && "v0.3 API change: Use node::Buffer::Data().");
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);