GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
c_file_ptr_buf Class Reference

#include "c-file-ptr-stream.h"

Inheritance diagram for c_file_ptr_buf:
Collaboration diagram for c_file_ptr_buf:

Public Types

typedef int(* close_fcn) (FILE *)
 
typedef std::streambuf::int_type int_type
 

Public Member Functions

 c_file_ptr_buf (const c_file_ptr_buf &)=delete
 
 c_file_ptr_buf (FILE *f, close_fcn cf=file_close)
 
 ~c_file_ptr_buf (void)
 
int buf_close (void)
 
void clear (void)
 
int file_number () const
 
int flush (void)
 
c_file_ptr_bufoperator= (const c_file_ptr_buf &)=delete
 
int_type overflow (int_type)
 
int_type pbackfail (int_type)
 
int seek (off_t offset, int origin)
 
std::streampos seekoff (std::streamoff, std::ios::seekdir, std::ios::openmode=std::ios::in|std::ios::out)
 
std::streampos seekpos (std::streampos, std::ios::openmode=std::ios::in|std::ios::out)
 
FILE * stdiofile (void)
 
int sync (void)
 
off_t tell (void)
 
int_type uflow (void)
 
int_type underflow (void)
 
std::streamsize xsgetn (char *, std::streamsize)
 
std::streamsize xsputn (const char *, std::streamsize)
 

Static Public Member Functions

static int file_close (FILE *m_f)
 

Protected Attributes

close_fcn m_cf
 
FILE * m_f
 

Private Member Functions

int_type underflow_common (bool)
 

Detailed Description

Definition at line 40 of file c-file-ptr-stream.h.

Member Typedef Documentation

◆ close_fcn

typedef int(* c_file_ptr_buf::close_fcn) (FILE *)

Definition at line 47 of file c-file-ptr-stream.h.

◆ int_type

typedef std::streambuf::int_type c_file_ptr_buf::int_type

Definition at line 45 of file c-file-ptr-stream.h.

Constructor & Destructor Documentation

◆ c_file_ptr_buf() [1/2]

c_file_ptr_buf::c_file_ptr_buf ( FILE *  f,
close_fcn  cf = file_close 
)
inline

Definition at line 51 of file c-file-ptr-stream.h.

◆ c_file_ptr_buf() [2/2]

c_file_ptr_buf::c_file_ptr_buf ( const c_file_ptr_buf )
delete

◆ ~c_file_ptr_buf()

c_file_ptr_buf::~c_file_ptr_buf ( void  )

Definition at line 50 of file c-file-ptr-stream.cc.

References buf_close().

Member Function Documentation

◆ buf_close()

int c_file_ptr_buf::buf_close ( void  )

Definition at line 159 of file c-file-ptr-stream.cc.

References flush(), m_cf, and m_f.

Referenced by ~c_file_ptr_buf().

◆ clear()

void c_file_ptr_buf::clear ( void  )
inline

Definition at line 93 of file c-file-ptr-stream.h.

◆ file_close()

int c_file_ptr_buf::file_close ( FILE *  m_f)
static

Definition at line 187 of file c-file-ptr-stream.cc.

References m_f.

◆ file_number()

int c_file_ptr_buf::file_number ( ) const
inline

Definition at line 87 of file c-file-ptr-stream.h.

◆ flush()

int c_file_ptr_buf::flush ( void  )

Definition at line 153 of file c-file-ptr-stream.cc.

References m_f.

Referenced by buf_close(), overflow(), and sync().

◆ operator=()

c_file_ptr_buf& c_file_ptr_buf::operator= ( const c_file_ptr_buf )
delete

◆ overflow()

c_file_ptr_buf::int_type c_file_ptr_buf::overflow ( int_type  c)

Definition at line 58 of file c-file-ptr-stream.cc.

References flush(), and m_f.

◆ pbackfail()

c_file_ptr_buf::int_type c_file_ptr_buf::pbackfail ( int_type  c)

Definition at line 83 of file c-file-ptr-stream.cc.

References m_f.

◆ seek()

int c_file_ptr_buf::seek ( off_t  offset,
int  origin 
)

Definition at line 175 of file c-file-ptr-stream.cc.

References m_f, and octave_fseeko_wrapper().

◆ seekoff()

std::streampos c_file_ptr_buf::seekoff ( std::streamoff  offset,
std::ios::seekdir  dir,
std::ios::openmode  = std::ios::in | std::ios::out 
)

◆ seekpos()

std::streampos c_file_ptr_buf::seekpos ( std::streampos  offset,
std::ios::openmode  = std::ios::in | std::ios::out 
)

Definition at line 132 of file c-file-ptr-stream.cc.

References m_f, octave_fseeko_wrapper(), octave_ftello_wrapper(), and SEEK_SET.

◆ stdiofile()

FILE* c_file_ptr_buf::stdiofile ( void  )
inline

Definition at line 49 of file c-file-ptr-stream.h.

◆ sync()

int c_file_ptr_buf::sync ( void  )

Definition at line 145 of file c-file-ptr-stream.cc.

References flush().

◆ tell()

off_t c_file_ptr_buf::tell ( void  )

Definition at line 181 of file c-file-ptr-stream.cc.

References m_f, and octave_ftello_wrapper().

◆ uflow()

int_type c_file_ptr_buf::uflow ( void  )
inline

Definition at line 67 of file c-file-ptr-stream.h.

◆ underflow()

int_type c_file_ptr_buf::underflow ( void  )
inline

Definition at line 65 of file c-file-ptr-stream.h.

◆ underflow_common()

c_file_ptr_buf::int_type c_file_ptr_buf::underflow_common ( bool  bump)
private

Definition at line 67 of file c-file-ptr-stream.cc.

References m_f.

◆ xsgetn()

std::streamsize c_file_ptr_buf::xsgetn ( char *  s,
std::streamsize  n 
)

Definition at line 99 of file c-file-ptr-stream.cc.

References m_f, and n.

◆ xsputn()

std::streamsize c_file_ptr_buf::xsputn ( const char *  s,
std::streamsize  n 
)

Definition at line 90 of file c-file-ptr-stream.cc.

References m_f, and n.

Member Data Documentation

◆ m_cf

close_fcn c_file_ptr_buf::m_cf
protected

Definition at line 101 of file c-file-ptr-stream.h.

Referenced by buf_close().

◆ m_f

FILE* c_file_ptr_buf::m_f
protected

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