forked from osoumen/C700
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDataBuffer.h
40 lines (33 loc) · 871 Bytes
/
DataBuffer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* DataBuffer.h
* C700
*
* Created by osoumen on 12/10/10.
* Copyright 2012 __MyCompanyName__. All rights reserved.
*
*/
#pragma once
#include "C700defines.h"
#if _WIN32
#include <windows.h>
#endif
class DataBuffer {
public:
DataBuffer( int allocMemSize );
DataBuffer( const void *data, int dataSize );
virtual ~DataBuffer();
const unsigned char *GetDataPtr() const { return m_pData; }
int GetDataSize() const { return mDataUsed; }
int GetDataPos() const { return mDataPos; }
void AdvDataPos( int adv ) { mDataPos+=adv; }
bool setPos( int pos );
bool readData( void *data, long byte, long *actualReadByte );
bool writeData( const void *data, long byte, long *actualWriteByte );
protected:
bool mIsBufferInternal;
unsigned char *m_pData;
int mDataSize;
int mDataUsed;
int mDataPos;
bool mReadOnly;
};