SourcePro C++ 12.0 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
Encapsulates reading an HTTP message body from an std::istream. More...
#include <rw/http/RWHttpRequestStreamBody.h>
Public Member Functions | |
RWHttpRequestStreamBody () | |
RWHttpRequestStreamBody (const RWHttpRequestStreamBody &streamBody) | |
RWHttpRequestStreamBody (std::istream *istr, int length=-1) | |
virtual | ~RWHttpRequestStreamBody () |
virtual RWHttpRequestBody * | clone () 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 |
RWHttpRequestStreamBody defines how to read a streamed message body.
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.
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.
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.
© 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.