diff options
author | chai <chaifix@163.com> | 2018-07-26 23:58:12 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-07-26 23:58:12 +0800 |
commit | 1a882936e91826e4d69584745e16a79650272015 (patch) | |
tree | 61572b11d766fcb8cfa9e98f001c5fecc5712d7c /src/libjin/Filesystem/Buffer.h | |
parent | 977b845c3e09a5b51895be81ef7514ae4030f588 (diff) |
*change name
Diffstat (limited to 'src/libjin/Filesystem/Buffer.h')
-rw-r--r-- | src/libjin/Filesystem/Buffer.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/libjin/Filesystem/Buffer.h b/src/libjin/Filesystem/Buffer.h new file mode 100644 index 0000000..7571c2d --- /dev/null +++ b/src/libjin/Filesystem/Buffer.h @@ -0,0 +1,53 @@ +#ifndef __JIN_BUFFER_H +#define __JIN_BUFFER_H + +#include <string.h> + +namespace jin +{ +namespace fs +{ + + class Buffer + { + public: + + inline Buffer(): data(0), size(0) + { + } + + inline Buffer(const Buffer& src) + { + delete data; + size = src.size; + data = new char[size]; + memcpy(data, src.data, size); + } + + inline Buffer(void* d, int s) + { + data = new char(size); + memcpy(data, d, size); + size = s; + } + + inline ~Buffer() + { + size = 0; + delete[] data; + } + + public: + + // data position in memory + void* data; + + // data buffer size + unsigned int size; + + }; + +} +} + +#endif
\ No newline at end of file |