Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef ACE_FTP_RESPONSE_H
00010 #define ACE_FTP_RESPONSE_H
00011
00012 #include "ace/pre.h"
00013
00014 #include "ace/INet/INet_Export.h"
00015 #include "ace/INet/Response.h"
00016 #include "ace/SString.h"
00017 #include "ace/Array.h"
00018 #include <iostream>
00019
00020 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00021
00022 namespace ACE
00023 {
00024 namespace FTP
00025 {
00026
00027
00028
00029
00030
00031
00032
00033 class ACE_INET_Export Response
00034 : public ACE::INet::Response
00035 {
00036 public:
00037 Response ();
00038
00039 virtual ~Response ();
00040
00041
00042 void reset ();
00043
00044
00045
00046 Response& operator ()(int status);
00047
00048
00049 int status () const;
00050
00051
00052 void status (int status);
00053
00054
00055 const ACE_Array<ACE_CString>& response () const;
00056
00057
00058 Response& operator <<(const ACE_CString& line);
00059
00060
00061 void write(std::ostream& str) const;
00062
00063
00064
00065 bool read(std::istream& str);
00066
00067
00068 enum StatusType
00069 {
00070 NOSTATE = -1,
00071 NORESPONSE = 0,
00072 PRELIM_OK = 1,
00073 COMPLETED_OK = 2,
00074 INTERMEDIATE_OK = 3,
00075 TRANSIENT_FAIL = 4,
00076 PERMANENT_FAIL = 5
00077 };
00078
00079
00080 enum StatusSubtype
00081 {
00082 NOSUBTYPE = -1,
00083 SYNTAX = 0,
00084 INFORMATION = 1,
00085 CONNECTION = 2,
00086 AUTHENTICATION = 3,
00087 NONE = 4,
00088 FILESYSTEM = 5
00089 };
00090
00091
00092 StatusType status_type () const;
00093
00094
00095 bool is_preliminary_ok () const;
00096
00097
00098 bool is_completed_ok () const;
00099
00100
00101 bool is_intermediate_ok () const;
00102
00103
00104 bool is_transient_fail () const;
00105
00106
00107 bool is_permanent_fail () const;
00108
00109
00110 StatusSubtype status_sub_type () const;
00111
00112 static StatusType status_type (int status);
00113
00114 private:
00115 static const int eof_;
00116
00117 int read_line (std::istream& is, std::ostream& os);
00118
00119 int status_;
00120 ACE_Array<ACE_CString> response_;
00121 };
00122
00123 }
00124 }
00125
00126 ACE_END_VERSIONED_NAMESPACE_DECL
00127
00128 #if defined (__ACE_INLINE__)
00129 #include "ace/INet/FTP_Response.inl"
00130 #endif
00131
00132 #include "ace/post.h"
00133 #endif