4 * @author Martin Corino <mcorino@remedy.nl>
7 #ifndef ACE_FTP_RESPONSE_H
8 #define ACE_FTP_RESPONSE_H
10 #include /**/ "ace/pre.h"
12 #include "ace/INet/INet_Export.h"
13 #include "ace/INet/Response.h"
14 #include "ace/SString.h"
15 #include "ace/Containers_T.h"
18 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
25 * @class ACE_FTP_Response
27 * @brief Encapsulates FTP responses.
30 class ACE_INET_Export Response
31 : public ACE::INet::Response
38 /// resets the FTP response
41 /// resets the FTP response and sets
42 /// the response status
43 Response
& operator ()(int status
);
45 /// returns the current response status
48 /// sets the current response status
49 void status (int status
);
51 /// retrieves the current response line(s)
52 const ACE_Array
<ACE_CString
>& response () const;
54 /// adds a response line
55 Response
& operator <<(const ACE_CString
& line
);
57 /// Writes the FTP response to the given stream
58 void write(std::ostream
& str
) const;
60 /// Reads the FTP response from the
62 bool read(std::istream
& str
);
84 SUBTYPE_NONE
= 4, // "NONE" conflicts with a macro on VxWorks.
88 /// returns the current response type
89 StatusType
status_type () const;
91 /// returns true if the current response type is PRELIM_OK
92 bool is_preliminary_ok () const;
94 /// returns true if the current response type is COMPLETED_OK
95 bool is_completed_ok () const;
97 /// returns true if the current response type is INTERMEDIATE_OK
98 bool is_intermediate_ok () const;
100 /// returns true if the current response type is TRANSIENT_FAIL
101 bool is_transient_fail () const;
103 /// returns true if the current response type is PERMANENT_FAIL
104 bool is_permanent_fail () const;
106 /// returns the current response sub type
107 StatusSubtype
status_sub_type () const;
109 static StatusType
status_type (int status
);
112 static const int eof_
;
114 int read_line (std::istream
& is
, std::ostream
& os
);
117 ACE_Array
<ACE_CString
> response_
;
122 ACE_END_VERSIONED_NAMESPACE_DECL
124 #if defined (__ACE_INLINE__)
125 #include "ace/INet/FTP_Response.inl"
128 #include /**/ "ace/post.h"
129 #endif /* ACE_FTP_RESPONSE_H */