Public Member Functions | Protected Types | Protected Member Functions | Private Attributes

ACE::FTP::StreamBuffer Class Reference

#include <FTP_IOStream.h>

Inheritance diagram for ACE::FTP::StreamBuffer:
Inheritance graph
[legend]
Collaboration diagram for ACE::FTP::StreamBuffer:
Collaboration graph
[legend]

List of all members.

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_

Detailed Description

Definition at line 38 of file FTP_IOStream.h.


Member Enumeration Documentation

anonymous enum [protected]
Enumerator:
BUFFER_SIZE 

Definition at line 50 of file FTP_IOStream.h.

                {
                  BUFFER_SIZE = 4096
                };


Constructor & Destructor Documentation

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.

      {
      }


Member Function Documentation

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;
      }


Member Data Documentation

std::iostream* ACE::FTP::StreamBuffer::stream_ [private]

Definition at line 60 of file FTP_IOStream.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines