SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWHttpRequestStringBody Class Reference

Encapsulates reading an HTTP message body from an RWCString. More...

#include <rw/http/RWHttpRequestStringBody.h>

Inheritance diagram for RWHttpRequestStringBody:
RWHttpRequestBody

Public Member Functions

 RWHttpRequestStringBody ()
 
 RWHttpRequestStringBody (const RWCString &body)
 
 RWHttpRequestStringBody (const RWHttpRequestStringBody &body)
 
virtual ~RWHttpRequestStringBody ()
 
virtual RWHttpRequestBodyclone () const
 
virtual int getContentLength () const
 
virtual RWCString getNextChunk (size_t size)
 
RWCString getString () const
 
virtual bool isValid () const
 
void setString (const RWCString &str)
 
- Public Member Functions inherited from RWHttpRequestBody
 RWHttpRequestBody ()
 
virtual ~RWHttpRequestBody ()
 

Detailed Description

RWHttpRequestStringBody defines how to read a standard message body.

Constructor & Destructor Documentation

◆ RWHttpRequestStringBody() [1/3]

RWHttpRequestStringBody::RWHttpRequestStringBody ( )
inline

Constructs a default RWHttpRequestStringBody object.

◆ RWHttpRequestStringBody() [2/3]

RWHttpRequestStringBody::RWHttpRequestStringBody ( const RWHttpRequestStringBody & body)
inline

Copy constructor.

◆ RWHttpRequestStringBody() [3/3]

RWHttpRequestStringBody::RWHttpRequestStringBody ( const RWCString & body)
inline

Constructs an RWHttpRequestStringBody from a string.

◆ ~RWHttpRequestStringBody()

virtual RWHttpRequestStringBody::~RWHttpRequestStringBody ( )
virtual

Virtual destructor.

Member Function Documentation

◆ clone()

virtual RWHttpRequestBody * RWHttpRequestStringBody::clone ( ) const
virtual

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

Implements RWHttpRequestBody.

◆ getContentLength()

virtual int RWHttpRequestStringBody::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.

◆ getNextChunk()

virtual RWCString RWHttpRequestStringBody::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.

◆ getString()

RWCString RWHttpRequestStringBody::getString ( ) const
inline

Returns the internal body representation as an RWCString.

◆ isValid()

virtual bool RWHttpRequestStringBody::isValid ( ) const
virtual

Always returns true for this derived class.

Implements RWHttpRequestBody.

◆ setString()

void RWHttpRequestStringBody::setString ( const RWCString & str)
inline

Stores the RWCString str as the internal body of the object.

Copyright © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.