aboutsummaryrefslogtreecommitdiff
path: root/archive/hge/CxImage/xmemfile.h
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2015-10-26 22:52:36 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2015-10-26 22:52:36 +0800
commit3bd383baf6a17e734329e1fc677c7e86283db772 (patch)
tree69a9148087577f797624ceb9c71323a2563d6bb4 /archive/hge/CxImage/xmemfile.h
parent543e4f570be9b279ba558ca61cc02cda251af384 (diff)
downloadbullet-lab-remix-3bd383baf6a17e734329e1fc677c7e86283db772.tar.xz
Added support for relative line numbers.
Added instructions for, brk and cont. (They are still untested...) Parser code cleanup. Removed garbage output to stderr. Reorganize the repository structure. Updated BLR2 code move it into archive. Added BLR1 files.
Diffstat (limited to 'archive/hge/CxImage/xmemfile.h')
-rw-r--r--archive/hge/CxImage/xmemfile.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/archive/hge/CxImage/xmemfile.h b/archive/hge/CxImage/xmemfile.h
new file mode 100644
index 0000000..e132db3
--- /dev/null
+++ b/archive/hge/CxImage/xmemfile.h
@@ -0,0 +1,42 @@
+#if !defined(__xmemfile_h)
+#define __xmemfile_h
+
+#include "xfile.h"
+
+//////////////////////////////////////////////////////////
+class DLL_EXP CxMemFile : public CxFile
+{
+public:
+ CxMemFile(uint8_t* pBuffer = NULL, uint32_t size = 0);
+ ~CxMemFile();
+
+ bool Open();
+ uint8_t* GetBuffer(bool bDetachBuffer = true);
+
+ virtual bool Close();
+ virtual size_t Read(void *buffer, size_t size, size_t count);
+ virtual size_t Write(const void *buffer, size_t size, size_t count);
+ virtual bool Seek(int32_t offset, int32_t origin);
+ virtual int32_t Tell();
+ virtual int32_t Size();
+ virtual bool Flush();
+ virtual bool Eof();
+ virtual int32_t Error();
+ virtual bool PutC(uint8_t c);
+ virtual int32_t GetC();
+ virtual char * GetS(char *string, int32_t n);
+ virtual int32_t Scanf(const char *format, void* output);
+
+protected:
+ bool Alloc(uint32_t nBytes);
+ void Free();
+
+ uint8_t* m_pBuffer;
+ uint32_t m_Size;
+ bool m_bFreeOnClose;
+ int32_t m_Position; //current position
+ int32_t m_Edge; //buffer size
+ bool m_bEOF;
+};
+
+#endif