HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NET_MemBuffer.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: NET_MemBuffer.h
7  *
8  * COMMENTS:
9  *
10  *
11  */
12 
13 #ifndef __NET_MEMBUFFER_H__
14 #define __NET_MEMBUFFER_H__
15 
16 #include "NET_API.h"
17 
18 #include "NET_IODevice.h"
19 
20 #include <UT/UT_Array.h>
21 
22 class NET_API NET_MemBuffer final : public NET_IODevice
23 {
24 public:
25  exint bytesAvailable() const override;
26  exint read(char* data, exint max_size) override;
27  UT_Array<char> read(exint max_size) override;
28  UT_Array<char> readAll() override;
29  bool seek(exint pos) override;
30  exint size() const override;
31  exint write(const char* data, exint max_size) override;
32  exint write(const char* data) override;
33  exint write(const UT_Array<char>& data) override;
34  exint pos() const override { return myOffset; }
35 
36 private:
37  exint myOffset = 0;
38  UT_Array<char> myBuffer;
39 };
40 
41 #endif // __NET_MEMBUFFER_H__
virtual exint size() const
Definition: NET_IODevice.h:64
int64 exint
Definition: SYS_Types.h:125
virtual UT_Array< char > readAll()
#define NET_API
Definition: NET_API.h:9
virtual exint write(const char *data, exint max_size)
Definition: NET_IODevice.h:65
virtual bool seek(exint pos)
Definition: NET_IODevice.h:63
exint pos() const override
Definition: NET_MemBuffer.h:34
virtual exint read(char *data, exint max_size)
Definition: NET_IODevice.h:60
virtual exint bytesAvailable() const =0
Definition: format.h:895