GNU Octave  9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
base_stream Class Referenceabstract

#include "oct-stream.h"

Inheritance diagram for base_stream:
tstdiostream< c_file_ptr_buf, io_c_file_ptr_stream, FILE * > tstdiostream< c_zfile_ptr_buf, io_c_zfile_ptr_stream, gzFile > base_iostream base_strstream fstream tstdiostream< BUF_T, STREAM_T, FILE_T > stdiostream zstdiostream istream ostream istrstream ostrstream

Public Member Functions

 base_stream (std::ios::openmode arg_md=std::ios::in|std::ios::out, mach_info::float_format ff=mach_info::native_float_format(), const std::string &encoding="utf-8")
 
virtual ~base_stream ()=default
 
void close ()
 
virtual void do_close ()
 
virtual bool eof () const =0
 
std::string error (bool clear, int &err_num)
 
virtual int file_number () const
 
virtual std::istream * input_stream ()
 
bool is_open () const
 
virtual std::string name () const =0
 
bool ok () const
 
virtual std::ostream * output_stream ()
 
std::ostream * preferred_output_stream ()
 
virtual int seek (off_t offset, int origin)=0
 
virtual off_t tell ()=0
 

Protected Member Functions

void clear ()
 
void clearerr ()
 
std::string encoding () const
 
void error (const std::string &msg)
 
void error (const std::string &who, const std::string &msg)
 
mach_info::float_format float_format () const
 
int mode () const
 

Friends

class stream
 

Detailed Description

Definition at line 66 of file oct-stream.h.

Constructor & Destructor Documentation

◆ base_stream()

base_stream::base_stream ( std::ios::openmode  arg_md = std::ios::in | std::ios::out,
mach_info::float_format  ff = mach_info::native_float_format (),
const std::string &  encoding = "utf-8" 
)
inline

Definition at line 74 of file oct-stream.h.

◆ ~base_stream()

virtual base_stream::~base_stream ( )
virtualdefault

Member Function Documentation

◆ clear()

void base_stream::clear ( )
protected

Definition at line 4049 of file oct-stream.cc.

Referenced by error().

◆ clearerr()

void base_stream::clearerr ( )
protected

Definition at line 4056 of file oct-stream.cc.

References input_stream(), and preferred_output_stream().

◆ close()

void base_stream::close ( )
inline

Definition at line 151 of file oct-stream.h.

References stream::is_open().

◆ do_close()

◆ encoding()

std::string base_stream::encoding ( ) const
inlineprotected

Definition at line 186 of file oct-stream.h.

Referenced by istrstream::create(), and ostrstream::create().

◆ eof()

◆ error() [1/3]

std::string base_stream::error ( bool  clear,
int &  err_num 
)

◆ error() [2/3]

void base_stream::error ( const std::string &  msg)
protected

◆ error() [3/3]

void base_stream::error ( const std::string &  who,
const std::string &  msg 
)
protected

◆ file_number()

virtual int base_stream::file_number ( ) const
inlinevirtual

◆ float_format()

mach_info::float_format base_stream::float_format ( ) const
inlineprotected

Definition at line 184 of file oct-stream.h.

◆ input_stream()

◆ is_open()

bool base_stream::is_open ( ) const
inline

Definition at line 147 of file oct-stream.h.

◆ mode()

int base_stream::mode ( ) const
inlineprotected

Definition at line 182 of file oct-stream.h.

Referenced by fstream::input_stream(), and fstream::output_stream().

◆ name()

◆ ok()

bool base_stream::ok ( ) const
inline

Definition at line 174 of file oct-stream.h.

◆ output_stream()

◆ preferred_output_stream()

std::ostream* base_stream::preferred_output_stream ( )
inline

Definition at line 120 of file oct-stream.h.

References stream::output_stream().

Referenced by clearerr().

◆ seek()

◆ tell()

Friends And Related Function Documentation

◆ stream

friend class stream
friend

Definition at line 70 of file oct-stream.h.

Referenced by istrstream::create(), fstream::create(), and ostrstream::create().


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