4 * @author Martin Corino <mcorino@remedy.nl>
7 #ifndef ACE_FTP_REQUEST_H
8 #define ACE_FTP_REQUEST_H
10 #include /**/ "ace/pre.h"
12 #include "ace/Containers_T.h"
13 #include "ace/INet/INet_Export.h"
14 #include "ace/INet/Request.h"
15 #include "ace/SString.h"
17 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
24 * @class ACE_FTP_Request
26 * @brief Encapsulates FTP requests/commands.
29 class ACE_INET_Export Request
30 : public ACE::INet::Request
37 /// resets the request object
40 /// resets the request object and sets
42 Request
& operator ()(const ACE_CString
& cmd
);
44 /// sets the current command
45 void command (const ACE_CString
& cmd
);
47 /// returns the current command
48 const ACE_CString
& command () const;
50 /// adds a command argument
51 /// separates multiple arguments with a space
52 Request
& operator <<(const ACE_CString
& arg
);
54 /// returns the arguments string
55 const ACE_CString
& arguments () const;
57 /// retrieves the arguments
58 void arguments (ACE_Array
<ACE_CString
> & args
) const;
60 /// Writes the FTP request to the given stream
61 void write(std::ostream
& str
) const;
63 /// Reads the FTP request from the
65 bool read(std::istream
& str
);
67 static const ACE_CString FTP_USER
;
68 static const ACE_CString FTP_PASS
;
69 static const ACE_CString FTP_QUIT
;
70 static const ACE_CString FTP_TYPE
;
71 static const ACE_CString FTP_SYST
;
72 static const ACE_CString FTP_PWD
;
73 static const ACE_CString FTP_CWD
;
74 static const ACE_CString FTP_CDUP
;
75 static const ACE_CString FTP_RNFR
;
76 static const ACE_CString FTP_RNTO
;
77 static const ACE_CString FTP_DELE
;
78 static const ACE_CString FTP_MKD
;
79 static const ACE_CString FTP_RMD
;
80 static const ACE_CString FTP_RETR
;
81 static const ACE_CString FTP_STOR
;
82 static const ACE_CString FTP_LIST
;
83 static const ACE_CString FTP_NLST
;
84 static const ACE_CString FTP_ABOR
;
85 static const ACE_CString FTP_EPRT
;
86 static const ACE_CString FTP_PORT
;
87 static const ACE_CString FTP_EPSV
;
88 static const ACE_CString FTP_PASV
;
89 static const ACE_CString FTP_STAT
;
92 static const int eof_
;
97 MAX_ARG_LENGTH
= 4096 // seems like a sensible maximum
100 ACE_CString command_
;
106 ACE_END_VERSIONED_NAMESPACE_DECL
108 #if defined (__ACE_INLINE__)
109 #include "ace/INet/FTP_Request.inl"
112 #include /**/ "ace/post.h"
113 #endif /* ACE_FTP_REQUEST_H */