#include <FTP_IOStream.h>
Public Member Functions | |
StreamBuffer (std::iostream *stream) | |
virtual | ~StreamBuffer () |
virtual int | sync () |
std::iostream * | set_stream (std::iostream *stream) |
Protected Types | |
enum | { BUFFER_SIZE = 4096 } |
Protected Member Functions | |
virtual int | read_from_stream (char *buffer, std::streamsize length) |
virtual int | write_to_stream (const char *buffer, std::streamsize length) |
Private Attributes | |
std::iostream * | stream_ |
Definition at line 38 of file FTP_IOStream.h.
anonymous enum [protected] |
ACE::FTP::StreamBuffer::StreamBuffer | ( | std::iostream * | stream | ) |
Definition at line 21 of file FTP_IOStream.cpp.
: ACE::IOS::BufferedStreamBuffer (BUFFER_SIZE, std::ios::in | std::ios::out), stream_ (stream) { }
ACE::FTP::StreamBuffer::~StreamBuffer | ( | ) | [virtual] |
Definition at line 28 of file FTP_IOStream.cpp.
{ }
int ACE::FTP::StreamBuffer::read_from_stream | ( | char * | buffer, | |
std::streamsize | length | |||
) | [protected, virtual] |
Definition at line 40 of file FTP_IOStream.cpp.
{ if (this->stream_ == 0) return -1; this->stream_->read (buffer, length); return ACE_Utils::truncate_cast<int> (this->stream_->gcount ()); }
std::iostream * ACE::FTP::StreamBuffer::set_stream | ( | std::iostream * | stream | ) |
Definition at line 32 of file FTP_IOStream.cpp.
{ std::iostream * old_stream = this->stream_; this->stream_ = stream; this->reset_buffers (); return old_stream; }
int ACE::FTP::StreamBuffer::sync | ( | void | ) | [virtual] |
Reimplemented from ACE::IOS::BasicBufferedStreamBuffer< ACE_CHAR_T, TR >.
Definition at line 54 of file FTP_IOStream.cpp.
{ if (this->stream_ == 0) return -1; if (ACE::IOS::BufferedStreamBuffer::sync () == -1) return -1; return this->stream_->sync (); }
int ACE::FTP::StreamBuffer::write_to_stream | ( | const char * | buffer, | |
std::streamsize | length | |||
) | [protected, virtual] |
Definition at line 47 of file FTP_IOStream.cpp.
{ if (this->stream_ == 0) return -1; this->stream_->write (buffer, length); return this->stream_->good () ? ACE_Utils::truncate_cast<int> (length) : -1; }
std::iostream* ACE::FTP::StreamBuffer::stream_ [private] |
Definition at line 60 of file FTP_IOStream.h.