GNU Octave  4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
octave_base_stream Class Referenceabstract

#include "oct-stream.h"

Inheritance diagram for octave_base_stream:
Inheritance graph
[legend]
Collaboration diagram for octave_base_stream:
Collaboration graph
[legend]

Public Member Functions

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

Protected Member Functions

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

Private Member Functions

 octave_base_stream (const octave_base_stream &)
 
std::string do_gets (octave_idx_type max_len, bool &err, bool strip_newline, const std::string &who)
 
int do_numeric_printf_conv (std::ostream &os, const printf_format_elt *elt, int nsa, int sa_1, int sa_2, const octave_value &val, const std::string &who)
 
bool do_oscanf (const scanf_format_elt *elt, octave_value &, const std::string &who)
 
int do_printf (printf_format_list &fmt_list, const octave_value_list &args, const std::string &who)
 
octave_value do_scanf (scanf_format_list &fmt_list, octave_idx_type nr, octave_idx_type nc, bool one_elt_size_spec, octave_idx_type &count, const std::string &who)
 
int flush (void)
 
std::string getl (octave_idx_type max_len, bool &err, const std::string &who)
 
std::string gets (octave_idx_type max_len, bool &err, const std::string &who)
 
void invalid_operation (const std::string &who, const char *rw)
 
octave_base_streamoperator= (const octave_base_stream &)
 
octave_value_list oscanf (const std::string &fmt, const std::string &who)
 
int printf (const std::string &fmt, const octave_value_list &args, const std::string &who)
 
int puts (const std::string &s, const std::string &who)
 
octave_value scanf (const std::string &fmt, const Array< double > &size, octave_idx_type &count, const std::string &who)
 
off_t skipl (off_t count, bool &err, const std::string &who)
 

Private Attributes

octave_refcount< octave_idx_typecount
 
std::string errmsg
 
bool fail
 
oct_mach_info::float_format flt_fmt
 
int md
 
bool open_state
 

Friends

class octave_stream
 

Detailed Description

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

Constructor & Destructor Documentation

octave_base_stream::octave_base_stream ( std::ios::openmode  arg_md = std::ios::in|std::ios::out,
oct_mach_info::float_format  ff = oct_mach_info::native_float_format () 
)
inline

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

virtual octave_base_stream::~octave_base_stream ( void  )
inlinevirtual

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

octave_base_stream::octave_base_stream ( const octave_base_stream )
private

Member Function Documentation

void octave_base_stream::clear ( void  )
protected

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

References errmsg, and fail.

Referenced by error(), and octave_stream::stream_ok().

void octave_base_stream::clearerr ( void  )
protected

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

References input_stream(), and output_stream().

Referenced by octave_stream::clearerr().

void octave_base_stream::close ( void  )
inline

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

References octave_stream::is_open().

Referenced by octave_stream::close().

virtual void octave_base_stream::do_close ( void  )
inlinevirtual
std::string octave_base_stream::do_gets ( octave_idx_type  max_len,
bool err,
bool  strip_newline,
const std::string &  who 
)
private

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

References error(), file_number(), input_stream(), interactive, and invalid_operation().

Referenced by do_oscanf(), do_scanf(), getl(), and gets().

int octave_base_stream::do_numeric_printf_conv ( std::ostream &  os,
const printf_format_elt elt,
int  nsa,
int  sa_1,
int  sa_2,
const octave_value val,
const std::string &  who 
)
private
bool octave_base_stream::do_oscanf ( const scanf_format_elt elt,
octave_value retval,
const std::string &  who 
)
private
int octave_base_stream::do_printf ( printf_format_list fmt_list,
const octave_value_list args,
const std::string &  who 
)
private
octave_value octave_base_stream::do_scanf ( scanf_format_list fmt_list,
octave_idx_type  nr,
octave_idx_type  nc,
bool  one_elt_size_spec,
octave_idx_type count,
const std::string &  who 
)
private
virtual bool octave_base_stream::eof ( void  ) const
pure virtual
std::string octave_base_stream::error ( bool  clear,
int err_num 
)
void octave_base_stream::error ( const std::string &  msg)
protected

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

References errmsg, and fail.

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

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

References errmsg, and fail.

virtual int octave_base_stream::file_number ( void  ) const
inlinevirtual
oct_mach_info::float_format octave_base_stream::float_format ( void  ) const
inlineprotected

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

Referenced by octave_stream::float_format().

int octave_base_stream::flush ( void  )
private

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

References invalid_operation(), and output_stream().

Referenced by octave_stream::flush().

std::string octave_base_stream::getl ( octave_idx_type  max_len,
bool err,
const std::string &  who 
)
private

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

References do_gets().

Referenced by octave_stream::getl().

std::string octave_base_stream::gets ( octave_idx_type  max_len,
bool err,
const std::string &  who 
)
private

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

References do_gets().

Referenced by octave_stream::gets().

virtual std::istream* octave_base_stream::input_stream ( void  )
inlinevirtual
void octave_base_stream::invalid_operation ( const std::string &  who,
const char rw 
)
private

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

References error().

Referenced by do_gets(), do_printf(), flush(), octave_stream::invalid_operation(), oscanf(), puts(), scanf(), and skipl().

bool octave_base_stream::is_open ( void  ) const
inline

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

Referenced by octave_stream::is_open().

int octave_base_stream::mode ( void  ) const
inlineprotected
virtual std::string octave_base_stream::name ( void  ) const
pure virtual
bool octave_base_stream::ok ( void  ) const
inline

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

Referenced by do_oscanf(), do_scanf(), octave_stream::ok(), and oscanf().

octave_base_stream& octave_base_stream::operator= ( const octave_base_stream )
private
octave_value_list octave_base_stream::oscanf ( const std::string &  fmt,
const std::string &  who 
)
private
virtual std::ostream* octave_base_stream::output_stream ( void  )
inlinevirtual
int octave_base_stream::printf ( const std::string &  fmt,
const octave_value_list args,
const std::string &  who 
)
private

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

References do_printf(), error(), and printf_format_list::num_conversions().

Referenced by octave_stream::printf().

int octave_base_stream::puts ( const std::string &  s,
const std::string &  who 
)
private

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

References error(), invalid_operation(), and output_stream().

Referenced by octave_stream::puts().

octave_value octave_base_stream::scanf ( const std::string &  fmt,
const Array< double > &  size,
octave_idx_type count,
const std::string &  who 
)
private
virtual int octave_base_stream::seek ( off_t  offset,
int  origin 
)
pure virtual
off_t octave_base_stream::skipl ( off_t  count,
bool err,
const std::string &  who 
)
private

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

References count, error(), file_number(), input_stream(), interactive, and invalid_operation().

Referenced by octave_stream::skipl().

virtual off_t octave_base_stream::tell ( void  )
pure virtual

Friends And Related Function Documentation

friend class octave_stream
friend

Member Data Documentation

octave_refcount<octave_idx_type> octave_base_stream::count
private
std::string octave_base_stream::errmsg
private

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

Referenced by clear(), and error().

bool octave_base_stream::fail
private

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

Referenced by clear(), and error().

oct_mach_info::float_format octave_base_stream::flt_fmt
private

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

int octave_base_stream::md
private

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

bool octave_base_stream::open_state
private

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


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