GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
octave_istrstream Class Reference

#include "oct-strstrm.h"

Inheritance diagram for octave_istrstream:
Collaboration diagram for octave_istrstream:

Public Member Functions

 octave_istrstream (const char *data, std::ios::openmode arg_md=std::ios::out, octave::mach_info::float_format ff=octave::mach_info::native_float_format(), const std::string &encoding="utf-8")
 
 octave_istrstream (const octave_istrstream &)=delete
 
 octave_istrstream (const std::string &data, std::ios::openmode arg_md=std::ios::out, octave::mach_info::float_format ff=octave::mach_info::native_float_format(), const std::string &encoding="utf-8")
 
bool bad (void) const
 
void clear (void)
 
void close (void)
 
virtual void do_close (void)
 
bool eof (void) const
 
std::string error (bool clear, int &err_num)
 
virtual int file_number (void) const
 
std::istream * input_stream (void)
 
bool is_open (void) const
 
std::string name (void) const
 
bool ok (void) const
 
octave_istrstreamoperator= (const octave_istrstream &)=delete
 
std::ostream * output_stream (void)
 
std::streambuf * rdbuf (void)
 
int seek (off_t, int)
 
off_t tell (void)
 

Static Public Member Functions

static octave::stream create (const char *data, std::ios::openmode arg_md=std::ios::out, octave::mach_info::float_format ff=octave::mach_info::native_float_format(), const std::string &encoding="utf-8")
 
static octave::stream create (const std::string &data, std::ios::openmode arg_md=std::ios::out, octave::mach_info::float_format ff=octave::mach_info::native_float_format(), const std::string &encoding="utf-8")
 

Protected Member Functions

 ~octave_istrstream (void)=default
 
void clearerr (void)
 
std::string encoding (void) const
 
void error (const std::string &msg)
 
void error (const std::string &who, const std::string &msg)
 
mach_info::float_format float_format (void) const
 
int mode (void) const
 

Private Member Functions

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)
 
octave_value do_textscan (const std::string &fmt, octave_idx_type ntimes, const octave_value_list &options, const std::string &who, octave_idx_type &count)
 
void field_width_error (const std::string &who) const
 
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_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

std::string m_encoding
 
std::string m_errmsg
 
bool m_fail
 
mach_info::float_format m_flt_fmt
 
std::istringstream m_istream
 
int m_mode
 
bool m_open_state
 

Detailed Description

Definition at line 78 of file oct-strstrm.h.

Constructor & Destructor Documentation

◆ octave_istrstream() [1/3]

octave_istrstream::octave_istrstream ( const char *  data,
std::ios::openmode  arg_md = std::ios::out,
octave::mach_info::float_format  ff = octave::mach_info::native_float_format (),
const std::string &  encoding = "utf-8" 
)
inline

Definition at line 83 of file oct-strstrm.h.

◆ octave_istrstream() [2/3]

octave_istrstream::octave_istrstream ( const std::string &  data,
std::ios::openmode  arg_md = std::ios::out,
octave::mach_info::float_format  ff = octave::mach_info::native_float_format (),
const std::string &  encoding = "utf-8" 
)
inline

Definition at line 90 of file oct-strstrm.h.

◆ octave_istrstream() [3/3]

octave_istrstream::octave_istrstream ( const octave_istrstream )
delete

◆ ~octave_istrstream()

octave_istrstream::~octave_istrstream ( void  )
protecteddefault

Member Function Documentation

◆ bad()

bool octave_istrstream::bad ( void  ) const
inlinevirtual

Implements octave_base_strstream.

Definition at line 137 of file oct-strstrm.h.

◆ clear()

void octave_istrstream::clear ( void  )
inlinevirtual

Implements octave_base_strstream.

Definition at line 139 of file oct-strstrm.h.

◆ clearerr()

void octave::base_stream::clearerr ( void  )
protectedinherited

◆ close()

void octave::base_stream::close ( void  )
inlineinherited

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

◆ create() [1/2]

octave::stream octave_istrstream::create ( const char *  data,
std::ios::openmode  arg_md = std::ios::out,
octave::mach_info::float_format  ff = octave::mach_info::native_float_format (),
const std::string &  encoding = "utf-8" 
)
static

Definition at line 55 of file oct-strstrm.cc.

References octave::base_stream::encoding().

Referenced by Fsscanf(), and textscan_internal().

◆ create() [2/2]

octave::stream octave_istrstream::create ( const std::string &  data,
std::ios::openmode  arg_md = std::ios::out,
octave::mach_info::float_format  ff = octave::mach_info::native_float_format (),
const std::string &  encoding = "utf-8" 
)
static

Definition at line 64 of file oct-strstrm.cc.

References octave::base_stream::encoding().

◆ do_close()

◆ do_gets()

◆ do_numeric_printf_conv()

◆ do_oscanf()

◆ do_printf()

◆ do_scanf()

◆ do_textscan()

octave_value octave::base_stream::do_textscan ( const std::string &  fmt,
octave_idx_type  ntimes,
const octave_value_list options,
const std::string &  who,
octave_idx_type count 
)
privateinherited

◆ encoding()

◆ eof()

bool octave_istrstream::eof ( void  ) const
inlinevirtual

Implements octave::base_stream.

Definition at line 124 of file oct-strstrm.h.

◆ error() [1/3]

◆ error() [2/3]

void octave::base_stream::error ( const std::string &  msg)
protectedinherited

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

References octave::base_stream::m_errmsg, and octave::base_stream::m_fail.

◆ error() [3/3]

void octave::base_stream::error ( const std::string &  who,
const std::string &  msg 
)
protectedinherited

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

References octave::base_stream::m_errmsg, and octave::base_stream::m_fail.

◆ field_width_error()

void octave::base_stream::field_width_error ( const std::string &  who) const
privateinherited

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

References octave::base_stream::error().

Referenced by octave::base_stream::do_printf().

◆ file_number()

◆ float_format()

mach_info::float_format octave::base_stream::float_format ( void  ) const
inlineprotectedinherited

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

◆ flush()

int octave::base_stream::flush ( void  )
privateinherited

◆ getl()

std::string octave::base_stream::getl ( octave_idx_type  max_len,
bool &  err,
const std::string &  who 
)
privateinherited

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

References octave::base_stream::do_gets().

◆ gets()

std::string octave::base_stream::gets ( octave_idx_type  max_len,
bool &  err,
const std::string &  who 
)
privateinherited

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

References octave::base_stream::do_gets().

◆ input_stream()

std::istream* octave_istrstream::input_stream ( void  )
inlinevirtual

Reimplemented from octave::base_stream.

Definition at line 126 of file oct-strstrm.h.

◆ invalid_operation()

void octave::base_stream::invalid_operation ( const std::string &  who,
const char *  rw 
)
privateinherited

◆ is_open()

bool octave::base_stream::is_open ( void  ) const
inlineinherited

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

◆ mode()

int octave::base_stream::mode ( void  ) const
inlineprotectedinherited

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

Referenced by octave_fstream::input_stream(), and octave_fstream::output_stream().

◆ name()

std::string octave_base_strstream::name ( void  ) const
inlinevirtualinherited

Implements octave::base_stream.

Definition at line 69 of file oct-strstrm.h.

◆ ok()

bool octave::base_stream::ok ( void  ) const
inlineinherited

◆ operator=()

octave_istrstream& octave_istrstream::operator= ( const octave_istrstream )
delete

◆ oscanf()

◆ output_stream()

std::ostream* octave_istrstream::output_stream ( void  )
inlinevirtual

Reimplemented from octave::base_stream.

Definition at line 128 of file oct-strstrm.h.

◆ printf()

int octave::base_stream::printf ( const std::string &  fmt,
const octave_value_list args,
const std::string &  who 
)
privateinherited

◆ puts()

int octave::base_stream::puts ( const std::string &  s,
const std::string &  who 
)
privateinherited

◆ rdbuf()

std::streambuf* octave_istrstream::rdbuf ( void  )
inlinevirtual

Implements octave_base_strstream.

Definition at line 132 of file oct-strstrm.h.

◆ scanf()

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

◆ seek()

int octave_base_strstream::seek ( off_t  ,
int   
)
virtualinherited

Implements octave::base_stream.

Definition at line 35 of file oct-strstrm.cc.

References octave::base_stream::error().

◆ skipl()

off_t octave::base_stream::skipl ( off_t  count,
bool &  err,
const std::string &  who 
)
privateinherited

◆ tell()

off_t octave_istrstream::tell ( void  )
inlinevirtual

Reimplemented from octave_base_strstream.

Definition at line 130 of file oct-strstrm.h.

Member Data Documentation

◆ m_encoding

std::string octave::base_stream::m_encoding
privateinherited

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

◆ m_errmsg

std::string octave::base_stream::m_errmsg
privateinherited

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

Referenced by octave::base_stream::clear(), and octave::base_stream::error().

◆ m_fail

bool octave::base_stream::m_fail
privateinherited

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

Referenced by octave::base_stream::clear(), and octave::base_stream::error().

◆ m_flt_fmt

mach_info::float_format octave::base_stream::m_flt_fmt
privateinherited

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

◆ m_istream

std::istringstream octave_istrstream::m_istream
private

Definition at line 143 of file oct-strstrm.h.

◆ m_mode

int octave::base_stream::m_mode
privateinherited

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

◆ m_open_state

bool octave::base_stream::m_open_state
privateinherited

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


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