Main Page Modules Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages

# ACEXML_HttpCharStream Class Reference

An implementation of ACEXML_CharStream for reading input from a URL. More...

`#include "ACEXML/common/HttpCharStream.h"`

Inheritance diagram for ACEXML_HttpCharStream:

[legend]
Collaboration diagram for ACEXML_HttpCharStream:

[legend]
List of all members.

## Public Methods
| ACEXML_HttpCharStream (void)
| Default constructor. More...
virtual | ~ACEXML_HttpCharStream (void)
| Destructor. More...
int | open (const ACEXML_Char *url)
| Open an URL. More...
virtual int | available (void)
| Returns the available ACEXML_Char in the buffer. More...
virtual int | close (void)
| Close this stream and release all resources used by it. More...
virtual int | get (ACEXML_Char &ch)
| Read the next ACEXML_Char. More...
virtual int | read (ACEXML_Char *str, size_t len)
| Read the next batch of ACEXML_Char strings. More...
virtual int | peek (void)
| Peek the next ACEXML_Char in the CharStream. More...
virtual void | rewind (void)
| Resets the file pointer to the beginning of the stream. More...
virtual const ACEXML_Char * | getEncoding (void)
| Get the encoding of the file. More...
## Private Methods
int | send_request (void)
| Send a HTTP/1.1 request to fetch the contents of the URL. More...
int | get_url (size_t &len)
| Fetch the URL and save it in backing store. More...
## Private Attributes
ACEXML_Char * | url_
ACEXML_URL_Addr * | url_addr_
ACEXML_Mem_Map_Stream * | stream_
Connector * | connector_
off_t | size_
ACEXML_Char * | encoding_

## Detailed Description

An implementation of ACEXML_CharStream for reading input from a URL.

## Constructor & Destructor Documentation

ACEXML_HttpCharStream::ACEXML_HttpCharStream | ( | void |  | ) |

| Default constructor.

ACEXML_HttpCharStream::~ACEXML_HttpCharStream | ( | void |  | ) | `[virtual]`

| Destructor.

## Member Function Documentation

int ACEXML_HttpCharStream::available | ( | void |  | ) | `[virtual]`

| Returns the available ACEXML_Char in the buffer. -1 if the object is not initialized properly. Reimplemented from ACEXML_CharStream.

int ACEXML_HttpCharStream::close | ( | void |  | ) | `[virtual]`

| Close this stream and release all resources used by it. Reimplemented from ACEXML_CharStream.

int ACEXML_HttpCharStream::get | ( | ACEXML_Char & | ch | ) | `[virtual]`

| Read the next ACEXML_Char. Return -1 if we are not able to return an ACEXML_Char, 0 if EOS is reached, or 1 if succeed. Reimplemented from ACEXML_CharStream.

int ACEXML_HttpCharStream::get_url | ( | size_t & | len | ) | `[private]`

| Fetch the URL and save it in backing store.

const ACEXML_Char * ACEXML_HttpCharStream::getEncoding | ( | void |  | ) | `[virtual]`

| Get the encoding of the file. Reimplemented from ACEXML_CharStream.

int ACEXML_HttpCharStream::open | ( | const ACEXML_Char * | url | ) |

| Open an URL.

int ACEXML_HttpCharStream::peek | ( | void |  | ) | `[virtual]`

| Peek the next ACEXML_Char in the CharStream. Return the character if succeess, -1 if EOS is reached. Reimplemented from ACEXML_CharStream.

int ACEXML_HttpCharStream::read | ( | ACEXML_Char * | str,
|  | size_t | len
| ) | `[virtual]`

| Read the next batch of ACEXML_Char strings. Reimplemented from ACEXML_CharStream.

void ACEXML_HttpCharStream::rewind | ( | void |  | ) | `[virtual]`

| Resets the file pointer to the beginning of the stream.

int ACEXML_HttpCharStream::send_request | ( | void |  | ) | `[private]`

| Send a HTTP/1.1 request to fetch the contents of the URL.

## Member Data Documentation

Connector* ACEXML_HttpCharStream::connector_`[private]`

ACEXML_Char* ACEXML_HttpCharStream::encoding_`[private]`

off_t ACEXML_HttpCharStream::size_`[private]`

ACEXML_Mem_Map_Stream* ACEXML_HttpCharStream::stream_`[private]`

ACEXML_Char* ACEXML_HttpCharStream::url_`[private]`

ACEXML_URL_Addr* ACEXML_HttpCharStream::url_addr_`[private]`

The documentation for this class was generated from the following files:

- HttpCharStream.h
- HttpCharStream.cpp