2 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
10 void Response::reset ()
12 this->status_ = NORESPONSE;
13 this->response_.size (0);
17 void Response::status(int status)
19 this->status_ = status;
23 int Response::status() const
29 Response& Response::operator ()(int status)
32 this->status (status);
37 const ACE_Array<ACE_CString>& Response::response () const
39 return this->response_;
43 Response& Response::operator <<(const ACE_CString& line)
45 ACE_Array<ACE_CString>::size_type n =
46 this->response_.size ();
47 this->response_.size (n+1);
48 this->response_[n] = line;
53 Response::StatusType Response::status_type (int status)
55 if (status == NORESPONSE)
57 int st = status / 100;
58 if (st >= PRELIM_OK && st <= PERMANENT_FAIL)
59 return static_cast<StatusType> (st);
65 Response::StatusType Response::status_type () const
67 return status_type (this->status_);
71 Response::StatusSubtype Response::status_sub_type () const
73 StatusType st = this->status_type ();
74 if (st != NOSTATE && st != NORESPONSE)
76 int sst = (this->status_ - (st * 100)) / 10;
77 if (sst >= SYNTAX && sst <= FILESYSTEM)
78 return static_cast<StatusSubtype> (sst);
84 bool Response::is_preliminary_ok () const
86 return this->status_type () == PRELIM_OK;
90 bool Response::is_completed_ok () const
92 return this->status_type () == COMPLETED_OK;
96 bool Response::is_intermediate_ok () const
98 return this->status_type () == INTERMEDIATE_OK;
102 bool Response::is_transient_fail () const
104 return this->status_type () == TRANSIENT_FAIL;
108 bool Response::is_permanent_fail () const
110 return this->status_type () == PERMANENT_FAIL;
114 int Response::read_line (std::istream& is, std::ostream& os)
118 ch != eof_ && ch != '\r' && ch != '\n';
129 ACE_END_VERSIONED_NAMESPACE_DECL