SourcePro C++ 12.0 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
Encapsulates a numerical protocol reply typical of many common Internet protocols. More...
#include <rw/internet/RWNumReply.h>
Public Member Functions | |
RWNumReply (void) | |
RWNumReply (const RWNumReply &r) | |
RWNumReply & | operator= (const RWNumReply &reply) |
virtual | ~RWNumReply (void) |
void | clearAndDestroy (void) |
bool | is1XX (void) const |
bool | is2XX (void) const |
bool | is3XX (void) const |
bool | is4XX (void) const |
bool | is5XX (void) const |
RWCString | getData (void) const |
unsigned int | getStatusCode (void) const |
size_t | entries (void) const |
const RWNumReplyLine & | operator[] (size_t i) const |
Protected Member Functions | |
void | readFromPortal (const RWPortal &portal) |
void | append (RWNumReplyLine &r) |
void | copy (const RWNumReply &r) |
virtual void | parse (void) |
Friends | |
std::ostream & | operator<< (std::ostream &str, const RWNumReply &r) |
RWNumReply encapsulates a numerical protocol reply typical of many common Internet protocols. For instance, FTP replies in the forms shown in the following table are parsed first into RWNumReplyLine objects and then stored in an RWNumReply object. Individual RWNumReplyLine objects can be obtained using the operator[]().
Single Line Replies | Multiple Line Replies |
200 Command Ok | 220-Text Message 1 |
Text Message 2 | |
Text Message 3 | |
220 Text Message 4 |
The numerical portion of a reply is a 3-digit number in US-ASCII. The first digit of the number indicates the general status of the result of a command. Convenience methods included in RWNumReply enable your application to determine the category (1XX
, 2XX
, 3XX
, 4XX
, or 5XX
).
RWNumReply::RWNumReply | ( | void | ) |
Constructs a default invalid RWNumReply object. Using the object without initializing it causes an RWReplyError exception to be thrown.
RWNumReply::RWNumReply | ( | const RWNumReply & | r | ) |
Copy constructor.
virtual RWNumReply::~RWNumReply | ( | void | ) | [virtual] |
Releases the memory used by each internal RWNumReplyLine object.
void RWNumReply::append | ( | RWNumReplyLine & | r | ) | [protected] |
Appends an RWNumReplyLine object to the internal RWNumReplyLine list.
void RWNumReply::clearAndDestroy | ( | void | ) | [virtual] |
Clears all RWNumReplyLine objects from self
.
Reimplemented from RWReply.
void RWNumReply::copy | ( | const RWNumReply & | r | ) | [protected] |
Makes a deep copy of r to self
. The previous contents of self
are lost.
size_t RWNumReply::entries | ( | void | ) | const |
Returns the number of RWNumReplyLine objects that are contained within self
.
RWCString RWNumReply::getData | ( | void | ) | const |
Returns the raw data that was used to construct the first RWNumReplyLine object in the reply. This is a convenience routine and is equivalent to getting the first RWNumReplyLine object and calling its RWNumReplyLine::getData() method. The RWCString should contain 7-bit US-ASCII data.
unsigned int RWNumReply::getStatusCode | ( | void | ) | const |
Returns the numeric code of the reply lines in the reply. All reply lines share the same code.
bool RWNumReply::is1XX | ( | void | ) | const |
Returns true
if the RWNumReplyLine objects in the reply are members of the specified numerical reply family. For more information about reply families, see RFC 959.
bool RWNumReply::is2XX | ( | void | ) | const |
Returns true
if the RWNumReplyLine objects in the reply are members of the specified numerical reply family. For more information about reply families, see RFC 959.
bool RWNumReply::is3XX | ( | void | ) | const |
Returns true
if the RWNumReplyLine objects in the reply are members of the specified numerical reply family. For more information about reply families, see RFC 959.
bool RWNumReply::is4XX | ( | void | ) | const |
Returns true
if the RWNumReplyLine objects in the reply are members of the specified numerical reply family. For more information about reply families, see RFC 959.
bool RWNumReply::is5XX | ( | void | ) | const |
Returns true
if the RWNumReplyLine objects in the reply are members of the specified numerical reply family. For more information about reply families, see RFC 959.
RWNumReply& RWNumReply::operator= | ( | const RWNumReply & | reply | ) |
Assignment operator. Sets self
to the contents of reply. The previous contents of self
are lost.
const RWNumReplyLine& RWNumReply::operator[] | ( | size_t | i | ) | const |
Indexing operator. Returns a reference to the i th RWNumReplyLine object in self
.
virtual void RWNumReply::parse | ( | void | ) | [protected, virtual] |
Provides a general parsing mechanism for data used to construct RWNumReplyLine objects. In cases where additional data is available to these specific classes, derived classes may provide their own parse methods to override this method.
Reimplemented in RWFtpPwdReply.
void RWNumReply::readFromPortal | ( | const RWPortal & | portal | ) | [protected, virtual] |
Reads data from the portal to construct RWNumReplyLine objects in self
.
Implements RWReply.
Reimplemented in RWHttpReply.
std::ostream& operator<< | ( | std::ostream & | str, | |
const RWNumReply & | r | |||
) | [friend] |
Outputs an RWNumReply object to an std::ostream
.
© 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.