![]() ![]() ![]()
|
BREW C++ Class Library & GUI Framework & XML Middleware : SophiaFramework 4.1 |
#include <SFBUnzipAStream.h.hpp>
class SFBUnzipAStream : public SFBAStream;
SFMTYPEDEFWRAPPER(SFBUnzipAStream)

| BREW 2.0 | BREW 2.1 | BREW 3.1 |
|---|---|---|
| O | O | O |
| Public Functions | |
|---|---|
| static SFBUnzipAStreamSmp |
NewInstance( Void )
Create a new instance of SFBUnzipAStream class.
|
| Void |
SetStream(
SFBAStreamSmpConstRef stream
)
Set an input compressed stream of gzip.
|
| SFCError |
SetStream(
SFXStorageConstRef storage
)
Set an input compressed stream of gzip.
|
| Void |
Cancel( Void )
(inherits from SFBAStream)
Cancel a callback that was scheduled with SFBAStream::Readable().
|
| SInt32 |
Read(
VoidPtr buffer
, UInt32 count
)
(inherits from SFBAStream)
Read( SFXBufferPtr buffer ) (inherits from SFBAStream)
Attempt to read data from a stream, and returns the number of bytes read. If no data is available for reading, it returns the value AEE_STREAM_WOULDBLOCK.
|
| Void |
Readable(
PFNNOTIFY notify
, VoidPtr data = null
)
(inherits from SFBAStream)
Register a callback that checks whether data is available to be read. It is called when the SFBAStream::Read() returns AEE_STREAM_WOULDBLOCK.
|
[ public, static ] SFBUnzipAStreamSmp NewInstance(Void);
[ public ] Void SetStream( SFBAStreamSmpConstRef stream // gzip compressed stream );
[ public ] SFCError SetStream( SFXStorageConstRef storage // gzip compressed storage );
Show log when compress or decompress the text data with gzip
// gzip file name #define MY_STRINGFILE_NAME "MyString.txt.gz" SFBFileMgrSmp filemgr; SFBFileSmp file; SFBUnzipAStreamSmp unzip; FileInfo info; ACharPtr buffer; // Create the SFBFileMgr instance filemgr = SFBFileMgr::NewInstance(); // Get the file size filemgr->GetInfo(MY_STRINGFILE_NAME, &info); // Open the file file = filemgr->OpenFile(MY_STRINGFILE_NAME, _OFM_READ); // Create the SFBUnzipStream instance unzip = SFBUnzipAStream::NewInstance(); // set the gzip compressed stream unzip->SetStream(file); // Create the data operation area buffer = (ACharPtr)MALLOC(info.dwSize); // decompress the gzip compressed text data unzip->Read(buffer, info.dwSize); // show the text in log TRACE("*** text: %s ***", buffer); // release the buffer FREE(buffer);
|
Copyright (C) 2002 - 2009 Sophia Cradle, Inc. All Rights Reserved. |
![]() ![]() ![]()
|