RWIFtpPwdReplyRWIFtpReplyRWINumReplyRWIReply
Networking Tools: Thread-hot Internet Classes (int library)
#include <rw/toolpro/nreply.h> RWIFtpPwdReply reply;
thr, net, int, tls (and possibly std)
RWIFtpPwdReply is a specialization class of RWIFtpReply. RWIFtpPwdReply attempts to parse the FTP protocol reply for the current directory information. For instance, the following is a common type of server reply from the PWD command:
257 "/pub" is the current directory
In this reply, 257 is a standardized reply, as defined by the FTP RFC 959. However, the RFC does not state a standard syntax for returning the directory information in the text part of the message. RWIFtpPwdReply examines RWINumReplyLine objects contained within self in a last-to-first order, searching for a quoted string. As soon as a match is found, a data member is set to the path. The path can be obtained with the directory member function.
Note that this technique is not guaranteed, because the directory information is returned in the reply text part of the protocol reply. In practice, all the FTP servers we have seen comply with this practice. For this reason, failure to parse the directory from the reply does not constitute an error. If the directory name cannot be parsed, the directory method simply returns an empty string.
RWIFtpPwdReply();
Constructs a default RWIFtpPwdReply.
RWIFtpPwdReply(const RWIFtpPwdReply& reply);
Creates a copy of reply.
RWIFtpPwdReply& operator=(const RWIFtpPwdReply& reply);
Makes self a copy of reply. The previous contents of self are lost.
RWCString directory();
Returns the present working directory that is obtained by examining the reply text. See the general description section for this class.
virtual void parse();
Provides an extended parse mechanism that can extract the directory path out of the reply text.
ostream& operator<<(ostream& strm, const RWIFtpPwdReply& r);
Outputs an RWIFtpPwdReply 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.