Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / ACE / protocols / ace / INet / FTP_IOStream.h
blobfeb001bf3aa1971fba8cb061ce252255c0a9e14f
1 /**
2 * @file FTP_IOStream.h
4 * @author Martin Corino <mcorino@remedy.nl>
5 */
7 #ifndef ACE_FTP_IOSTREAM_H
8 #define ACE_FTP_IOSTREAM_H
10 #include /**/ "ace/pre.h"
12 #include /**/ "ace/config-all.h"
14 #if !defined (ACE_LACKS_PRAGMA_ONCE)
15 # pragma once
16 #endif /* ACE_LACKS_PRAGMA_ONCE */
18 #include "ace/INet/INet_Export.h"
19 #include "ace/INet/BufferedStreamBuffer.h"
20 #include <ostream>
21 #include <istream>
23 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
25 namespace ACE
27 namespace FTP
29 /**
30 * @class ACE_FTP_StreamBuffer
32 * @brief
35 class ACE_INET_Export StreamBuffer
36 : public ACE::IOS::BufferedStreamBuffer
38 public:
39 StreamBuffer (std::iostream * stream);
40 virtual ~StreamBuffer ();
42 virtual int sync ();
44 std::iostream* set_stream (std::iostream * stream);
46 protected:
47 enum
49 BUFFER_SIZE = 4096
52 virtual int read_from_stream (char* buffer, std::streamsize length);
54 virtual int write_to_stream (const char* buffer, std::streamsize length);
56 private:
57 std::iostream * stream_;
61 /**
62 * @class ACE_FTP_IOS
64 * @brief
67 class ACE_INET_Export IOS
68 : public virtual std::ios
70 public:
71 IOS (std::iostream* stream);
72 ~IOS ();
74 StreamBuffer* rdbuf ();
76 std::iostream* set_stream (std::iostream* stream);
78 protected:
79 StreamBuffer streambuf_;
82 /**
83 * @class ACE_FTP_OStream
85 * @brief
88 class ACE_INET_Export OStream
89 : public IOS, public std::ostream
91 public:
92 explicit OStream(std::iostream* stream);
93 ~OStream();
95 void set_interceptor (StreamBuffer::interceptor_type& interceptor);
98 /**
99 * @class ACE_FTP_IStream
101 * @brief
104 class ACE_INET_Export IStream
105 : public IOS, public std::istream
107 public:
108 explicit IStream(std::iostream* stream);
109 ~IStream();
111 void set_interceptor (StreamBuffer::interceptor_type& interceptor);
116 ACE_END_VERSIONED_NAMESPACE_DECL
118 #if defined (__ACE_INLINE__)
119 #include "ace/INet/FTP_IOStream.inl"
120 #endif
122 #include /**/ "ace/post.h"
123 #endif /* ACE_FTP_IOSTREAM_H */