RWINumReplyRWIReply
Networking Tools: Thread-hot Internet Classes (int library)
append() clearAndDestroy() code() copy() |
data() entries() is1XX() is2XX() |
is3XX() is4XX() is5XX() operator<<() |
operator=() operator[]() parse() readFromPortal() |
#include <rw/toolpro/nreply.h> RWINumReply reply;
thr, net, int, tls (and possibly std)
RWINumReply encapsulates a numerical protocol reply typical of many common Internet protocols. For instance, typical FTP replies in the forms shown in the following table are parsed first into RWINumReplyLine objects and then stored in an RWINumReply object. Individual RWINumReplyLine 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 number determines how the reply is processed and how the software proceeds after processing the reply. Since the first digit of the 3-digit reply number gives enough information on the general status of the result of a command, convenience methods are provided in RWINumReply to decide in which category a reply falls (within the 1XX, 2XX, 3XX, 4XX, or 5XX family) without going into too much detail for each individual reply code.
RWINumReply();
Constructs a default invalid RWINumReply object. Use of the object results in an exception being thrown.
virtual ~RWINumReply();
Releases the memory used by each internal RWINumReplyLine object.
RWINumReply(const RWINumReply& reply);
Creates a copy of reply.
RWINumReply& operator=(const RWINumReply& reply);
Sets self to the contents of reply. The previous contents of self are lost.
void clearAndDestroy();
Clears all RWINumReplyLine objects from self.
unsigned int code() const;
Returns the numeric code of the reply lines in the reply. Note that all reply lines share the same code.
RWCString data() const;
Returns the raw data that was used to construct the first RWINumReplyLine object in the reply. This is a convenience routine, and is equivalent to getting the first RWINumReplyLine object and calling its data method.
int entries() const;
Returns the number of RWINumReplyLine objects that are contained within self.
RWBoolean is1XX() const; RWBoolean is2XX() const; RWBoolean is3XX() const; RWBoolean is4XX() const; RWBoolean is5XX() const;
Returns TRUE if the RWINumReplyLine objects in the reply are members of the specified numerical reply family. Note that only one of the above five methods may return TRUE of self.
const RWINumReplyLine& operator[](size_t i) const;
Returns a reference to the ith RWINumReplyLine object in self.
void append(RWINumReplyLine& r);
Appends an RWINumReplyLine object to the internal RWINumReplyLine list.
void copy(const RWINumReply& r);
Makes a deep copy of r to self. The previous contents of self are lost.
virtual void parse();
Provides a general parsing mechanism on data used to construct RWINumReplyLine objects. Derived classes may provide their own parse methods to override this method in cases where additional data is available to these specific classes.
void readFromPortal(const RWSocketPortal& portal);
Reads data from the portal to construct RWINumReplyLine objects in self.
ostream& operator<<(ostream& strm, const RWINumReply& r);
Outputs an RWINumReply object to an ostream.
Note: This class does not have an extraction (>>) operator.
©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.