#include "oct-stream.h"
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 |
void | error (const std::string &msg) |
void | error (const char *msg) |
std::string | error (bool clear, int &err_num) |
std::string | error (bool clear=false) |
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_stream & | operator= (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 (const octave_value &offset, const octave_value &origin) |
int | seek (long offset, int origin) |
long | skipl (const octave_value &count, bool &err, const std::string &who) |
long | skipl (long count, bool &err, const std::string &who) |
long | tell (void) |
template<class T > | |
octave_idx_type | write (const Array< T > &, octave_idx_type block_size, oct_data_conv::data_type output_type, octave_idx_type skip, oct_mach_info::float_format flt_fmt) |
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) |
Static Public Member Functions | |
static std::string | mode_as_string (int mode) |
Private Member Functions | |
void | invalid_operation (const std::string &who, const char *rw) |
bool | stream_ok (bool clear=true) const |
Private Attributes | |
octave_base_stream * | rep |
Definition at line 497 of file oct-stream.h.
octave_stream::octave_stream | ( | octave_base_stream * | bs = 0 |
) |
Definition at line 2688 of file oct-stream.cc.
References octave_base_stream::count, and rep.
octave_stream::~octave_stream | ( | void | ) |
Definition at line 2695 of file oct-stream.cc.
References octave_base_stream::count, and rep.
octave_stream::octave_stream | ( | const octave_stream & | s | ) |
Definition at line 2701 of file oct-stream.cc.
References octave_base_stream::count, and rep.
void octave_stream::clearerr | ( | void | ) | [inline] |
Definition at line 617 of file oct-stream.h.
References octave_base_stream::clearerr(), and rep.
void octave_stream::close | ( | void | ) |
Definition at line 3018 of file oct-stream.cc.
References octave_base_stream::close(), rep, and stream_ok().
Referenced by octave_stream_list::do_clear(), and octave_stream_list::do_remove().
bool octave_stream::eof | ( | void | ) | const |
Definition at line 3820 of file oct-stream.cc.
References octave_base_stream::eof(), rep, and stream_ok().
Definition at line 3831 of file oct-stream.cc.
References octave_base_stream::error(), rep, and stream_ok().
Referenced by DEFUN(), DEFUNX(), do_stream_open(), getl(), gets(), oscanf(), printf(), puts(), read(), scanf(), seek(), skipl(), and write().
std::string octave_stream::error | ( | bool | clear = false |
) | [inline] |
Definition at line 575 of file oct-stream.h.
References error().
void octave_stream::error | ( | const std::string & | msg | ) | [inline] |
Definition at line 583 of file oct-stream.h.
References octave_base_stream::error(), and rep.
void octave_stream::error | ( | const char * | msg | ) | [inline] |
int octave_stream::file_number | ( | void | ) | [inline] |
Definition at line 591 of file oct-stream.h.
References octave_base_stream::file_number(), and rep.
Referenced by DEFUNX(), and octave_stream_list::do_insert().
oct_mach_info::float_format octave_stream::float_format | ( | void | ) | const |
Definition at line 3864 of file oct-stream.cc.
References octave_base_stream::float_format(), rep, and stream_ok().
Referenced by octave_stream_list::do_get_info(), octave_stream_list::do_list_open_files(), read(), and write().
int octave_stream::flush | ( | void | ) |
Definition at line 2726 of file oct-stream.cc.
References octave_base_stream::flush(), rep, and stream_ok().
Referenced by DEFUN().
std::string octave_stream::getl | ( | const octave_value & | max_len, | |
bool & | err, | |||
const std::string & | who | |||
) |
Definition at line 2748 of file oct-stream.cc.
References convert_to_valid_int(), error(), error_state, getl(), and octave_value::is_defined().
std::string octave_stream::getl | ( | octave_idx_type | max_len, | |
bool & | err, | |||
const std::string & | who | |||
) |
Definition at line 2737 of file oct-stream.cc.
References octave_base_stream::getl(), rep, and stream_ok().
std::string octave_stream::gets | ( | octave_idx_type | max_len, | |
bool & | err, | |||
const std::string & | who | |||
) |
Definition at line 2777 of file oct-stream.cc.
References octave_base_stream::gets(), rep, and stream_ok().
std::string octave_stream::gets | ( | const octave_value & | max_len, | |
bool & | err, | |||
const std::string & | who | |||
) |
Definition at line 2788 of file oct-stream.cc.
References convert_to_valid_int(), error(), error_state, gets(), and octave_value::is_defined().
std::istream* octave_stream::input_stream | ( | void | ) | [inline] |
Definition at line 607 of file oct-stream.h.
References octave_base_stream::input_stream(), and rep.
Referenced by DEFUN_DLD(), and do_read().
void octave_stream::invalid_operation | ( | const std::string & | who, | |
const char * | rw | |||
) | [inline, private] |
Definition at line 639 of file oct-stream.h.
References octave_base_stream::invalid_operation().
bool octave_stream::is_open | ( | void | ) | const |
Definition at line 3007 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] |
Definition at line 593 of file oct-stream.h.
References rep.
Referenced by DEFUN(), octave_stream_list::do_clear(), octave_stream_list::do_get_info(), and octave_stream_list::do_remove().
int octave_stream::mode | ( | void | ) | const |
Definition at line 3853 of file oct-stream.cc.
References octave_base_stream::mode(), rep, and stream_ok().
Referenced by octave_stream_list::do_get_info(), and octave_stream_list::do_list_open_files().
std::string octave_stream::mode_as_string | ( | int | mode | ) | [static] |
Definition at line 3875 of file oct-stream.cc.
Referenced by octave_stream_list::do_get_info(), and octave_stream_list::do_list_open_files().
std::string octave_stream::name | ( | void | ) | const |
Definition at line 3842 of file oct-stream.cc.
References octave_base_stream::name(), rep, and stream_ok().
Referenced by octave_stream_list::do_get_file_number(), octave_stream_list::do_get_info(), octave_stream_list::do_list_open_files(), and octave_base_stream::file_number().
bool octave_stream::ok | ( | void | ) | const [inline] |
Definition at line 595 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 597 of file oct-stream.h.
References ok().
octave_stream & octave_stream::operator= | ( | const octave_stream & | s | ) |
Definition at line 2709 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 3715 of file oct-stream.cc.
References octave_base_stream::oscanf(), rep, and stream_ok().
octave_value_list octave_stream::oscanf | ( | const octave_value & | fmt, | |
const std::string & | who | |||
) |
Definition at line 3726 of file oct-stream.cc.
References do_string_escapes(), error(), octave_value::is_sq_string(), octave_value::is_string(), oscanf(), and octave_value::string_value().
std::ostream* octave_stream::output_stream | ( | void | ) | [inline] |
Definition at line 612 of file oct-stream.h.
References octave_base_stream::output_stream(), and rep.
int octave_stream::printf | ( | const octave_value & | fmt, | |
const octave_value_list & | args, | |||
const std::string & | who | |||
) |
Definition at line 3762 of file oct-stream.cc.
References do_string_escapes(), error(), octave_value::is_sq_string(), octave_value::is_string(), printf(), and octave_value::string_value().
int octave_stream::printf | ( | const std::string & | fmt, | |
const octave_value_list & | args, | |||
const std::string & | who | |||
) |
Definition at line 3750 of file oct-stream.cc.
References octave_base_stream::printf(), rep, and stream_ok().
int octave_stream::puts | ( | const std::string & | s, | |
const std::string & | who | |||
) |
Definition at line 3787 of file oct-stream.cc.
References octave_base_stream::puts(), rep, and stream_ok().
int octave_stream::puts | ( | const octave_value & | s, | |
const std::string & | who | |||
) |
Definition at line 3800 of file oct-stream.cc.
References error(), octave_value::is_string(), puts(), and octave_value::string_value().
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 | |||
) |
Definition at line 3248 of file oct-stream.cc.
References octave_value::char_matrix_value(), oct_data_conv::dt_char, oct_data_conv::dt_double, oct_data_conv::dt_int16, oct_data_conv::dt_int32, oct_data_conv::dt_int64, oct_data_conv::dt_int8, oct_data_conv::dt_logical, oct_data_conv::dt_schar, oct_data_conv::dt_single, oct_data_conv::dt_uchar, oct_data_conv::dt_uint16, oct_data_conv::dt_uint32, oct_data_conv::dt_uint64, oct_data_conv::dt_uint8, error(), error_state, FILL_TABLE_ROW, float_format(), oct_mach_info::flt_fmt_unknown, get_size(), invalid_operation(), and stream_ok().
Referenced by do_fread().
int octave_stream::rewind | ( | void | ) |
Definition at line 3001 of file oct-stream.cc.
References seek(), and SEEK_SET.
Referenced by DEFUN().
octave_value octave_stream::scanf | ( | const octave_value & | fmt, | |
const Array< double > & | size, | |||
octave_idx_type & | count, | |||
const std::string & | who | |||
) |
Definition at line 3690 of file oct-stream.cc.
References do_string_escapes(), error(), octave_value::is_sq_string(), octave_value::is_string(), scanf(), and octave_value::string_value().
octave_value octave_stream::scanf | ( | const std::string & | fmt, | |
const Array< double > & | size, | |||
octave_idx_type & | count, | |||
const std::string & | who | |||
) |
Definition at line 3678 of file oct-stream.cc.
References rep, octave_base_stream::scanf(), and stream_ok().
Definition at line 2861 of file oct-stream.cc.
References clearerr(), rep, octave_base_stream::seek(), SEEK_CUR, SEEK_END, SEEK_SET, stream_ok(), and octave_base_stream::tell().
Referenced by DEFUN(), do_read(), rewind(), seek(), and write().
int octave_stream::seek | ( | const octave_value & | offset, | |
const octave_value & | origin | |||
) |
Definition at line 2930 of file oct-stream.cc.
References convert_to_valid_int(), error(), error_state, octave_value::is_string(), octave_value::long_value(), seek(), and octave_value::string_value().
long octave_stream::skipl | ( | const octave_value & | count, | |
bool & | err, | |||
const std::string & | who | |||
) |
Definition at line 2828 of file oct-stream.cc.
References convert_to_valid_int(), error(), error_state, octave_value::is_defined(), octave_value::is_scalar_type(), octave_value::scalar_value(), skipl(), and xisinf().
long octave_stream::skipl | ( | long | count, | |
bool & | err, | |||
const std::string & | who | |||
) |
Definition at line 2817 of file oct-stream.cc.
References rep, octave_base_stream::skipl(), and stream_ok().
long octave_stream::tell | ( | void | ) |
Definition at line 2990 of file oct-stream.cc.
References rep, stream_ok(), and octave_base_stream::tell().
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 | |||
) |
Definition at line 3346 of file oct-stream.cc.
References error(), error_state, float_format(), oct_mach_info::flt_fmt_unknown, invalid_operation(), stream_ok(), and octave_value::write().
Referenced by do_fwrite(), octave_char_matrix_str::write(), octave_scalar::write(), octave_matrix::write(), octave_range::write(), OCTAVE_VALUE_INT_SCALAR_T::write(), OCTAVE_VALUE_INT_MATRIX_T::write(), octave_float_matrix::write(), octave_float_complex_matrix::write(), octave_float_complex::write(), octave_float_scalar::write(), octave_complex_matrix::write(), octave_complex::write(), octave_bool::write(), and octave_bool_matrix::write().
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 | |||
) |
Definition at line 3518 of file oct-stream.cc.
References d, Array< T >::data(), do_write(), float_format(), oct_mach_info::flt_fmt_ieee_little_endian, oct_mach_info::flt_fmt_vax_g, Array< T >::length(), output_stream(), seek(), SEEK_CUR, SEEK_END, SEEK_SET, tell(), and oct_mach_info::words_big_endian().
octave_base_stream* octave_stream::rep [private] |
Definition at line 622 of file oct-stream.h.
Referenced by clearerr(), close(), eof(), error(), file_number(), float_format(), flush(), getl(), gets(), input_stream(), is_open(), is_valid(), mode(), name(), octave_stream(), ok(), operator=(), oscanf(), output_stream(), printf(), puts(), scanf(), seek(), skipl(), tell(), and ~octave_stream().