SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWTStreambufFromByteCharInputStream< InputStream > Class Template Reference

Adaptor class to adapt the iostreams std::streambuf interface to the Rogue Wave binary and narrow character Input Stream interfaces. More...

#include <rw/stream/RWTStreambufFromByteCharInputStream.h>

Inherits std::streambuf.

Public Types

typedef InputStream::element_type element_type
 
typedef InputStream RWInputStream_type
 

Public Member Functions

 RWTStreambufFromByteCharInputStream (const InputStream &sourceStream)
 

Protected Member Functions

InputStream & getSourceStream ()
 
const InputStream & getSourceStream () const
 
virtual int_type overflow (int_type c=traits_type::eof())
 
virtual int_type pbackfail (int_type c=traits_type::eof())
 
virtual pos_type seekoff (off_type off, std::ios_base::seekdir way, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out)
 
virtual pos_type seekpos (pos_type sp, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out)
 
virtual std::streamsize showmanyc ()
 
virtual int sync ()
 
virtual int_type underflow ()
 
virtual std::streamsize xsputn (const char_type *, std::streamsize)
 

Detailed Description

template<class InputStream>
class RWTStreambufFromByteCharInputStream< InputStream >

The class RWTStreambufFromByteCharInputStream is an adaptor class that adapts the iostreams std::streambuf interface to the Rogue Wave binary and narrow character Input Stream interfaces. Requests made through the iostreams std::streambuf interface are forwarded to the embedded input stream handle. Calls to the iostreams std::streambuf functions dealing with the std::streambuf's output sequence will always fail since the underlying output stream only supports input operations. The type of the underlying input stream is provided by the template parameter InputStream, and can be RWByteInputStream or RWCharInputStream.

Member Typedef Documentation

◆ element_type

template<class InputStream >
typedef InputStream::element_type RWTStreambufFromByteCharInputStream< InputStream >::element_type

A typedef for the type of element to be read from RWInputStream_type.

◆ RWInputStream_type

template<class InputStream >
typedef InputStream RWTStreambufFromByteCharInputStream< InputStream >::RWInputStream_type

A typedef for the template parameter InputStream which will be used as the source of elements.

Constructor & Destructor Documentation

◆ RWTStreambufFromByteCharInputStream()

template<class InputStream >
RWTStreambufFromByteCharInputStream< InputStream >::RWTStreambufFromByteCharInputStream ( const InputStream & sourceStream)

Initializes the reference to the input stream that will be used as the source of elements.

Parameters
sourceStreamThe input stream that will serve as the source of elements.

Member Function Documentation

◆ getSourceStream() [1/2]

template<class InputStream >
InputStream & RWTStreambufFromByteCharInputStream< InputStream >::getSourceStream ( )
inlineprotected

Returns a handle to the embedded InputStream that is used as the source of elements. Throw no exceptions.

◆ getSourceStream() [2/2]

template<class InputStream >
const InputStream & RWTStreambufFromByteCharInputStream< InputStream >::getSourceStream ( ) const
inlineprotected

Returns a handle to the embedded InputStream that is used as the source of elements. Throw no exceptions.

◆ overflow()

template<class InputStream >
virtual int_type RWTStreambufFromByteCharInputStream< InputStream >::overflow ( int_type c = traits_type::eof())
protectedvirtual

This function always returns EOF to indicate failure. Throws no exceptions.

◆ pbackfail()

template<class InputStream >
virtual int_type RWTStreambufFromByteCharInputStream< InputStream >::pbackfail ( int_type c = traits_type::eof())
protectedvirtual

This function always returns EOF to indicate failure. Throws no exceptions.

◆ seekoff()

template<class InputStream >
virtual pos_type RWTStreambufFromByteCharInputStream< InputStream >::seekoff ( off_type off,
std::ios_base::seekdir way,
std::ios_base::openmode which = std::ios_base::in|std::ios_base::out )
protectedvirtual

This function always returns EOF to indicate failure. Throws no exceptions.

◆ seekpos()

template<class InputStream >
virtual pos_type RWTStreambufFromByteCharInputStream< InputStream >::seekpos ( pos_type sp,
std::ios_base::openmode which = std::ios_base::in|std::ios_base::out )
protectedvirtual

This function always returns EOF to indicate failure. Throws no exceptions.

◆ showmanyc()

template<class InputStream >
virtual std::streamsize RWTStreambufFromByteCharInputStream< InputStream >::showmanyc ( )
protectedvirtual

This function always returns 0. Throws no exceptions.

◆ sync()

template<class InputStream >
virtual int RWTStreambufFromByteCharInputStream< InputStream >::sync ( )
protectedvirtual

This function always returns zero. Throws no exceptions.

◆ underflow()

template<class InputStream >
virtual int_type RWTStreambufFromByteCharInputStream< InputStream >::underflow ( )
protectedvirtual

This function returns the first character in the get area if called when there are characters in the get area. If the get area is empty, then the function returns the next character that would be read from the input sequence. Throws no exceptions.

◆ xsputn()

template<class InputStream >
virtual std::streamsize RWTStreambufFromByteCharInputStream< InputStream >::xsputn ( const char_type * ,
std::streamsize  )
protectedvirtual

This function always returns EOF to indicate failure. Throws no exceptions.

Copyright © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.