MrSID Decode SDK for Raster Reference Manual  9.5.5.5244
lt_ioMemStream.h
Go to the documentation of this file.
1 //
2 // This code is property of Celartem, Inc dba Extensis.
3 // Copyright (c) 1995-2023. All rights reserved.
4 // Use permitted only under license from Extensis.
5 //
6 /* PUBLIC */
7 
8 #ifndef LT_IO_MEM_STREAM_H
9 #define LT_IO_MEM_STREAM_H
10 
11 #include "lt_ioStreamInf.h"
12 #include <stddef.h>
13 
14 LT_BEGIN_LIZARDTECH_NAMESPACE
15 
16 
23 {
24 public:
26  virtual ~LTIOMemStream();
27 
38  virtual LT_STATUS initialize( void* data, size_t size );
39 
47  virtual LT_STATUS initialize( size_t size );
50  virtual bool isEOF();
51  virtual bool isOpen();
52  virtual LT_STATUS open();
53  virtual LT_STATUS close();
54  virtual lt_uint32 read( lt_uint8 *pDest, lt_uint32 numBytes );
55  virtual lt_uint32 write( const lt_uint8 *pSrc, lt_uint32 numBytes );
56  virtual LT_STATUS seek( lt_int64 offset, LTIOSeekDir origin );
57  virtual lt_int64 tell();
59  virtual LT_STATUS getLastError() const;
60  virtual const char* getID() const;
61 
62 protected:
63 
66 
68  size_t m_size;
69 
71  size_t m_cur;
72 
74  bool m_ownsData;
75 
77  bool m_isOpen;
78 
79  bool m_isEOF;
80 };
81 
82 
83 LT_END_LIZARDTECH_NAMESPACE
84 
85 
86 #endif // LT_IO_MEM_STREAM_H
LTIOSeekDir
Stream seek directions.
Definition: lt_lib_io.h:26
lt_uint32 LT_STATUS
An integral status code.
Definition: lt_status.h:30
unsigned char lt_uint8
unsigned 8-bit integer
Definition: lt_types.h:36
unsigned int lt_uint32
unsigned 32-bit integer
Definition: lt_types.h:44
long long int lt_int64
signed 64-bit integer
Definition: lt_types.h:57
Stream which wraps an array of bytes in memory.
virtual LTIOStreamInf * duplicate()
pointer to buffer
virtual bool isOpen()
pointer to buffer
virtual const char * getID() const
pointer to buffer
virtual LT_STATUS getLastError() const
pointer to buffer
virtual LT_STATUS open()
pointer to buffer
virtual bool isEOF()
pointer to buffer
virtual lt_uint32 read(lt_uint8 *pDest, lt_uint32 numBytes)
pointer to buffer
size_t m_cur
current position
virtual LT_STATUS seek(lt_int64 offset, LTIOSeekDir origin)
pointer to buffer
virtual LT_STATUS close()
pointer to buffer
size_t m_size
size of buffer
bool m_ownsData
data ownership
lt_uint8 * m_data
pointer to buffer
bool m_isOpen
openness
virtual ~LTIOMemStream()
virtual lt_int64 tell()
pointer to buffer
virtual LT_STATUS initialize(void *data, size_t size)
Initializes the stream.
bool m_isEOF
pointer to buffer
virtual lt_uint32 write(const lt_uint8 *pSrc, lt_uint32 numBytes)
pointer to buffer
virtual LT_STATUS initialize(size_t size)
Initializes the stream.
Abstract definition of a stream.

Extensis