MrSID Decode SDK for Raster Reference Manual 9.5.4.4709

- Main Page
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

lt_ioFileStream.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_FILE_STREAM_H
14 #define LT_IO_FILE_STREAM_H
15
16 #include "lt_ioStreamInf.h"
17 #include "lt_fileSpec.h"
18 #include <stdio.h>
19
20 #ifdef __ANDROID__
21 #define USE_UNBUFFERED_READER
22 #endif
23
24 LT_BEGIN_NAMESPACE( LizardTech )
25
26
27
33 class LTIOFileStream : public LTIOStreamInf
34 {
35 public:
36
41
45 LTIOFileStream(void);
46
50 virtual ~LTIOFileStream(void);
51
58 virtual LT_STATUS initialize(const LTFileSpec& fs, const char* mode);
59 LT_STATUS initialize(const char* path, const char* mode);
61
62 // LTIOStreamInf overrides
63 virtual bool isEOF();
64 virtual bool isOpen();
65 virtual LT_STATUS open();
66 virtual LT_STATUS close();
67 virtual lt_uint32 read(lt_uint8 *pDest, lt_uint32 numBytes);
68 virtual lt_uint32 write(const lt_uint8 *pSrc, lt_uint32 numBytes);
69 virtual LT_STATUS seek(lt_int64 offset, LTIOSeekDir origin);
70 virtual lt_int64 tell();
71 virtual LTIOStreamInf *duplicate();
72 virtual LT_STATUS getLastError() const;
73 virtual const char* getID() const;
74
82 int stdio_ferror();
83
87 void stdio_clearerr();
89
100 int stdio_setvbuf( lt_uint8* buf, lt_uint32 mode, lt_uint32 size );
101
102 private:
103
104 void cleanup();
105
106 protected:
107
108 #ifdef USE_UNBUFFERED_READER
109 int m_fd;
110 #else
111 FILE* m_file;
112 #endif
113
114 enum
115 {
116 unknown_state = 1,
117 reading_state = 2,
118 writing_state = 3
119 } m_state;
120
121 LTFileSpec m_path;
122 char *m_mode;
123 char *m_uri;
124 };
125
126 LT_END_NAMESPACE( LizardTech )
127
128 #endif // LT_STREAMINF_H

LizardTech