23 #if ! defined (octave_oct_stream_h)
24 #define octave_oct_stream_h 1
26 #include "octave-config.h"
44 template <
typename T>
class Array;
68 : count (0), md (arg_md),
flt_fmt (ff), fail (
false), open_state (true),
79 virtual int seek (off_t offset,
int origin) = 0;
83 virtual off_t
tell (
void) = 0;
87 virtual bool eof (
void)
const = 0;
107 bool is_open (
void)
const {
return open_state; }
124 if (
name () ==
"stdin")
126 else if (
name () ==
"stdout")
128 else if (
name () ==
"stderr")
134 bool ok (
void)
const {
return ! fail; }
142 int mode (
void)
const {
return md; }
216 int nsa,
int sa_1,
int sa_2,
270 int seek (off_t offset,
int origin);
292 bool write_bytes (
const void *data,
size_t n_elts);
296 template <
typename T>
327 bool eof (
void)
const;
334 return error (clear, err_num);
357 int mode (
void)
const;
423 static bool instance_ok (
void);
433 static int remove (
int fid,
const std::string& who =
"");
467 int do_remove (
int fid,
const std::string& who =
"");
471 void do_clear (
bool flush =
true);
void invalid_operation(const std::string &who, const char *rw)
virtual ~octave_base_stream(void)
bool skip_bytes(size_t n_elts)
The value of lines which begin with a space character are not saved in the history list A value of all commands are saved on the history list
octave_idx_type 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)
octave::mach_info::float_format float_format(void) const
nd group nd example oindent or xample printf("%s\n", nthargout(2,"system","cmd"))
identity matrix If supplied two scalar respectively For allows like xample val
static octave_stream_list * instance
Return the CPU time used by your Octave session The first output is the total time spent executing your process and is equal to the sum of second and third which are the number of CPU seconds spent executing in user mode and the number of CPU seconds spent executing in system mode
std::string gets(octave_idx_type max_len, bool &err, const std::string &who)
int seek(off_t offset, int origin)
virtual std::istream * input_stream(void)
void error(const char *fmt,...)
off_t skipl(off_t count, bool &err, const std::string &who)
octave::mach_info::float_format flt_fmt
octave_idx_type lookup(const T *x, octave_idx_type n, T y)
void error(const char *msg)
virtual void do_close(void)
std::istream * input_stream(void)
octave::mach_info::float_format flt_fmt
virtual std::ostream * output_stream(void)
octave::mach_info::float_format float_format(void) const
bool write_bytes(const void *data, size_t n_elts)
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)
int puts(const std::string &s, const std::string &who)
std::ostream * output_stream(void)
virtual int file_number(void) const
static void cleanup_instance(void)
octave_value_list oscanf(const std::string &fmt, const std::string &who)
octave_value textscan(const std::string &fmt, octave_idx_type ntimes, const octave_value_list &options, const std::string &who, octave_idx_type &count)
octave_value scanf(const std::string &fmt, const Array< double > &size, octave_idx_type &count, const std::string &who)
std::string error(bool clear, int &err_num)
std::string error(bool clear=false)
bool stream_ok(bool clear=true) const
static float_format native_float_format(void)
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, octave::mach_info::float_format flt_fmt, octave_idx_type &count)
N Dimensional Array with copy-on-write semantics.
octave_stream(octave_base_stream *bs=0)
bool is_valid(void) const
octave_stream & operator=(const octave_stream &)
octave_base_stream(std::ios::openmode arg_md=std::ios::in|std::ios::out, octave::mach_info::float_format ff=octave::mach_info::native_float_format())
OCTAVE_EXPORT octave_value_list only variables visible in the local scope are displayed The following are valid options
octave_refcount< octave_idx_type > count
ostrl_map::const_iterator lookup_cache
~octave_stream_list(void)
OCTAVE_EXPORT octave_value_list error nd deftypefn *const octave_scalar_map err
void error(const std::string &msg)
void invalid_operation(const std::string &who, const char *rw)
std::string getl(octave_idx_type max_len, bool &err, const std::string &who)
static void clear(octave::dynamic_library &oct_file)
static std::string mode_as_string(int mode)
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
std::map< int, octave_stream > ostrl_map