SourcePro® API Reference Guide

 
List of all members | Public Member Functions | Protected Member Functions | Related Functions
RWFtpsPwdReply Class Reference

Specialization class of RWFtpsReply for parsing the FTP protocol reply for the current directory information. More...

#include <rw/ftps/RWFtpsPwdReply.h>

Inheritance diagram for RWFtpsPwdReply:
RWFtpsReply RWNumReply RWReply

Public Member Functions

 RWFtpsPwdReply (void)
 
 RWFtpsPwdReply (const RWFtpsPwdReply &reply)
 
RWCString getDirectory (void) const
 
RWFtpsPwdReplyoperator= (const RWFtpsPwdReply &reply)
 
- Public Member Functions inherited from RWFtpsReply
 RWFtpsReply (void)
 
 RWFtpsReply (const RWFtpsReply &reply)
 
RWFtpsReplyoperator= (const RWFtpsReply &reply)
 
- Public Member Functions inherited from RWNumReply
 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
 
RWNumReplyoperator= (const RWNumReply &reply)
 
const RWNumReplyLineoperator[] (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

virtual void parse (void)
 
- Protected Member Functions inherited from RWNumReply
void append (RWNumReplyLine &r)
 
void copy (const RWNumReply &r)
 
void readFromPortal (const RWPortal &portal)
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &str, const RWFtpsPwdReply &r)
 

Additional Inherited Members

- Protected Attributes inherited from RWReply
bool complete_
 
bool valid_
 

Detailed Description

RWFtpsPwdReply is a specialization class of RWFtpsReply. RWFtpsPwdReply 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 include a standard syntax for returning the directory information in the text part of the message. RWFtpsPwdReply examines RWNumReplyLine 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 getDirectory() member function.

Although most FTP servers follow this technique, it is not guaranteed because the directory information is returned in the reply text part of the protocol reply. For this reason, failure to parse the directory from the reply does not constitute an error. If the directory name cannot be parsed, the getDirectory() method simply returns an empty string.

Constructor & Destructor Documentation

RWFtpsPwdReply::RWFtpsPwdReply ( void  )

Default constructor.

RWFtpsPwdReply::RWFtpsPwdReply ( const RWFtpsPwdReply reply)

Copy constructor.

Member Function Documentation

RWCString RWFtpsPwdReply::getDirectory ( void  ) const

Returns the present working directory that is obtained by examining the reply text. See the Detailed Description section for this class.

RWFtpsPwdReply& RWFtpsPwdReply::operator= ( const RWFtpsPwdReply reply)

Assignment operator. Makes self a copy of reply. The previous contents of self are lost.

virtual void RWFtpsPwdReply::parse ( void  )
protectedvirtual

Provides an extended parse mechanism that can extract the directory path from the reply text.

Reimplemented from RWNumReply.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  str,
const RWFtpsPwdReply r 
)
friend

Outputs an RWFtpsPwdReply object to an std::ostream.

Note
Class RWFtpsPwdReply does not have an extraction (>>) operator.

Copyright © 2023 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.