MrSID Decode SDK for Raster Reference Manual  9.5.5.5244
lt_ioBufferedStream.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_BUFFERED_STREAM_H
9 #define LT_IO_BUFFERED_STREAM_H
10 
11 #include "lt_ioStreamInf.h"
12 
13 LT_BEGIN_LIZARDTECH_NAMESPACE
14 
15 class LTIOBufPage;
16 class LTIOBufPageCache;
17 
24 {
25 public:
28 
39  lt_uint32 pageSize=1024,
40  lt_uint32 numPages = 10,
41  const char* tempDir = 0L);
42 
43 
44  virtual bool isEOF();
45  virtual bool isOpen();
46  virtual LT_STATUS open();
47  virtual LT_STATUS close();
48  virtual lt_uint32 read( lt_uint8 *pDest, lt_uint32 numBytes );
49  virtual lt_uint32 write( const lt_uint8 *pSrc, lt_uint32 numBytes );
50  virtual LT_STATUS seek( lt_int64 offset, LTIOSeekDir origin );
51  virtual lt_int64 tell();
53  virtual LT_STATUS getLastError() const;
54  virtual const char* getID() const;
55 
56 private:
57  const LTIOBufPage* getPage( lt_uint64 pageIndex );
58 
59 protected:
62  LTIOBufPageCache* m_buffer;
65  bool m_eof;
66  char* m_tempDir;
67 };
68 
69 
70 
71 LT_END_LIZARDTECH_NAMESPACE
72 
73 
74 #endif // LT_IO_BUFFERED_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 long long int lt_uint64
unsigned 64-bit integer
Definition: lt_types.h:59
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 bool isEOF()
Test for end-of-stream.
virtual LT_STATUS getLastError() const
Get status code of last error event.
virtual const char * getID() const
Get a URI describing the stream object.
virtual LT_STATUS close()
Closes the stream.
virtual LTIOStreamInf * duplicate()
Clone the stream.
virtual lt_uint32 write(const lt_uint8 *pSrc, lt_uint32 numBytes)
Store the specified number of bytes in the data source.
virtual LT_STATUS open()
Opens the stream.
virtual LT_STATUS seek(lt_int64 offset, LTIOSeekDir origin)
Moves the data access position to origin + offset.
virtual lt_uint32 read(lt_uint8 *pDest, lt_uint32 numBytes)
Retrieve the specified number of bytes from the data source and place them in pDest.
virtual bool isOpen()
Test for stream openness.
virtual lt_int64 tell()
Returns the current data access position as an offset from the start of the data.
virtual LT_STATUS initialize(LTIOStreamInf *src, lt_uint32 pageSize=1024, lt_uint32 numPages=10, const char *tempDir=0L)
Initializes the stream.
virtual ~LTIOBufferedStream()
LTIOBufPageCache * m_buffer
LTIOStreamInf * m_src
Abstract definition of a stream.

Extensis