MrSID Decode SDK for Raster Reference Manual  9.5.4.4709
lt_ioSubStream.h
Go to the documentation of this file.
00001 /* $Id$ */
00002 /* //////////////////////////////////////////////////////////////////////////
00003 //                                                                         //
00004 // This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
00005 // Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
00006 // prohibited.  Access to and use of this code is permitted only under     //
00007 // license from LizardTech, Inc.  Portions of the code are protected by    //
00008 // US and foreign patents and other filings. All Rights Reserved.          //
00009 //                                                                         //
00011 /* PUBLIC */
00012 
00013 
00014 #ifndef LT_IOSUBSTREAM_H
00015 #define LT_IOSUBSTREAM_H
00016 
00017 #include "lt_ioStreamInf.h"
00018 #include <stdio.h>
00019 
00020 LT_BEGIN_NAMESPACE( LizardTech )
00021 
00022 
00023 
00024 
00046 class LTIOSubStream : public LTIOStreamInf
00047 {
00048 public:
00049 
00054 
00058    LTIOSubStream();
00059 
00063    virtual ~LTIOSubStream();
00064 
00076    virtual LT_STATUS initialize(LTIOStreamInf* stream,
00077                                 lt_int64 start,
00078                                 lt_int64 end,
00079                                 bool takeOwnership=false);
00080 
00085 
00092    virtual bool isEOF();
00093 
00094 
00099 
00106    virtual bool isOpen();
00107 
00120    virtual LT_STATUS open();
00121    
00132    virtual LT_STATUS close();
00133 
00135 
00136 
00141 
00151    virtual lt_uint32 read( lt_uint8 *pDest, lt_uint32 numBytes );
00152    
00161    virtual lt_uint32 write( const lt_uint8 *pSrc, lt_uint32 numBytes );
00162 
00164 
00169 
00181    virtual LT_STATUS seek( lt_int64 offset, LTIOSeekDir origin );
00182 
00189    virtual lt_int64 tell();
00190 
00192 
00197 
00207    virtual LTIOStreamInf* duplicate();
00208 
00209    virtual LT_STATUS getLastError() const;
00210 
00211    virtual const char* getID() const;
00212 
00214 
00215 
00216 protected:
00218    void cleanup();
00219 
00220    LTIOStreamInf* m_stream;
00221    bool m_ownsStream;
00222    lt_int64 m_startOffset;
00223    lt_int64 m_endOffset;
00224 
00225    bool m_isEOF;
00226 };
00227 
00228 
00229 
00230 LT_END_NAMESPACE( LizardTech )
00231 
00232 
00233 #endif   // LT_IOSUBSTREAM_H