code::ZlibReader Class Reference
[Reader]

Inheritance diagram for code::ZlibReader:

code::InMemoryReader code::Reader List of all members.

Detailed Description

Reader Decorator which adds gz and bz2 uncompression.

Author:
Charles Kerr
Version:
Id
code_ZlibReader.h,v 1.6 2009/06/02 20:17:40 lakshman Exp


Public Types

 GZ
 BZ2
enum  Type { GZ, BZ2 }

Public Member Functions

 ZlibReader (Type, SmartPtr< Reader >)
virtual ~ZlibReader ()
virtual int read (Buffer &, long offset=0, size_t max_bytes=0)

Static Public Member Functions

static int read (const URL &url, Buffer &buffer, long offset=0, size_t max_len=0)
 Convenience function to read `url' into `buf'.
static int read (const URL &url, std::string &s, long offset=0, size_t max_len=0)
 Identical to read(const URL&,Buffer&,long,size_t) except it takes a string instead of a buffer.
static int readRaw (const URL &url, Buffer &b, long offset=0, size_t max_len=0)
 Identical to read() except except it doesn't uncompress files.
static SmartPtr< XML::DocumentreadXMLDocument (const URL &url)
 Returns an XML::Document created by passing the contents of `url' to XML::Parser::parse().
static SmartPtr< ReadergetReader (const URL &url)
 Returns a handle to a reader for the given URL.
static void introduceWDSSIIReaders ()

Protected Attributes

int myIndex
Buffer myBuf


Member Enumeration Documentation

enum code::ZlibReader::Type

Enumerator:
GZ 
BZ2 


Constructor & Destructor Documentation

code::ZlibReader::ZlibReader ( Type  ,
SmartPtr< Reader  
)

virtual code::ZlibReader::~ZlibReader (  )  [inline, virtual]


Member Function Documentation

static SmartPtr<Reader> code::Reader::getReader ( const URL url  )  [static, inherited]

Returns a handle to a reader for the given URL.

This is useful when you want to make iterative calls to read() or LineReader::readLine().

static void code::Reader::introduceWDSSIIReaders (  )  [static, inherited]

static int code::Reader::read ( const URL url,
std::string &  s,
long  offset = 0,
size_t  max_len = 0 
) [static, inherited]

Identical to read(const URL&,Buffer&,long,size_t) except it takes a string instead of a buffer.

static int code::Reader::read ( const URL url,
Buffer buffer,
long  offset = 0,
size_t  max_len = 0 
) [static, inherited]

Convenience function to read `url' into `buf'.

Handles remote, local, compressed, and uncompressed files transparently.

Parameters:
url the data source.
buffer where source's contents will be stored.
offset number of bytes to skip before read() begins storing.
max_len if nonzero, maximum number of bytes to store in buf.
Returns:
the number of bytes read, or a negative number on error.

virtual int code::InMemoryReader::read ( Buffer ,
long  offset = 0,
size_t  max_bytes = 0 
) [virtual, inherited]

See also:
static int read (URL, Buffer, offset, long, size_t);

Implements code::Reader.

static int code::Reader::readRaw ( const URL url,
Buffer b,
long  offset = 0,
size_t  max_len = 0 
) [static, inherited]

Identical to read() except except it doesn't uncompress files.

This is useful when mirroring compressed files to avoid decompress / recompress steps.

static SmartPtr<XML::Document> code::Reader::readXMLDocument ( const URL url  )  [static, inherited]

Returns an XML::Document created by passing the contents of `url' to XML::Parser::parse().


Member Data Documentation

Buffer code::InMemoryReader::myBuf [protected, inherited]

int code::InMemoryReader::myIndex [protected, inherited]


Generated on Fri May 4 13:40:13 2012 for WDSS-IIw2 by  doxygen 1.4.7