GNU Octave
4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
|
#include "oct-stream.h"
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, octave::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_stream * | rep |
Definition at line 240 of file oct-stream.h.
octave_stream::octave_stream | ( | octave_base_stream * | bs = 0 | ) |
Definition at line 5901 of file oct-stream.cc.
References octave_base_stream::count, and rep.
octave_stream::~octave_stream | ( | void | ) |
Definition at line 5908 of file oct-stream.cc.
References octave_base_stream::count, and rep.
octave_stream::octave_stream | ( | const octave_stream & | s | ) |
Definition at line 5914 of file oct-stream.cc.
References octave_base_stream::count, and rep.
|
inline |
Definition at line 373 of file oct-stream.h.
References octave_base_stream::clearerr(), and rep.
Referenced by seek().
void octave_stream::close | ( | void | ) |
Definition at line 6206 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 7137 of file oct-stream.cc.
References octave_base_stream::eof(), rep, retval, and stream_ok().
std::string octave_stream::error | ( | bool | clear, |
int & | err_num | ||
) |
Definition at line 7148 of file oct-stream.cc.
References octave_base_stream::error(), rep, retval, stream_ok(), and string.
Referenced by finalize_read(), getl(), gets(), oscanf(), printf(), puts(), read(), scanf(), seek(), skipl(), and write().
|
inline |
Definition at line 331 of file oct-stream.h.
References error().
|
inline |
Definition at line 339 of file oct-stream.h.
References octave_base_stream::error(), and rep.
|
inline |
|
inline |
Definition at line 347 of file oct-stream.h.
References octave_base_stream::file_number(), and rep.
Referenced by octave_stream_list::do_insert(), and Fdup2().
|
private |
Definition at line 6362 of file oct-stream.cc.
References 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, oct_data_conv::dt_unknown, error(), FILL_TABLE_ROW, float_format(), octave::mach_info::flt_fmt_ieee_big_endian, octave::mach_info::flt_fmt_ieee_little_endian, octave::mach_info::flt_fmt_unknown, retval, and octave::mach_info::words_big_endian().
Referenced by read().
octave::mach_info::float_format octave_stream::float_format | ( | void | ) | const |
Definition at line 7181 of file oct-stream.cc.
References octave_base_stream::float_format(), octave::mach_info::flt_fmt_unknown, rep, retval, and stream_ok().
Referenced by octave_stream_list::do_get_info(), octave_stream_list::do_list_open_files(), finalize_read(), and write().
int octave_stream::flush | ( | void | ) |
Definition at line 5939 of file oct-stream.cc.
References octave_base_stream::flush(), rep, retval, and stream_ok().
std::string octave_stream::getl | ( | octave_idx_type | max_len, |
bool & | err, | ||
const std::string & | who | ||
) |
Definition at line 5950 of file oct-stream.cc.
References octave_base_stream::getl(), rep, retval, stream_ok(), and string.
Referenced by getl().
std::string octave_stream::getl | ( | const octave_value & | max_len, |
bool & | err, | ||
const std::string & | who | ||
) |
Definition at line 5961 of file oct-stream.cc.
References convert_to_valid_int(), error(), getl(), and octave_value::is_defined().
std::string octave_stream::gets | ( | octave_idx_type | max_len, |
bool & | err, | ||
const std::string & | who | ||
) |
Definition at line 5985 of file oct-stream.cc.
References octave_base_stream::gets(), rep, retval, stream_ok(), and string.
Referenced by gets().
std::string octave_stream::gets | ( | const octave_value & | max_len, |
bool & | err, | ||
const std::string & | who | ||
) |
Definition at line 5996 of file oct-stream.cc.
References convert_to_valid_int(), error(), gets(), and octave_value::is_defined().
|
inline |
Definition at line 363 of file oct-stream.h.
References octave_base_stream::input_stream(), and rep.
Referenced by read().
|
inlineprivate |
Definition at line 395 of file oct-stream.h.
References octave_base_stream::invalid_operation().
bool octave_stream::is_open | ( | void | ) | const |
Definition at line 6195 of file oct-stream.cc.
References octave_base_stream::is_open(), rep, retval, and stream_ok().
Referenced by octave_base_stream::close().
|
inline |
Definition at line 349 of file oct-stream.h.
References rep.
Referenced by 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 7170 of file oct-stream.cc.
References octave_base_stream::mode(), rep, retval, and stream_ok().
Referenced by octave_stream_list::do_get_info(), octave_stream_list::do_list_open_files(), and mode_as_string().
|
static |
Definition at line 7192 of file oct-stream.cc.
References mode(), retval, string, and octave::math::trunc().
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 7159 of file oct-stream.cc.
References octave_base_stream::name(), rep, retval, stream_ok(), and string.
Referenced by octave_stream_list::do_clear(), octave_stream_list::do_get_file_number(), octave_stream_list::do_get_info(), and octave_stream_list::do_list_open_files().
|
inline |
Definition at line 351 of file oct-stream.h.
References octave_base_stream::ok(), and rep.
Referenced by operator bool().
|
inline |
Definition at line 353 of file oct-stream.h.
References ok().
octave_stream & octave_stream::operator= | ( | const octave_stream & | s | ) |
Definition at line 5922 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 7025 of file oct-stream.cc.
References octave_base_stream::oscanf(), rep, retval, and stream_ok().
Referenced by oscanf().
octave_value_list octave_stream::oscanf | ( | const octave_value & | fmt, |
const std::string & | who | ||
) |
Definition at line 7036 of file oct-stream.cc.
References do_string_escapes(), error(), octave_value::is_sq_string(), octave_value::is_string(), oscanf(), retval, string, and octave_value::string_value().
|
inline |
Definition at line 368 of file oct-stream.h.
References octave_base_stream::output_stream(), and rep.
Referenced by 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 7069 of file oct-stream.cc.
References octave_base_stream::printf(), rep, retval, and stream_ok().
Referenced by printf().
int octave_stream::printf | ( | const octave_value & | fmt, |
const octave_value_list & | args, | ||
const std::string & | who | ||
) |
Definition at line 7081 of file oct-stream.cc.
References do_string_escapes(), error(), octave_value::is_sq_string(), octave_value::is_string(), printf(), retval, string, and octave_value::string_value().
int octave_stream::puts | ( | const std::string & | s, |
const std::string & | who | ||
) |
Definition at line 7105 of file oct-stream.cc.
References octave_base_stream::puts(), rep, retval, and stream_ok().
Referenced by puts().
int octave_stream::puts | ( | const octave_value & | s, |
const std::string & | who | ||
) |
Definition at line 7118 of file oct-stream.cc.
References error(), octave_value::is_string(), puts(), retval, s, string, 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, | ||
octave::mach_info::float_format | flt_fmt, | ||
octave_idx_type & | count | ||
) |
Definition at line 6450 of file oct-stream.cc.
References oct_data_conv::data_type_size(), error(), finalize_read(), get_size(), input_stream(), invalid_operation(), max(), retval, seek(), SEEK_CUR, SEEK_END, SEEK_SET, stream_ok(), and tell().
int octave_stream::rewind | ( | void | ) |
Definition at line 6189 of file oct-stream.cc.
octave_value octave_stream::scanf | ( | const std::string & | fmt, |
const Array< double > & | size, | ||
octave_idx_type & | count, | ||
const std::string & | who | ||
) |
Definition at line 6989 of file oct-stream.cc.
References rep, retval, octave_base_stream::scanf(), and stream_ok().
Referenced by scanf().
octave_value octave_stream::scanf | ( | const octave_value & | fmt, |
const Array< double > & | size, | ||
octave_idx_type & | count, | ||
const std::string & | who | ||
) |
Definition at line 7001 of file oct-stream.cc.
References do_string_escapes(), error(), octave_value::is_sq_string(), octave_value::is_string(), retval, scanf(), string, and octave_value::string_value().
Definition at line 6061 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 read(), rewind(), seek(), and skip_bytes().
int octave_stream::seek | ( | const octave_value & | offset, |
const octave_value & | origin | ||
) |
Definition at line 6122 of file oct-stream.cc.
References convert_to_valid_int(), error(), octave_value::is_string(), retval, seek(), SEEK_CUR, SEEK_END, SEEK_SET, string, octave_value::string_value(), val, octave_int< T >::value(), and octave_value::xint64_scalar_value().
Definition at line 6843 of file oct-stream.cc.
References output_stream(), seek(), SEEK_CUR, SEEK_END, SEEK_SET, tell(), and zero.
Referenced by write().
off_t octave_stream::skipl | ( | off_t | count, |
bool & | err, | ||
const std::string & | who | ||
) |
Definition at line 6020 of file oct-stream.cc.
References rep, retval, octave_base_stream::skipl(), and stream_ok().
Referenced by skipl().
off_t octave_stream::skipl | ( | const octave_value & | count, |
bool & | err, | ||
const std::string & | who | ||
) |
Definition at line 6031 of file oct-stream.cc.
References convert_to_valid_int(), error(), octave_value::is_defined(), octave_value::is_scalar_type(), octave::math::isinf(), octave_value::scalar_value(), and skipl().
off_t octave_stream::tell | ( | void | ) |
Definition at line 6178 of file oct-stream.cc.
References rep, retval, stream_ok(), and octave_base_stream::tell().
Referenced by read(), and skip_bytes().
octave_value octave_stream::textscan | ( | const std::string & | fmt, |
octave_idx_type | ntimes, | ||
const octave_value_list & | options, | ||
const std::string & | who, | ||
octave_idx_type & | count | ||
) |
Definition at line 7059 of file oct-stream.cc.
References octave_base_stream::do_textscan(), octave_value(), rep, and stream_ok().
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, | ||
octave::mach_info::float_format | flt_fmt | ||
) |
Definition at line 6647 of file oct-stream.cc.
References error(), float_format(), octave::mach_info::flt_fmt_unknown, invalid_operation(), retval, stream_ok(), and octave_value::write().
Referenced by do_fwrite(), octave_float_complex_matrix::write(), octave_char_matrix_str::write(), octave_complex_matrix::write(), octave_float_complex::write(), octave_complex::write(), octave_float_matrix::write(), octave_bool_matrix::write(), octave_matrix::write(), octave_bool::write(), octave_scalar::write(), octave_float_scalar::write(), octave_range::write(), OCTAVE_VALUE_INT_MATRIX_T::write(), and OCTAVE_VALUE_INT_SCALAR_T::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, | ||
octave::mach_info::float_format | flt_fmt | ||
) |
Definition at line 6887 of file oct-stream.cc.
References convert_data(), Array< T >::data(), oct_data_conv::data_type_size(), octave::mach_info::flt_fmt_ieee_big_endian, octave::mach_info::flt_fmt_ieee_little_endian, Array< T >::numel(), OCTAVE_LOCAL_BUFFER, skip_bytes(), octave::mach_info::words_big_endian(), and write_bytes().
|
private |
Definition at line 378 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(), textscan(), and ~octave_stream().