Main Page | Namespace List | Class List | File List | Namespace Members | Class Members | Related Pages

ARC_Member Class Reference

A member of an ARC file. More...

#include <libarc.h>

List of all members.

Public Member Functions

virtual const Media_TypeMediaType () const =0
 Return the media type for this member.

virtual const std::string & URL () const =0
 Return the URL for this member.

virtual time_t Date () const =0
 Return the date for this member.

virtual in_addr_t IPAddress () const =0
 Return the IP address for this member.

virtual const unsigned char * GetData (off_t &length) const =0
 Return a pointer to the member's data.

virtual int HTTPStatus () const =0
 Return the HTTP status code for this member.

virtual off_t GetOffset () const =0
 Return the offset (in bytes) of this member.

virtual off_t GetRawSize () const =0
 Return the raw size (in bytes) of this member.

virtual off_t GetSize () const =0
 Return the real size (in bytes) of this member.

virtual void ReleaseData () const =0
 Release the data pointer associated with this member.

virtual const std::string & GetResponseHeader (const char *name) const =0
 Return the value of a named response header.


Detailed Description

A member of an ARC file.


Member Function Documentation

virtual time_t Date  )  const [pure virtual]
 

Return the date for this member.

As specified in the members URL record.

virtual const unsigned char* GetData off_t &  length  )  const [pure virtual]
 

Return a pointer to the member's data.

The URL record and HTTP response headers (if any) are processed and are not returned by this function. This implies that any value that is part of the HTTP response (such as the HTTP status) is not available until this is called.

:
Parameters:
[out] length Number of bytes in the returned data.
Returns:
Pointer to the start of the data.

virtual off_t GetOffset  )  const [pure virtual]
 

Return the offset (in bytes) of this member.

Returns:
Offset (in bytes) of this member.

virtual off_t GetRawSize  )  const [pure virtual]
 

Return the raw size (in bytes) of this member.

This is the size of the member itself in the ARC file. In a compressed ARC file this is the compressed size, not the uncompressed size. Use GetSize() to find the uncompressed size of the member. The sizes reported do not account for overhead of the GZIP format.

See also:
GetSize
Returns:
Size (in bytes) of this member from the start of the file.

virtual const std::string& GetResponseHeader const char *  name  )  const [pure virtual]
 

Return the value of a named response header.

Parameters:
name The name of the header to return. The string comparison is case sensitive, so you need to specify Content-Type, not content-type.
Returns:
The value of the response header, or the empty string if the header does not exist.

virtual off_t GetSize  )  const [pure virtual]
 

Return the real size (in bytes) of this member.

This is the size of the member in the ARC file, after decompression (if applicable.) In an uncompressed ARC file this value and the value returned by GetRawSize should be the same. In a compressed file this size will usually be larger than the raw size.

See also:
GetRawSize
Returns:
Size (in bytes) of this member.

virtual int HTTPStatus  )  const [pure virtual]
 

Return the HTTP status code for this member.

You must call libarc::ARC_Member::GetData before this will return a valid status code.

Returns:
The HTTP status code for this member.

virtual in_addr_t IPAddress  )  const [pure virtual]
 

Return the IP address for this member.

As specified in the members URL record.

virtual const Media_Type& MediaType  )  const [pure virtual]
 

Return the media type for this member.

As specified in the members URL record.

virtual void ReleaseData  )  const [pure virtual]
 

Release the data pointer associated with this member.

For example, the data in a GZIP compressed ARC file is inflated into a dynamically allocated buffer. Failure to call this function will result in memory leaks.

virtual const std::string& URL  )  const [pure virtual]
 

Return the URL for this member.

As specified in the members URL record.


Generated on Tue Jun 8 21:30:14 2004 by doxygen SourceForge.net Logo