MrSID Decode SDK for Raster Reference Manual  9.5.1.4427
lt_ioBufferedStream.h
Go to the documentation of this file.
1 /* $Id$ */
2 /* //////////////////////////////////////////////////////////////////////////
3 // //
4 // This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue, //
5 // Suite 200, Seattle, WA 98104. Unauthorized use or distribution //
6 // prohibited. Access to and use of this code is permitted only under //
7 // license from LizardTech, Inc. Portions of the code are protected by //
8 // US and foreign patents and other filings. All Rights Reserved. //
9 // //
11 /* PUBLIC */
12 
13 #ifndef LT_IO_BUFFERED_STREAM_H
14 #define LT_IO_BUFFERED_STREAM_H
15 
16 #include "lt_ioStreamInf.h"
17 
18 LT_BEGIN_NAMESPACE( LizardTech )
19 
20 class LTIOBufPage;
21 class LTIOBufPageCache;
22 
29 {
30 public:
32  virtual ~LTIOBufferedStream();
33 
43  virtual LT_STATUS initialize( LTIOStreamInf* src,
44  lt_uint32 pageSize=1024,
45  lt_uint32 numPages = 10,
46  const char* tempDir = 0L);
47 
48 
49  virtual bool isEOF();
50  virtual bool isOpen();
51  virtual LT_STATUS open();
52  virtual LT_STATUS close();
53  virtual lt_uint32 read( lt_uint8 *pDest, lt_uint32 numBytes );
54  virtual lt_uint32 write( const lt_uint8 *pSrc, lt_uint32 numBytes );
55  virtual LT_STATUS seek( lt_int64 offset, LTIOSeekDir origin );
56  virtual lt_int64 tell();
57  virtual LTIOStreamInf* duplicate();
58  virtual LT_STATUS getLastError() const;
59  virtual const char* getID() const;
60 
61 private:
62  const LTIOBufPage* getPage( lt_uint64 pageIndex );
63 
64 protected:
67  LTIOBufPageCache* m_buffer;
68  LTIOStreamInf* m_src;
69  lt_uint64 m_cur;
70  bool m_eof;
71  char* m_tempDir;
72 };
73 
74 
75 
76 LT_END_NAMESPACE( LizardTech )
77 
78 
79 #endif // LT_IO_BUFFERED_STREAM_H
Stream which wraps an array of bytes in memory.
Abstract definition of a stream.
unsigned int lt_uint32
unsigned 32-bit integer
Definition: lt_types.h:54
LTIOStreamInf * m_src
#define LT_BEGIN_NAMESPACE(theNameSpace)
compiler does not support namespaces
Definition: lt_define.h:84
LTIOSeekDir
Stream seek directions.
Definition: lt_lib_io.h:30
LTIOBufPageCache * m_buffer
unsigned char lt_uint8
unsigned 8-bit integer
Definition: lt_types.h:46
#define LT_END_NAMESPACE(theNameSpace)
compiler does not support namespaces
Definition: lt_define.h:85
lt_uint32 LT_STATUS
An integral status code.
Definition: lt_status.h:39

LizardTech