MrSID Decode SDK for Raster Reference Manual  9.5.4.4709
lt_ioMemStream.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_IO_MEM_STREAM_H
00015 #define LT_IO_MEM_STREAM_H
00016 
00017 #include "lt_ioStreamInf.h"
00018 
00019 LT_BEGIN_NAMESPACE( LizardTech )
00020 
00021 
00022 
00027 class LTIOMemStream : public LTIOStreamInf
00028 {
00029 public:
00030    LTIOMemStream();
00031    virtual ~LTIOMemStream();
00032 
00043    virtual LT_STATUS initialize( void* data, lt_uint32 size );
00044 
00052    virtual LT_STATUS initialize( lt_uint32 size );
00055    virtual bool isEOF();
00056    virtual bool isOpen();
00057    virtual LT_STATUS open();
00058    virtual LT_STATUS close();
00059    virtual lt_uint32 read( lt_uint8 *pDest, lt_uint32 numBytes );
00060    virtual lt_uint32 write( const lt_uint8 *pSrc, lt_uint32 numBytes );
00061    virtual LT_STATUS seek( lt_int64 offset, LTIOSeekDir origin );
00062    virtual lt_int64 tell();
00063    virtual LTIOStreamInf* duplicate();
00064    virtual LT_STATUS getLastError() const;
00065    virtual const char* getID() const;
00066 
00067 protected:
00068 
00070    lt_uint8*   m_data;
00071 
00073    lt_uint32   m_size;
00074 
00076    lt_uint32   m_cur;
00077 
00079    bool        m_ownsData;
00080 
00082    bool        m_isOpen;
00083 
00084    bool m_isEOF;
00085 };
00086 
00087 
00088 LT_END_NAMESPACE( LizardTech )
00089 
00090 
00091 #endif   // LT_IO_MEM_STREAM_H