GNU Octave  3.8.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 | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
octave_stream Class Reference

#include "oct-stream.h"

Collaboration diagram for octave_stream:
Collaboration graph
[legend]

Public Member Functions

 octave_stream (octave_base_stream *bs=0)
 octave_stream (const octave_stream &)
 ~octave_stream (void)
void clearerr (void)
void close (void)
bool eof (void) const
std::string error (bool clear, int &err_num)
std::string error (bool clear=false)
void error (const std::string &msg)
void error (const char *msg)
int file_number (void)
oct_mach_info::float_format float_format (void) const
int flush (void)
std::string getl (octave_idx_type max_len, bool &err, const std::string &who)
std::string getl (const octave_value &max_len, bool &err, const std::string &who)
std::string gets (octave_idx_type max_len, bool &err, const std::string &who)
std::string gets (const octave_value &max_len, bool &err, const std::string &who)
std::istream * input_stream (void)
bool is_open (void) const
bool is_valid (void) const
int mode (void) const
std::string name (void) const
bool ok (void) const
 operator bool () const
octave_streamoperator= (const octave_stream &)
octave_value_list oscanf (const std::string &fmt, const std::string &who)
octave_value_list oscanf (const octave_value &fmt, const std::string &who)
std::ostream * output_stream (void)
int printf (const std::string &fmt, const octave_value_list &args, const std::string &who)
int printf (const octave_value &fmt, const octave_value_list &args, const std::string &who)
int puts (const std::string &s, const std::string &who)
int puts (const octave_value &s, const std::string &who)
octave_value read (const Array< double > &size, octave_idx_type block_size, oct_data_conv::data_type input_type, oct_data_conv::data_type output_type, octave_idx_type skip, oct_mach_info::float_format flt_fmt, octave_idx_type &count)
int rewind (void)
octave_value scanf (const std::string &fmt, const Array< double > &size, octave_idx_type &count, const std::string &who)
octave_value scanf (const octave_value &fmt, const Array< double > &size, octave_idx_type &count, const std::string &who)
int seek (off_t offset, int origin)
int seek (const octave_value &offset, const octave_value &origin)
bool skip_bytes (size_t n_elts)
off_t skipl (off_t count, bool &err, const std::string &who)
off_t skipl (const octave_value &count, bool &err, const std::string &who)
off_t tell (void)
octave_idx_type write (const octave_value &data, octave_idx_type block_size, oct_data_conv::data_type output_type, octave_idx_type skip, oct_mach_info::float_format flt_fmt)
template<class T >
octave_idx_type write (const Array< T > &data, octave_idx_type block_size, oct_data_conv::data_type output_type, octave_idx_type skip, oct_mach_info::float_format flt_fmt)
bool write_bytes (const void *data, size_t n_elts)

Static Public Member Functions

static std::string mode_as_string (int mode)

Private Member Functions

octave_value finalize_read (std::list< void * > &input_buf_list, octave_idx_type input_buf_elts, octave_idx_type elts_read, octave_idx_type nr, octave_idx_type nc, oct_data_conv::data_type input_type, oct_data_conv::data_type output_type, oct_mach_info::float_format ffmt)
void invalid_operation (const std::string &who, const char *rw)
bool stream_ok (bool clear=true) const

Private Attributes

octave_base_streamrep

Detailed Description

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

Constructor & Destructor Documentation

octave_stream::octave_stream ( octave_base_stream bs = 0)

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

References octave_base_stream::count, and rep.

octave_stream::~octave_stream ( void  )

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

References octave_base_stream::count, and rep.

octave_stream::octave_stream ( const octave_stream s)

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

References octave_base_stream::count, and rep.

Member Function Documentation

void octave_stream::clearerr ( void  )
inline

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

References octave_base_stream::clearerr(), and rep.

Referenced by Ffclear(), and seek().

void octave_stream::close ( void  )
bool octave_stream::eof ( void  ) const

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

References octave_base_stream::eof(), rep, and stream_ok().

Referenced by Ffeof(), and Fsscanf().

std::string octave_stream::error ( bool  clear,
int err_num 
)
std::string octave_stream::error ( bool  clear = false)
inline

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

References error().

void octave_stream::error ( const std::string &  msg)
inline

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

References octave_base_stream::error(), and rep.

void octave_stream::error ( const char msg)
inline

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

References error().

Referenced by error().

int octave_stream::file_number ( void  )
inline

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

References octave_base_stream::file_number(), and rep.

Referenced by octave_stream_list::do_insert(), Fdup2(), and Ffcntl().

octave_value octave_stream::finalize_read ( std::list< void * > &  input_buf_list,
octave_idx_type  input_buf_elts,
octave_idx_type  elts_read,
octave_idx_type  nr,
octave_idx_type  nc,
oct_data_conv::data_type  input_type,
oct_data_conv::data_type  output_type,
oct_mach_info::float_format  ffmt 
)
private
oct_mach_info::float_format octave_stream::float_format ( void  ) const
int octave_stream::flush ( void  )

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

References octave_base_stream::flush(), rep, and stream_ok().

Referenced by Ffflush().

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

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

References octave_base_stream::getl(), rep, and stream_ok().

Referenced by Ffgetl(), and getl().

std::string octave_stream::getl ( const octave_value max_len,
bool err,
const std::string &  who 
)
std::string octave_stream::gets ( octave_idx_type  max_len,
bool err,
const std::string &  who 
)

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

References octave_base_stream::gets(), rep, and stream_ok().

Referenced by Ffgets(), and gets().

std::string octave_stream::gets ( const octave_value max_len,
bool err,
const std::string &  who 
)
std::istream* octave_stream::input_stream ( void  )
inline

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

References octave_base_stream::input_stream(), and rep.

Referenced by Fdlmread(), and read().

void octave_stream::invalid_operation ( const std::string &  who,
const char rw 
)
inlineprivate

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

References octave_base_stream::invalid_operation().

Referenced by read(), and write().

bool octave_stream::is_open ( void  ) const

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

References octave_base_stream::is_open(), rep, and stream_ok().

Referenced by octave_base_stream::close().

bool octave_stream::is_valid ( void  ) const
inline
int octave_stream::mode ( void  ) const
std::string octave_stream::mode_as_string ( int  mode)
static

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

References mode().

Referenced by octave_stream_list::do_get_info(), and octave_stream_list::do_list_open_files().

std::string octave_stream::name ( void  ) const
bool octave_stream::ok ( void  ) const
inline

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

References octave_base_stream::ok(), and rep.

Referenced by operator bool().

octave_stream::operator bool ( ) const
inline

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

References ok().

octave_stream & octave_stream::operator= ( const octave_stream s)

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

References octave_base_stream::count, and rep.

octave_value_list octave_stream::oscanf ( const std::string &  fmt,
const std::string &  who 
)

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

References octave_base_stream::oscanf(), rep, and stream_ok().

Referenced by Ffscanf(), Fsscanf(), and oscanf().

octave_value_list octave_stream::oscanf ( const octave_value fmt,
const std::string &  who 
)
std::ostream* octave_stream::output_stream ( void  )
inline

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

References octave_base_stream::output_stream(), and rep.

Referenced by Ffdisp(), skip_bytes(), and write_bytes().

int octave_stream::printf ( const std::string &  fmt,
const octave_value_list args,
const std::string &  who 
)

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

References octave_base_stream::printf(), rep, and stream_ok().

Referenced by Ffprintf(), Fprintf(), Fsprintf(), and printf().

int octave_stream::printf ( const octave_value fmt,
const octave_value_list args,
const std::string &  who 
)
int octave_stream::puts ( const std::string &  s,
const std::string &  who 
)

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

References octave_base_stream::puts(), rep, and stream_ok().

Referenced by Ffputs(), Fputs(), and puts().

int octave_stream::puts ( const octave_value s,
const std::string &  who 
)
octave_value octave_stream::read ( const Array< double > &  size,
octave_idx_type  block_size,
oct_data_conv::data_type  input_type,
oct_data_conv::data_type  output_type,
octave_idx_type  skip,
oct_mach_info::float_format  flt_fmt,
octave_idx_type count 
)
int octave_stream::rewind ( void  )

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

References seek(), and SEEK_SET.

Referenced by Ffrewind().

octave_value octave_stream::scanf ( const std::string &  fmt,
const Array< double > &  size,
octave_idx_type count,
const std::string &  who 
)

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

References rep, octave_base_stream::scanf(), and stream_ok().

Referenced by Ffscanf(), Fsscanf(), and scanf().

octave_value octave_stream::scanf ( const octave_value fmt,
const Array< double > &  size,
octave_idx_type count,
const std::string &  who 
)
int octave_stream::seek ( off_t  offset,
int  origin 
)
int octave_stream::seek ( const octave_value offset,
const octave_value origin 
)
bool octave_stream::skip_bytes ( size_t  n_elts)

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

References output_stream(), seek(), SEEK_CUR, SEEK_END, SEEK_SET, and tell().

Referenced by write().

off_t octave_stream::skipl ( off_t  count,
bool err,
const std::string &  who 
)

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

References rep, octave_base_stream::skipl(), and stream_ok().

Referenced by Ffskipl(), and skipl().

off_t octave_stream::skipl ( const octave_value count,
bool err,
const std::string &  who 
)
bool octave_stream::stream_ok ( bool  clear = true) const
inlineprivate
off_t octave_stream::tell ( void  )

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

References rep, stream_ok(), and octave_base_stream::tell().

Referenced by Fftell(), Fsscanf(), and skip_bytes().

octave_idx_type octave_stream::write ( const octave_value data,
octave_idx_type  block_size,
oct_data_conv::data_type  output_type,
octave_idx_type  skip,
oct_mach_info::float_format  flt_fmt 
)
template<class T >
octave_idx_type octave_stream::write ( const Array< T > &  data,
octave_idx_type  block_size,
oct_data_conv::data_type  output_type,
octave_idx_type  skip,
oct_mach_info::float_format  flt_fmt 
)
bool octave_stream::write_bytes ( const void data,
size_t  n_elts 
)

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

References output_stream().

Referenced by write().

Member Data Documentation

octave_base_stream* octave_stream::rep
private

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