SourcePro® API Reference Guide

 
List of all members | Public Member Functions | Protected Member Functions | Friends

Encapsulates a numerical protocol reply typical of many common Internet protocols. More...

#include <rw/internet/RWNumReply.h>

Inheritance diagram for RWNumReply:
RWReply RWFtpReply RWFtpsReply RWHttpReply RWSmtpReply RWFtpDataReply RWFtpPwdReply RWFtpsDataReply RWFtpsPwdReply RWSmtpDataReply

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
 
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

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_
 

Detailed Description

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).

Constructor & Destructor Documentation

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 RWNumReply::~RWNumReply ( void  )
virtual

Releases the memory used by each internal RWNumReplyLine object.

Member Function Documentation

void RWNumReply::append ( RWNumReplyLine r)
protected

Appends an RWNumReplyLine object to the internal RWNumReplyLine list.

void RWNumReply::clearAndDestroy ( void  )
virtual

Clears all RWNumReplyLine objects from self.

Reimplemented from RWReply.

void RWNumReply::copy ( const RWNumReply r)
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.

Note
Only one of the above five methods returns true for any given instance.
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.

Note
Only one of the above five methods returns true for any given instance.
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.

Note
Only one of the above five methods returns true for any given instance.
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.

Note
Only one of the above five methods returns true for any given instance.
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.

Note
Only one of the above five methods returns true for any given instance.
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.

virtual void RWNumReply::parse ( void  )
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.

void RWNumReply::readFromPortal ( const RWPortal portal)
protectedvirtual

Reads data from the portal to construct RWNumReplyLine objects in self.

Implements RWReply.

Friends And Related Function Documentation

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

Outputs an RWNumReply object to an std::ostream.

Note
This class does not have an extraction (>>) operator.

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