GNU Octave
4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
|
#include "oct-stream.h"
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_stream & | operator= (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_type > | count |
std::string | errmsg |
bool | fail |
oct_mach_info::float_format | flt_fmt |
int | md |
bool | open_state |
Friends | |
class | octave_stream |
Definition at line 327 of file oct-stream.h.
|
inline |
Definition at line 335 of file oct-stream.h.
|
inlinevirtual |
Definition at line 342 of file oct-stream.h.
|
private |
|
protected |
Definition at line 906 of file oct-stream.cc.
Referenced by error(), and octave_stream::stream_ok().
|
protected |
Definition at line 913 of file oct-stream.cc.
References input_stream(), and output_stream().
Referenced by octave_stream::clearerr().
|
inline |
Definition at line 381 of file oct-stream.h.
References octave_stream::is_open().
Referenced by octave_stream::close().
|
inlinevirtual |
Reimplemented in octave_tstdiostream< BUF_T, STREAM_T, FILE_T >, octave_tstdiostream< c_file_ptr_buf, io_c_file_ptr_stream, FILE * >, octave_tstdiostream< c_zfile_ptr_buf, io_c_zfile_ptr_stream, gzFile >, and octave_fstream.
Definition at line 379 of file oct-stream.h.
|
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().
|
private |
Definition at line 2500 of file oct-stream.cc.
References do_printf_conv(), octave_value::double_value(), error(), error_state, printf_format_elt::flags, octave_value::int64_scalar_value(), is_nan_or_inf(), lo_ieee_is_NA, lo_ieee_isinf, ok_for_signed_int_conv(), ok_for_unsigned_int_conv(), printf_format_elt::prec, switch_to_g_format(), printf_format_elt::text, printf_format_elt::type, octave_value::uint64_scalar_value(), and octave_int< T >::value().
Referenced by do_printf().
|
private |
Definition at line 1917 of file oct-stream.cc.
References BEGIN_C_CONVERSION, BEGIN_CHAR_CLASS_CONVERSION, BEGIN_S_CONVERSION, scanf_format_elt::discard, do_gets(), DO_LITERAL_CONVERSION, DO_PCT_CONVERSION, DO_WHITESPACE_CONVERSION, error(), forced_interactive, input_stream(), interactive, scanf_format_elt::literal_conversion, name(), OCTAVE_SCAN, ok(), scanf_format_elt::text, scanf_format_elt::type, and scanf_format_elt::whitespace_conversion.
Referenced by oscanf().
|
private |
Definition at line 2625 of file oct-stream.cc.
References printf_format_elt::args, do_numeric_printf_conv(), do_printf_string(), error(), error_state, printf_value_cache::exhausted(), printf_format_list::first(), printf_format_elt::fw, printf_value_cache::get_next_value(), printf_value_cache::int_value(), invalid_operation(), octave_value::is_string(), printf_format_list::next(), printf_format_list::num_conversions(), output_stream(), printf_format_elt::prec, octave_value::string_value(), printf_format_elt::text, and printf_format_elt::type.
Referenced by printf().
|
private |
Definition at line 1491 of file oct-stream.cc.
References scanf_format_list::all_character_conversions(), BEGIN_C_CONVERSION, BEGIN_CHAR_CLASS_CONVERSION, BEGIN_S_CONVERSION, octave_value::convert_to_str(), scanf_format_elt::discard, do_gets(), DO_LITERAL_CONVERSION, DO_PCT_CONVERSION, do_scanf_conv(), DO_WHITESPACE_CONVERSION, error(), file_number(), FINISH_CHARACTER_CONVERSION, scanf_format_list::first(), forced_interactive, Array< T >::fortran_vec(), input_stream(), interactive, scanf_format_list::length(), scanf_format_elt::literal_conversion, scanf_format_elt::modifier, name(), scanf_format_list::next(), scanf_format_list::num_conversions(), ok(), panic_impossible, Matrix::resize(), scanf_format_elt::text, scanf_format_elt::type, and scanf_format_elt::whitespace_conversion.
Referenced by scanf().
|
pure virtual |
Implemented in octave_ostrstream, octave_ostream, octave_istrstream, octave_istream, octave_fstream, octave_tstdiostream< BUF_T, STREAM_T, FILE_T >, octave_tstdiostream< c_file_ptr_buf, io_c_file_ptr_stream, FILE * >, octave_tstdiostream< c_zfile_ptr_buf, io_c_zfile_ptr_stream, gzFile >, and octave_base_iostream.
Referenced by octave_stream::eof().
Definition at line 2801 of file oct-stream.cc.
References clear(), errmsg, and fail.
Referenced by do_gets(), do_numeric_printf_conv(), do_oscanf(), do_printf(), do_scanf(), octave_stream::error(), octave_base_iostream::invalid_operation(), invalid_operation(), octave_fstream::octave_fstream(), oscanf(), printf(), puts(), scanf(), octave_base_strstream::seek(), octave_fstream::seek(), skipl(), octave_base_strstream::tell(), and octave_fstream::tell().
|
protected |
Definition at line 892 of file oct-stream.cc.
|
protected |
Definition at line 899 of file oct-stream.cc.
|
inlinevirtual |
Reimplemented in octave_tstdiostream< BUF_T, STREAM_T, FILE_T >, octave_tstdiostream< c_file_ptr_buf, io_c_file_ptr_stream, FILE * >, and octave_tstdiostream< c_zfile_ptr_buf, io_c_zfile_ptr_stream, gzFile >.
Definition at line 390 of file oct-stream.h.
References octave_stream::name().
Referenced by do_gets(), do_scanf(), octave_stream::file_number(), and skipl().
|
inlineprotected |
Definition at line 414 of file oct-stream.h.
Referenced by octave_stream::float_format().
|
private |
Definition at line 2145 of file oct-stream.cc.
References invalid_operation(), and output_stream().
Referenced by octave_stream::flush().
|
private |
Definition at line 1032 of file oct-stream.cc.
References do_gets().
Referenced by octave_stream::getl().
|
private |
Definition at line 1039 of file oct-stream.cc.
References do_gets().
Referenced by octave_stream::gets().
|
inlinevirtual |
Reimplemented in octave_ostrstream, octave_ostream, octave_istrstream, octave_istream, octave_fstream, octave_tstdiostream< BUF_T, STREAM_T, FILE_T >, octave_tstdiostream< c_file_ptr_buf, io_c_file_ptr_stream, FILE * >, and octave_tstdiostream< c_zfile_ptr_buf, io_c_zfile_ptr_stream, gzFile >.
Definition at line 367 of file oct-stream.h.
Referenced by clearerr(), do_gets(), do_oscanf(), do_scanf(), octave_stream::input_stream(), oscanf(), scanf(), and skipl().
|
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().
|
inline |
Definition at line 377 of file oct-stream.h.
Referenced by octave_stream::is_open().
|
inlineprotected |
Definition at line 412 of file oct-stream.h.
Referenced by octave_fstream::input_stream(), octave_stream::mode(), and octave_fstream::output_stream().
|
pure virtual |
Implemented in octave_fstream, octave_tstdiostream< BUF_T, STREAM_T, FILE_T >, octave_tstdiostream< c_file_ptr_buf, io_c_file_ptr_stream, FILE * >, octave_tstdiostream< c_zfile_ptr_buf, io_c_zfile_ptr_stream, gzFile >, octave_base_iostream, and octave_base_strstream.
Referenced by do_oscanf(), do_scanf(), and octave_stream::name().
|
inline |
Definition at line 404 of file oct-stream.h.
Referenced by do_oscanf(), do_scanf(), octave_stream::ok(), and oscanf().
|
private |
|
private |
Definition at line 2066 of file oct-stream.cc.
References do_oscanf(), error(), scanf_format_list::first(), input_stream(), invalid_operation(), octave_value::is_defined(), scanf_format_list::length(), scanf_format_list::next(), scanf_format_list::num_conversions(), ok(), and octave_value_list::resize().
Referenced by octave_stream::oscanf().
|
inlinevirtual |
Reimplemented in octave_ostrstream, octave_ostream, octave_istrstream, octave_istream, octave_fstream, octave_tstdiostream< BUF_T, STREAM_T, FILE_T >, octave_tstdiostream< c_file_ptr_buf, io_c_file_ptr_stream, FILE * >, and octave_tstdiostream< c_zfile_ptr_buf, io_c_zfile_ptr_stream, gzFile >.
Definition at line 373 of file oct-stream.h.
Referenced by clearerr(), do_printf(), flush(), octave_stream::output_stream(), and puts().
|
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().
|
private |
Definition at line 2761 of file oct-stream.cc.
References error(), invalid_operation(), and output_stream().
Referenced by octave_stream::puts().
|
private |
Definition at line 1880 of file oct-stream.cc.
References do_scanf(), error(), error_state, get_size(), input_stream(), invalid_operation(), and scanf_format_list::num_conversions().
Referenced by octave_stream::scanf().
Implemented in octave_fstream, octave_tstdiostream< BUF_T, STREAM_T, FILE_T >, octave_tstdiostream< c_file_ptr_buf, io_c_file_ptr_stream, FILE * >, octave_tstdiostream< c_zfile_ptr_buf, io_c_zfile_ptr_stream, gzFile >, octave_base_iostream, and octave_base_strstream.
Referenced by octave_stream::seek().
|
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().
|
pure virtual |
Implemented in octave_istrstream, octave_fstream, octave_tstdiostream< BUF_T, STREAM_T, FILE_T >, octave_tstdiostream< c_file_ptr_buf, io_c_file_ptr_stream, FILE * >, octave_tstdiostream< c_zfile_ptr_buf, io_c_zfile_ptr_stream, gzFile >, octave_base_iostream, and octave_base_strstream.
Referenced by octave_stream::seek(), and octave_stream::tell().
|
friend |
Definition at line 331 of file oct-stream.h.
Referenced by octave_fstream::create(), octave_iprocstream::create(), octave_oprocstream::create(), octave_istream::create(), octave_istrstream::create(), octave_ostream::create(), and octave_ostrstream::create().
|
private |
Definition at line 432 of file oct-stream.h.
Referenced by octave_stream::octave_stream(), octave_stream::operator=(), skipl(), and octave_stream::~octave_stream().
|
private |
Definition at line 448 of file oct-stream.h.
|
private |
Definition at line 442 of file oct-stream.h.
|
private |
Definition at line 439 of file oct-stream.h.
|
private |
Definition at line 436 of file oct-stream.h.
|
private |
Definition at line 445 of file oct-stream.h.