ldas-tools-al  2.6.6
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
basic_filebuf< _CharT, _Traits > Class Template Reference

Buffer for file streams. More...

#include <fstream.hh>

Inherits basic_streambuf< _CharT, _Traits >, basic_streambuf< _CharT, _Traits >, and basic_streambuf< _CharT, _Traits >.

Public Types

typedef _CharT char_type
 character type
 
typedef _Traits::int_type int_type
 integer type
 
typedef _Traits::pos_type pos_type
 position type
 
typedef _Traits::off_type off_type
 offset type
 
typedef _Traits traits_type
 traits type
 
typedef _Traits::state_type _State_type
 state type
 
typedef std::basic_streambuf< _CharT, _Traits > _Base
 stream buffer type
 
typedef basic_filebuf< _CharT, _Traits > _Self
 self reference type
 
typedef _CharT char_type
 character type
 
typedef _Traits::int_type int_type
 integer type
 
typedef _Traits::pos_type pos_type
 position type
 
typedef _Traits::off_type off_type
 offset type
 
typedef _Traits traits_type
 traits type
 
typedef _Traits::state_type _State_type
 state type
 
typedef std::basic_streambuf< _CharT, _Traits > _Base
 stream buffer type
 
typedef basic_filebuf< _CharT, _Traits > _Self
 self reference type
 
typedef _CharT char_type
 character type
 
typedef _Traits::int_type int_type
 integer type
 
typedef _Traits::pos_type pos_type
 position type
 
typedef _Traits::off_type off_type
 offset type
 
typedef _Traits traits_type
 traits type
 
typedef _Traits::state_type _State_type
 state type
 
typedef std::basic_streambuf< _CharT, _Traits > _Base
 stream buffer type
 
typedef basic_filebuf< _CharT, _Traits > _Self
 self reference type
 

Public Member Functions

 basic_filebuf ()
 Constructor. More...
 
 ~basic_filebuf ()
 Destructor.
 
bool is_open () const
 Check if stream is open.
 
_Selfopen (const char *__s, std::ios_base::openmode __m)
 Open a stream.
 
_Selfopen (const char *__s, std::ios_base::openmode __m, long __protection)
 Open a stream.
 
_STLP_fd fd () const
 Obtain file descriptor.
 
_Selfopen (int __id, std::ios_base::openmode _Init_mode=m_default_openmode)
 Attach a stream to a file descriptor.
 
_Self_M_open (int __id, std::ios_base::openmode _Init_mode=_Filebuf_base::m_default_openmode)
 Attach a stream to a file descriptor.
 
_Selfclose ()
 Close the stream. More...
 
void UseMemoryMappedIO (bool Value)
 Enable/disable use of memory mapped I/O for stream.
 
bool UseMemoryMappedIO () const
 Obtain the memory mapped I/O status use for the stream.
 
virtual std::basic_streambuf< _CharT, _Traits > * setbuf (char_type *, std::streamsize)
 Set buffer limit. More...
 
bool _M_write (char *__buf, std::ptrdiff_t __n)
 for _Noconv_output
 
 basic_filebuf ()
 Constructor.
 
 ~basic_filebuf ()
 Destructor.
 
bool is_open () const
 Check if stream is open.
 
_Selfopen (const char *__s, std::ios_base::openmode __m)
 Open a stream.
 
_Selfopen (const char *__s, std::ios_base::openmode __m, long __protection)
 Open a stream.
 
_STLP_fd fd () const
 Obtain file descriptor.
 
_Selfopen (int __id, std::ios_base::openmode _Init_mode=m_default_openmode)
 Attach a stream to a file descriptor.
 
_Self_M_open (int __id, std::ios_base::openmode _Init_mode=_Filebuf_base::m_default_openmode)
 Attach a stream to a file descriptor.
 
_Selfclose ()
 Close the stream.
 
void UseMemoryMappedIO (bool Value)
 Enable/disable use of memory mapped I/O for stream.
 
bool UseMemoryMappedIO () const
 Obtain the memory mapped I/O status use for the stream.
 
virtual std::basic_streambuf< _CharT, _Traits > * setbuf (char_type *, std::streamsize)
 Set buffer limit.
 
bool _M_write (char *__buf, std::ptrdiff_t __n)
 for _Noconv_output
 
 basic_filebuf ()
 Constructor.
 
 ~basic_filebuf ()
 Destructor.
 
bool is_open () const
 Check if stream is open.
 
_Selfopen (const char *__s, std::ios_base::openmode __m)
 Open a stream.
 
_Selfopen (const char *__s, std::ios_base::openmode __m, long __protection)
 Open a stream.
 
_STLP_fd fd () const
 Obtain file descriptor.
 
_Selfopen (int __id, std::ios_base::openmode _Init_mode=m_default_openmode)
 Attach a stream to a file descriptor.
 
_Self_M_open (int __id, std::ios_base::openmode _Init_mode=_Filebuf_base::m_default_openmode)
 Attach a stream to a file descriptor.
 
_Selfclose ()
 Close the stream.
 
void UseMemoryMappedIO (bool Value)
 Enable/disable use of memory mapped I/O for stream.
 
bool UseMemoryMappedIO () const
 Obtain the memory mapped I/O status use for the stream.
 
virtual std::basic_streambuf< _CharT, _Traits > * setbuf (char_type *, std::streamsize)
 Set buffer limit.
 
bool _M_write (char *__buf, std::ptrdiff_t __n)
 for _Noconv_output
 

Protected Member Functions

virtual std::streamsize showmanyc ()
 basic_filebuf<> overridden protected virtual member functions More...
 
virtual int_type pbackfail (int_type=traits_type::eof())
 
virtual void imbue (const std::locale &)
 

Friends

class _Underflow< _CharT, _Traits >
 

Detailed Description

template<class _CharT, class _Traits = std::char_traits< _CharT >>
class basic_filebuf< _CharT, _Traits >

Buffer for file streams.

Constructor & Destructor Documentation

◆ basic_filebuf()

template<class _CharT , class _Traits >
basic_filebuf< _CharT, _Traits >::basic_filebuf ( )

Constructor.

Public basic_filebuf<> member functions.

Member Function Documentation

◆ close()

template<class _CharT , class _Traits >
basic_filebuf< _CharT, _Traits > * basic_filebuf< _CharT, _Traits >::close ( )

Close the stream.

Note order of arguments. We close the file even if __ok is false.

Restore the initial state, except that we don't deallocate the buffer or mess with the cached codecvt information.

◆ imbue()

template<class _CharT , class _Traits >
void basic_filebuf< _CharT, _Traits >::imbue ( const std::locale &  __loc)
protectedvirtual

Change the filebuf's locale. This member function has no effect unless it is called before any I/O is performed on the stream.

◆ pbackfail()

template<class _CharT , class _Traits >
__BF_int_type__ basic_filebuf< _CharT, _Traits >::pbackfail ( int_type  __c = traits_type::eof( ))
protectedvirtual

Make a putback position available, if necessary, by switching to a special internal buffer used only for putback. The buffer is [_M_pback_buf, _M_pback_buf + _S_pback_buf_size), but the base class only sees a piece of it at a time. (We want to make sure that we don't try to read a character that hasn't been initialized.) The end of the putback buffer is always _M_pback_buf + _S_pback_buf_size, but the beginning is usually not _M_pback_buf.

If we aren't already in input mode, pushback is impossible.

We can use the ordinary get buffer if there's enough space, and if it's a buffer that we're allowed to write to.

Are we in the putback buffer already?

Do we have more room in the putback buffer?

We have made a putback position available. Assign to it, and return.

◆ setbuf()

template<class _CharT , class _Traits >
std::basic_streambuf< _CharT, _Traits > * basic_filebuf< _CharT, _Traits >::setbuf ( char_type __buf,
std::streamsize  __n 
)
virtual

Set buffer limit.

This member function must be called before any I/O has been performed on the stream, otherwise it has no effect.

__buf == 0 && __n == 0 means to make ths stream unbuffered. __buf != 0 && __n > 0 means to use __buf as the stream's internal buffer, rather than the buffer that would otherwise be allocated automatically. __buf must be a pointer to an array of _CharT whose size is at least __n.

◆ showmanyc()

template<class _CharT , class _Traits >
std::streamsize basic_filebuf< _CharT, _Traits >::showmanyc ( )
protectedvirtual

basic_filebuf<> overridden protected virtual member functions

Is there any possibility that reads can succeed?

Friends And Related Function Documentation

◆ _Underflow< _CharT, _Traits >

template<class _CharT, class _Traits = std::char_traits< _CharT >>
_Underflow< _CharT, _Traits >
friend

friend class _Noconv_input<_Traits>; friend class _Noconv_output<_Traits>;


The documentation for this class was generated from the following file: