Create a new native Bytes implementation, use it instead of ByteArray for better ByteArray and Bytes support

This commit is contained in:
Joshua Granick
2015-06-19 14:10:59 -07:00
parent 3ef182f113
commit d73460da18
33 changed files with 563 additions and 258 deletions

View File

@@ -0,0 +1,39 @@
#ifndef LIME_UTILS_BYTES_H
#define LIME_UTILS_BYTES_H
#include <hx/CFFI.h>
#include <utils/QuickVec.h>
namespace lime {
struct Bytes {
Bytes ();
Bytes (int size);
Bytes (value bytes);
Bytes (const char* path);
Bytes (const QuickVec<unsigned char> data);
~Bytes ();
unsigned char *Data ();
const unsigned char *Data () const;
int Length () const;
void Resize (int size);
value Value ();
unsigned char *_data;
int _length;
value _value;
};
}
#endif