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

#include "oct-fstrm.h"

Inheritance diagram for octave_fstream:
Collaboration diagram for octave_fstream:

Public Member Functions

 octave_fstream (const std::string &nm_arg, std::ios::openmode arg_md=std::ios::in|std::ios::out, octave::mach_info::float_format flt_fmt=octave::mach_info::native_float_format())
 
 octave_fstream (const octave_fstream &)=delete
 
void close (void)
 
void do_close (void)
 
bool eof (void) const
 
std::string error (bool clear, int &err_num)
 
virtual int file_number (void) const
 
std::istream * input_stream (void)
 
bool is_open (void) const
 
std::string name (void) const
 
bool ok (void) const
 
octave_fstreamoperator= (const octave_fstream &)=delete
 
std::ostream * output_stream (void)
 
int seek (off_t offset, int origin)
 
off_t tell (void)
 

Static Public Member Functions

static octave::stream create (const std::string &nm_arg, std::ios::openmode arg_md=std::ios::in|std::ios::out, octave::mach_info::float_format flt_fmt=octave::mach_info::native_float_format())
 

Protected Member Functions

 ~octave_fstream (void)=default
 
void clear (void)
 
void clearerr (void)
 
void error (const std::string &msg)
 
void error (const std::string &who, const std::string &msg)
 
mach_info::float_format float_format (void) const
 
int mode (void) const
 

Private Attributes

std::fstream fs
 
std::string nm
 

Detailed Description

Definition at line 33 of file oct-fstrm.h.

Constructor & Destructor Documentation

◆ octave_fstream() [1/2]

octave_fstream::octave_fstream ( const std::string nm_arg,
std::ios::openmode  arg_md = std::ios::in | std::ios::out,
octave::mach_info::float_format  flt_fmt = octave::mach_info::native_float_format () 
)

Definition at line 40 of file oct-fstrm.cc.

References octave::base_stream::error(), fs, and nm.

◆ octave_fstream() [2/2]

octave_fstream::octave_fstream ( const octave_fstream )
delete

◆ ~octave_fstream()

octave_fstream::~octave_fstream ( void  )
protecteddefault

Member Function Documentation

◆ clear()

void octave::base_stream::clear ( void  )
protectedinherited

◆ clearerr()

void octave::base_stream::clearerr ( void  )
protectedinherited

◆ close()

void octave::base_stream::close ( void  )
inlineinherited

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

Referenced by octave::stream::close().

◆ create()

octave::stream octave_fstream::create ( const std::string nm_arg,
std::ios::openmode  arg_md = std::ios::in | std::ios::out,
octave::mach_info::float_format  flt_fmt = octave::mach_info::native_float_format () 
)
static

Definition at line 34 of file oct-fstrm.cc.

◆ do_close()

void octave_fstream::do_close ( void  )
virtual

Reimplemented from octave::base_stream.

Definition at line 83 of file oct-fstrm.cc.

References fs.

◆ eof()

bool octave_fstream::eof ( void  ) const
virtual

Implements octave::base_stream.

Definition at line 77 of file oct-fstrm.cc.

References fs.

◆ error() [1/3]

◆ error() [2/3]

void octave::base_stream::error ( const std::string msg)
protectedinherited

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

References octave::base_stream::errmsg, and octave::base_stream::fail.

◆ error() [3/3]

void octave::base_stream::error ( const std::string who,
const std::string msg 
)
protectedinherited

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

References octave::base_stream::errmsg, and octave::base_stream::fail.

◆ file_number()

◆ float_format()

mach_info::float_format octave::base_stream::float_format ( void  ) const
inlineprotectedinherited

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

References flt_fmt.

Referenced by octave::stream::float_format().

◆ input_stream()

std::istream * octave_fstream::input_stream ( void  )
virtual

Reimplemented from octave::base_stream.

Definition at line 89 of file oct-fstrm.cc.

References fs, octave::base_stream::mode(), and retval.

◆ is_open()

bool octave::base_stream::is_open ( void  ) const
inlineinherited

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

Referenced by octave::stream::is_open().

◆ mode()

int octave::base_stream::mode ( void  ) const
inlineprotectedinherited

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

Referenced by input_stream(), octave::stream::mode(), and output_stream().

◆ name()

std::string octave_fstream::name ( void  ) const
inlinevirtual

Implements octave::base_stream.

Definition at line 71 of file oct-fstrm.h.

References nm.

◆ ok()

bool octave::base_stream::ok ( void  ) const
inlineinherited

◆ operator=()

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

◆ output_stream()

std::ostream * octave_fstream::output_stream ( void  )
virtual

Reimplemented from octave::base_stream.

Definition at line 100 of file oct-fstrm.cc.

References fs, octave::base_stream::mode(), and retval.

◆ seek()

int octave_fstream::seek ( off_t  offset,
int  origin 
)
virtual

Implements octave::base_stream.

Definition at line 55 of file oct-fstrm.cc.

References octave::base_stream::error().

◆ tell()

off_t octave_fstream::tell ( void  )
virtual

Implements octave::base_stream.

Definition at line 66 of file oct-fstrm.cc.

References octave::base_stream::error().

Member Data Documentation

◆ fs

std::fstream octave_fstream::fs
private

Definition at line 85 of file oct-fstrm.h.

Referenced by do_close(), eof(), input_stream(), octave_fstream(), and output_stream().

◆ nm

std::string octave_fstream::nm
private

Definition at line 83 of file oct-fstrm.h.

Referenced by octave_fstream().


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