forked from libnui/nui3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnglIMemory.h
64 lines (51 loc) · 1.33 KB
/
nglIMemory.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
NUI3 - C++ cross-platform GUI framework for OpenGL based applications
Copyright (C) 2002-2003 Sebastien Metrot & Vincent Caron
licence: see nui3/LICENCE.TXT
*/
/*!
\file nglIMemory.h
\brief Memory buffer as input stream
*/
#ifndef __nglIMemory_h__
#define __nglIMemory_h__
//#include "nui.h"
#include "nglIStream.h"
//! Memory buffer as input stream
/*!
This simple class let you use any memory portion as an input stream.
See also nglOMemory.
*/
class NGL_API nglIMemory : public nglIStream
{
public:
/** @name Life cycle */
//@{
nglIMemory(const void* pBuffer, int64 ByteCnt);
/*!<
\param pBuffer user buffer
\param ByteCnt byte count of user buffer (if any)
Build a nglIMemory from an existing buffer. The buffer is not managed by
nglIMemory, ie. it won't be freed when the stream is deleted.
*/
//@}
/** @name State/error methods */
//@{
nglStreamState GetState() const;
//@}
/** @name Stream navigation */
//@{
nglFileOffset GetPos() const;
nglFileOffset SetPos (nglFileOffset Where, nglStreamWhence Whence = eStreamFromStart);
nglFileSize Available (uint WordSize = 1);
//@}
/** @name Input methods */
//@{
virtual int64 Read (void* pData, int64 WordCount, uint WordSize = 1);
//@}
protected:
char* mpBuffer;
nglSize mSize;
nglSize mOffset;
};
#endif // __nglIMemory_h__