Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef ACE_FTP_IOSTREAM_H
00010 #define ACE_FTP_IOSTREAM_H
00011
00012 #include "ace/pre.h"
00013
00014 #include "ace/config-all.h"
00015
00016 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00017 # pragma once
00018 #endif
00019
00020 #include "ace/INet/INet_Export.h"
00021 #include "ace/INet/BufferedStreamBuffer.h"
00022 #include <ostream>
00023 #include <istream>
00024
00025 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00026
00027 namespace ACE
00028 {
00029 namespace FTP
00030 {
00031
00032
00033
00034
00035
00036
00037
00038 class ACE_INET_Export StreamBuffer
00039 : public ACE::IOS::BufferedStreamBuffer
00040 {
00041 public:
00042 StreamBuffer (std::iostream * stream);
00043 virtual ~StreamBuffer ();
00044
00045 virtual int sync ();
00046
00047 std::iostream* set_stream (std::iostream * stream);
00048
00049 protected:
00050 enum
00051 {
00052 BUFFER_SIZE = 4096
00053 };
00054
00055 virtual int read_from_stream (char* buffer, std::streamsize length);
00056
00057 virtual int write_to_stream (const char* buffer, std::streamsize length);
00058
00059 private:
00060 std::iostream * stream_;
00061 };
00062
00063
00064
00065
00066
00067
00068
00069
00070 class ACE_INET_Export IOS
00071 : public virtual std::ios
00072 {
00073 public:
00074 IOS (std::iostream* stream);
00075 ~IOS ();
00076
00077 StreamBuffer* rdbuf ();
00078
00079 std::iostream* set_stream (std::iostream* stream);
00080
00081 protected:
00082 StreamBuffer streambuf_;
00083 };
00084
00085
00086
00087
00088
00089
00090
00091 class ACE_INET_Export OStream
00092 : public IOS, public std::ostream
00093 {
00094 public:
00095 explicit OStream(std::iostream* stream);
00096 ~OStream();
00097
00098 void set_interceptor (StreamBuffer::interceptor_type& interceptor);
00099 };
00100
00101
00102
00103
00104
00105
00106
00107 class ACE_INET_Export IStream
00108 : public IOS, public std::istream
00109 {
00110 public:
00111 explicit IStream(std::iostream* stream);
00112 ~IStream();
00113
00114 void set_interceptor (StreamBuffer::interceptor_type& interceptor);
00115 };
00116
00117 }
00118 }
00119
00120 ACE_END_VERSIONED_NAMESPACE_DECL
00121
00122 #if defined (__ACE_INLINE__)
00123 #include "ace/INet/FTP_IOStream.inl"
00124 #endif
00125
00126 #include "ace/post.h"
00127 #endif