Bert Belder
4a2cb07808
Fix whitespace errors introduced by porting efforts
14 years ago
Bert Belder
6d1af51de6
Fix header files for node_buffer.cc
14 years ago
Sean Braithwaite
fcc38129a3
Check buffer length using string length
+ Utf8Length is really slow but has the same semantics in this case
14 years ago
Tom Hughes
6285fac232
Allocations with new[] must be freed with delete[].
See http://valgrind.org/docs/manual/mc-manual.html#mc-manual.rudefn
14 years ago
Ryan Dahl
2320497992
Revert "Merge branch 'writev'"
This reverts commit cd9515efd9
, reversing
changes made to df46c8e698
.
Too slow. Needs more work.
14 years ago
Ryan Dahl
56074d1056
Inline Buffer::Length and Buffer::Data
14 years ago
Ryan Dahl
3884b4185a
Small clean ups
14 years ago
Ryan Dahl
d74c506044
Support encoding
14 years ago
Ryan Dahl
dcc4fffe4d
Add C++ API for constructing fast buffer from string
14 years ago
Stéphan Kochen
dd52737476
Provide a C++ Buffer constructor for external storage.
In order to do this, buffer data management was moved out of the
JS entry-point New, and into Replace.
Secondly, the constructor makes an immediate call to Replace, and
in order for ArrayData calls to work, wrapping must already be set
up. Now, the constructor takes the wrappee as a parameter.
14 years ago
Stéphan Kochen
b3e60c7b25
Generalize Buffer::Copy to work with all unsigned byte external data.
14 years ago
Stéphan Kochen
d5e966154c
Simplify things by using `*ArrayData` everywhere.
14 years ago
Stéphan Kochen
d9b08d66d6
Remove old interface remains from Buffer.
These were all lacking implementation, so deprecating wouldn't help.
14 years ago
Jorge Chamorro Bieling
c735b4663a
unbase64 skips over *any* illegal chars
14 years ago
Ryan Dahl
cf1db4f304
base64 decode should handle whitespace
14 years ago
Ryan Dahl
9d248f690a
Fix return in Buffer::New
14 years ago
Ryan Dahl
0cf03ab800
Add char* constructor for Buffer
14 years ago
Ryan Dahl
fe74283e1d
Fix a few compiler warnings...
14 years ago
Ryan Dahl
b5359e40be
Warnings for new C++ buffer API
14 years ago
Ben Noordhuis
55c65cc2d5
Safe constructor for ObjectWrapped classes
New() methods should be invoked as constructors, not regular functions.
Corner cases like Script::New() may cause a SIGSEGV when the GC is run.
More details: http://groups.google.com/group/nodejs/browse_thread/thread/a7e5db68d4cd6356
14 years ago
Ryan Dahl
b8bfbdab48
Rename SlowBuffer in binding
14 years ago
Ryan Dahl
5bc4efe820
Remove blobs, simplify SlowBuffer
Implement SlowBuffer.prototype.slice in js
14 years ago
Ryan Dahl
380d12832c
Remove dead code
14 years ago
Ryan Dahl
efc723787a
Fix big string bug
14 years ago
Ryan Dahl
71d67dbf48
Remove fancy SlowBuffer constructor
14 years ago
Ryan Dahl
6135941eea
Fix ByteLength hangup
14 years ago
Ryan Dahl
ececd92f62
Fix base64 write for buffers
14 years ago
Ryan Dahl
1f947f7b41
remove unnecessary casts
14 years ago
Ryan Dahl
7b772f3f68
More fast buffer work
14 years ago
Ryan Dahl
d5bdda74c1
fast buffer bounds checking in copy()
14 years ago
Ryan Dahl
1cf538a60a
Work to get C++ fast buffers. incomplete
14 years ago
Ryan Dahl
565d862f3c
Fix buffer binding
14 years ago
Tim-Smart
746d487da8
FastBuffer implementation. API needs migration
14 years ago
Ryan Dahl
f86ad1693f
Safe Constructor: Buffer
14 years ago
Ryan Dahl
488aff085b
Improve appendix markdown
14 years ago
Ryan Dahl
7db5c8a10d
Fix toString('base64') bug
Thanks to Stepan Stolyarov for the test case.
14 years ago
Ryan Dahl
c38dd24dc5
Fix style
14 years ago
Ben Noordhuis
f72ac17c89
Buffer: graciously handle padding in base64-encoded input.
14 years ago
Ryan Dahl
f291fbc8a7
Fix ending \0 in base64 decoding
14 years ago
Ben Noordhuis
95638c9b0d
Buffer: adjust buffer size so the base64-decoded input fits snugly.
Stops Valgrind from complaining about uninitialized memory access.
14 years ago
Benjamin Kramer
eeaf1ef970
Constify read-only global data
Also silences a compiler warning about deprecated conversion from const
char* to char*.
14 years ago
Ryan Dahl
2c1ca4078d
Implement buffer.write for base64
There might be an off-by-one on the returned value.
14 years ago
Ryan Dahl
528015e0d8
Implement buffer.toString('base64')
14 years ago
Peter Griess
e7c4f8cdaa
Buffer.copy() should liberally allow empty copies.
15 years ago
Peter Griess
b64a521d66
Buffer('') should create a 0-length buffer
15 years ago
Paul Querna
82daa46e26
Move Buffer to extension model.
15 years ago
Blake Mizerany
8c8534046c
fix whitespace errors
15 years ago
Matt Ranney
02ed0ec93b
On overlapping buffers use memmove
15 years ago
Ryan Dahl
5e86d01385
Revert "Buffer.copy should copy through sourceEnd, as specified."
This reverts commit a2f70da4c9
.
Keep tests modifies a few edge checks on Copy()
15 years ago
Matt Ranney
a2f70da4c9
Buffer.copy should copy through sourceEnd, as specified.
Improve test-buffer.js to cover all copy error cases.
Fix off by one error in string_decoder.
15 years ago