SourcePro® 2022.1 |
SourcePro® API Reference Guide |
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) | |
virtual | ~RWNumReply (void) |
void | clearAndDestroy (void) |
size_t | entries (void) const |
RWCString | getData (void) const |
unsigned int | getStatusCode (void) const |
bool | is1XX (void) const |
bool | is2XX (void) const |
bool | is3XX (void) const |
bool | is4XX (void) const |
bool | is5XX (void) const |
RWNumReply & | operator= (const RWNumReply &reply) |
const RWNumReplyLine & | operator[] (size_t i) const |
Public Member Functions inherited from RWReply | |
RWReply (void) | |
virtual | ~RWReply (void) |
virtual bool | isComplete (void) const |
virtual bool | isValid (void) const |
Protected Member Functions | |
void | append (RWNumReplyLine &r) |
void | copy (const RWNumReply &r) |
virtual void | parse (void) |
void | readFromPortal (const RWPortal &portal) |
Friends | |
std::ostream & | operator<< (std::ostream &str, const RWNumReply &r) |
Additional Inherited Members | |
Protected Attributes inherited from RWReply | |
bool | complete_ |
bool | valid_ |
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 |
Releases the memory used by each internal RWNumReplyLine object.
|
protected |
Appends an RWNumReplyLine object to the internal RWNumReplyLine list.
|
virtual |
Clears all RWNumReplyLine objects from self.
Reimplemented from RWReply.
|
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.
|
protectedvirtual |
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, and RWFtpsPwdReply.
|
protectedvirtual |
Reads data from the portal to construct RWNumReplyLine objects in self.
Implements RWReply.
|
friend |
Outputs an RWNumReply object to an std::ostream
.
Copyright © 2022 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |