Module: Internet Protocols Module Package: Internet Basics
RWNumReplyRWReply
append() clearAndDestroy() copy() entries() getData() |
getStatusCode() is1XX() is2XX() is3XX() is4XX() |
is5XX() operator=() operator[]() parse() readFromPortal() |
RWNumReply() ~RWNumReply() |
#include <rw/internet/RWNumReply.h>
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 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();
Constructs a default invalid RWNumReply object. Using the object without initializing it causes an RWReplyError exception to be thrown.
RWNumReply(const RWNumReply& reply);
Copy constructor.
virtual ~RWNumReply();
Releases the memory used by each internal RWNumReplyLine object.
RWNumReply& operator=(const RWNumReply& reply);
Assignment operator. Sets self to the contents of reply. The previous contents of self are lost.
const RWNumReplyLine& operator[](size_t i) const;
Indexing operator. Returns a reference to the ith RWNumReplyLine object in self.
void clearAndDestroy();
Clears all RWNumReplyLine objects from self.
size_t entries() const;
Returns the number of RWNumReplyLine objects that are contained within self.
RWCString getData() 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 data method. The RWCString should contain 7-bit US-ASCII data.
unsigned int getStatusCode() const;
Returns the numeric code of the reply lines in the reply. All reply lines share the same code.
bool is1XX() const; bool is2XX() const; bool is3XX() const; bool is4XX() const; bool is5XX() 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.
void append(RWNumReplyLine& r);
Appends an RWNumReplyLine object to the internal RWNumReplyLine list.
void copy(const RWNumReply& r);
Makes a deep copy of r to self. The previous contents of self are lost.
virtual void parse();
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.
void readFromPortal(const RWPortal& portal);
Reads data from the portal to construct RWNumReplyLine objects in self.
ostream& operator<<(ostream& strm, const RWNumReply& r);
Outputs an RWNumReply object to an 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.