#include <FTP_Response.h>
Public Types | |
enum | StatusType { NOSTATE = -1, NORESPONSE = 0, PRELIM_OK = 1, COMPLETED_OK = 2, INTERMEDIATE_OK = 3, TRANSIENT_FAIL = 4, PERMANENT_FAIL = 5 } |
response types More... | |
enum | StatusSubtype { NOSUBTYPE = -1, SYNTAX = 0, INFORMATION = 1, CONNECTION = 2, AUTHENTICATION = 3, NONE = 4, FILESYSTEM = 5 } |
response subtypes More... | |
Public Member Functions | |
Response () | |
virtual | ~Response () |
void | reset () |
resets the FTP response | |
Response & | operator() (int status) |
int | status () const |
returns the current response status | |
void | status (int status) |
sets the current response status | |
const ACE_Array< ACE_CString > & | response () const |
retrieves the current response line(s) | |
Response & | operator<< (const ACE_CString &line) |
adds a response line | |
void | write (std::ostream &str) const |
Writes the FTP response to the given stream. | |
bool | read (std::istream &str) |
StatusType | status_type () const |
returns the current response type | |
bool | is_preliminary_ok () const |
returns true if the current response type is PRELIM_OK | |
bool | is_completed_ok () const |
returns true if the current response type is COMPLETED_OK | |
bool | is_intermediate_ok () const |
returns true if the current response type is INTERMEDIATE_OK | |
bool | is_transient_fail () const |
returns true if the current response type is TRANSIENT_FAIL | |
bool | is_permanent_fail () const |
returns true if the current response type is PERMANENT_FAIL | |
StatusSubtype | status_sub_type () const |
returns the current response sub type | |
Static Public Member Functions | |
static StatusType | status_type (int status) |
Private Member Functions | |
int | read_line (std::istream &is, std::ostream &os) |
Private Attributes | |
int | status_ |
ACE_Array< ACE_CString > | response_ |
Static Private Attributes | |
static const int | eof_ = std::char_traits<char>::eof () |
Definition at line 33 of file FTP_Response.h.
response subtypes
Definition at line 80 of file FTP_Response.h.
{ NOSUBTYPE = -1, SYNTAX = 0, INFORMATION = 1, CONNECTION = 2, AUTHENTICATION = 3, NONE = 4, FILESYSTEM = 5 };
response types
Definition at line 68 of file FTP_Response.h.
{ NOSTATE = -1, NORESPONSE = 0, PRELIM_OK = 1, COMPLETED_OK = 2, INTERMEDIATE_OK = 3, TRANSIENT_FAIL = 4, PERMANENT_FAIL = 5 };
ACE::FTP::Response::Response | ( | ) |
Reimplemented from ACE::INet::Response.
Definition at line 25 of file FTP_Response.cpp.
: status_ (NORESPONSE) { }
ACE::FTP::Response::~Response | ( | ) | [virtual] |
bool ACE::FTP::Response::is_completed_ok | ( | ) | const [inline] |
returns true if the current response type is COMPLETED_OK
Definition at line 93 of file FTP_Response.inl.
{ return this->status_type () == COMPLETED_OK; }
bool ACE::FTP::Response::is_intermediate_ok | ( | ) | const [inline] |
returns true if the current response type is INTERMEDIATE_OK
Definition at line 99 of file FTP_Response.inl.
{ return this->status_type () == INTERMEDIATE_OK; }
bool ACE::FTP::Response::is_permanent_fail | ( | ) | const [inline] |
returns true if the current response type is PERMANENT_FAIL
Definition at line 111 of file FTP_Response.inl.
{ return this->status_type () == PERMANENT_FAIL; }
bool ACE::FTP::Response::is_preliminary_ok | ( | ) | const [inline] |
returns true if the current response type is PRELIM_OK
Definition at line 87 of file FTP_Response.inl.
{ return this->status_type () == PRELIM_OK; }
bool ACE::FTP::Response::is_transient_fail | ( | ) | const [inline] |
returns true if the current response type is TRANSIENT_FAIL
Definition at line 105 of file FTP_Response.inl.
{ return this->status_type () == TRANSIENT_FAIL; }
Response & ACE::FTP::Response::operator() | ( | int | status | ) | [inline] |
Response & ACE::FTP::Response::operator<< | ( | const ACE_CString & | line | ) | [inline] |
adds a response line
Definition at line 46 of file FTP_Response.inl.
bool ACE::FTP::Response::read | ( | std::istream & | str | ) |
Reads the FTP response from the given stream.
int ACE::FTP::Response::read_line | ( | std::istream & | is, | |
std::ostream & | os | |||
) | [inline, private] |
Definition at line 117 of file FTP_Response.inl.
void ACE::FTP::Response::reset | ( | void | ) | [inline] |
const ACE_Array< ACE_CString > & ACE::FTP::Response::response | ( | ) | const [inline] |
retrieves the current response line(s)
Definition at line 40 of file FTP_Response.inl.
{ return this->response_; }
void ACE::FTP::Response::status | ( | int | status | ) | [inline] |
sets the current response status
Definition at line 20 of file FTP_Response.inl.
{ this->status_ = status; }
int ACE::FTP::Response::status | ( | void | ) | const [inline] |
returns the current response status
Definition at line 26 of file FTP_Response.inl.
{ return this->status_; }
Response::StatusSubtype ACE::FTP::Response::status_sub_type | ( | ) | const [inline] |
returns the current response sub type
Definition at line 74 of file FTP_Response.inl.
{ StatusType st = this->status_type (); if (st != NOSTATE && st != NORESPONSE) { int sst = (this->status_ - (st * 100)) / 10; if (sst >= SYNTAX && sst <= FILESYSTEM) return static_cast<StatusSubtype> (sst); } return NOSUBTYPE; }
Response::StatusType ACE::FTP::Response::status_type | ( | int | status | ) | [inline, static] |
Definition at line 56 of file FTP_Response.inl.
{ if (status == NORESPONSE) return NORESPONSE; int st = status / 100; if (st >= PRELIM_OK && st <= PERMANENT_FAIL) return static_cast<StatusType> (st); else return NOSTATE; }
Response::StatusType ACE::FTP::Response::status_type | ( | ) | const [inline] |
returns the current response type
Definition at line 68 of file FTP_Response.inl.
{ return status_type (this->status_); }
void ACE::FTP::Response::write | ( | std::ostream & | str | ) | const |
Writes the FTP response to the given stream.
const int ACE::FTP::Response::eof_ = std::char_traits<char>::eof () [static, private] |
Definition at line 115 of file FTP_Response.h.
ACE_Array<ACE_CString> ACE::FTP::Response::response_ [private] |
Definition at line 120 of file FTP_Response.h.
int ACE::FTP::Response::status_ [private] |
Definition at line 119 of file FTP_Response.h.