rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWHttpRequestStreamBody Class Reference
[HTTP]

Encapsulates reading an HTTP message body from an std::istream. More...

#include <rw/http/RWHttpRequestStreamBody.h>

Inheritance diagram for RWHttpRequestStreamBody:
RWHttpRequestBody

List of all members.

Public Member Functions

 RWHttpRequestStreamBody ()
 RWHttpRequestStreamBody (const RWHttpRequestStreamBody &streamBody)
 RWHttpRequestStreamBody (std::istream *istr, int length=-1)
virtual ~RWHttpRequestStreamBody ()
virtual RWHttpRequestBodyclone () const
virtual bool isValid () const
virtual RWCString getNextChunk (size_t size)
virtual int getContentLength () const
void setStream (std::istream *istrm, int length=-1)
std::istream * getStream (void) const

Detailed Description

RWHttpRequestStreamBody defines how to read a streamed message body.


Constructor & Destructor Documentation

RWHttpRequestStreamBody::RWHttpRequestStreamBody (  )  [inline]

Constructs a default RWHttpRequestStreamBody object.

RWHttpRequestStreamBody::RWHttpRequestStreamBody ( const RWHttpRequestStreamBody streamBody  )  [inline]

Copy constructor.

RWHttpRequestStreamBody::RWHttpRequestStreamBody ( std::istream *  istr,
int  length = -1 
) [inline]

Constructs an RWHttpRequestStreamBody from a stream, where length is the length of the stream. If the length is not set, the stream is invalid.

virtual RWHttpRequestStreamBody::~RWHttpRequestStreamBody (  )  [virtual]

Virtual destructor.


Member Function Documentation

virtual RWHttpRequestBody* RWHttpRequestStreamBody::clone (  )  const [virtual]

Creates a copy of the RWHttpRequestStreamBody on the heap and returns a pointer to the newly allocated memory.

Implements RWHttpRequestBody.

virtual int RWHttpRequestStreamBody::getContentLength (  )  const [virtual]

Returns the total length of the body object, if known. Returns -1 if the Content-Length cannot be determined.

Note:
An RWHttpRequestError exception is thrown if data without a Content-Length is sent to a server with version less than HTTP/1.1.

Implements RWHttpRequestBody.

virtual RWCString RWHttpRequestStreamBody::getNextChunk ( size_t  size  )  [virtual]

Reads and returns the next size bytes from the body as an RWCString. If size bytes are not available, the remainder of the string is returned. Returns an empty string when no more data can be read.

Implements RWHttpRequestBody.

std::istream * RWHttpRequestStreamBody::getStream ( void   )  const [inline]

Returns the underlying stream.

virtual bool RWHttpRequestStreamBody::isValid (  )  const [virtual]

Returns true if the pointer to the stream is not null and the associated stream object's std::istream::good() returns true.

Implements RWHttpRequestBody.

void RWHttpRequestStreamBody::setStream ( std::istream *  istrm,
int  length = -1 
) [inline]

Assigns the underlying stream to istrm.

 All Classes Functions Variables Typedefs Enumerations Enumerator Friends

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.