aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Common/data.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libjin/Common/data.h')
-rw-r--r--src/libjin/Common/data.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/libjin/Common/data.h b/src/libjin/Common/data.h
new file mode 100644
index 0000000..7fcc389
--- /dev/null
+++ b/src/libjin/Common/data.h
@@ -0,0 +1,32 @@
+#ifndef __JIN_COMMON_DATA_H
+#define __JIN_COMMON_DATA_H
+
+namespace jin
+{
+
+ class DataBuffer
+ {
+ public:
+ DataBuffer(int n)
+ : len(n)
+ {
+ buffer = new char[len];
+ memset(buffer, 0, len);
+ }
+ ~DataBuffer()
+ {
+ delete[] buffer;
+ }
+ char* operator&()
+ {
+ return buffer;
+ }
+
+ private:
+ char* buffer;
+ int len;
+ };
+
+} // jin
+
+#endif \ No newline at end of file