GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
octave::textscan Class Reference
Collaboration diagram for octave::textscan:

Public Member Functions

 textscan (const std::string &who_arg="textscan", const std::string &encoding="utf-8")
 
 textscan (const textscan &)=delete
 
 ~textscan (void)=default
 
textscanoperator= (const textscan &)=delete
 
octave_value scan (std::istream &isp, const std::string &fmt, octave_idx_type ntimes, const octave_value_list &options, octave_idx_type &read_count)
 

Private Member Functions

octave_value do_scan (std::istream &isp, textscan_format_list &fmt_list, octave_idx_type ntimes)
 
bool is_delim (unsigned char ch) const
 
bool isspace (unsigned int ch) const
 
int lookahead (delimited_stream &is, const Cell &targets, int max_len, bool case_sensitive=true) const
 
bool match_literal (delimited_stream &isp, const textscan_format_elt &elem)
 
void parse_options (const octave_value_list &args, textscan_format_list &fmt_list)
 
double read_double (delimited_stream &is, const textscan_format_elt &fmt) const
 
int read_format_once (delimited_stream &isp, textscan_format_list &fmt_list, std::list< octave_value > &retval, Array< octave_idx_type > row, int &done_after)
 
std::string read_until (delimited_stream &is, const Cell &delimiters, const std::string &ends) const
 
int scan_bracket (delimited_stream &is, const std::string &pattern, std::string &val) const
 
int scan_caret (delimited_stream &is, const std::string &pattern, std::string &val) const
 
void scan_complex (delimited_stream &is, const textscan_format_elt &fmt, Complex &val) const
 
void scan_cstring (delimited_stream &is, const textscan_format_elt &fmt, std::string &val) const
 
void scan_one (delimited_stream &is, const textscan_format_elt &fmt, octave_value &ov, Array< octave_idx_type > row)
 
void scan_qstring (delimited_stream &is, const textscan_format_elt &fmt, std::string &val)
 
void scan_string (delimited_stream &is, const textscan_format_elt &fmt, std::string &val) const
 
int skip_delim (delimited_stream &is)
 
int skip_whitespace (delimited_stream &is, bool EOLstop=false)
 
bool whitespace_delim (void) const
 

Private Attributes

std::string buf
 
octave_idx_type buffer_size
 
bool collect_output
 
int comment_char
 
int comment_len
 
Cell comment_style
 
std::string date_locale
 
bool default_exp
 
int delim_len
 
Cell delim_list
 
std::string delim_table
 
std::string delims
 
octave_value empty_value
 
short eol1
 
short eol2
 
std::string exp_chars
 
int header_lines
 
Cell inf_nan
 
octave_idx_type lines
 
std::string m_encoding
 
bool multiple_delims_as_one
 
short return_on_error
 
Cell treat_as_empty
 
int treat_as_empty_len
 
std::string whitespace
 
std::string whitespace_table
 
std::string who
 

Friends

class textscan_format_list
 

Detailed Description

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

Constructor & Destructor Documentation

◆ textscan() [1/2]

octave::textscan::textscan ( const std::string &  who_arg = "textscan",
const std::string &  encoding = "utf-8" 
)

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

◆ textscan() [2/2]

octave::textscan::textscan ( const textscan )
delete

◆ ~textscan()

octave::textscan::~textscan ( void  )
default

Member Function Documentation

◆ do_scan()

◆ is_delim()

bool octave::textscan::is_delim ( unsigned char  ch) const
inlineprivate

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

Referenced by read_format_once(), scan_string(), and skip_delim().

◆ isspace()

bool octave::textscan::isspace ( unsigned int  ch) const
inlineprivate

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

Referenced by parse_options(), skip_delim(), and skip_whitespace().

◆ lookahead()

int octave::textscan::lookahead ( delimited_stream is,
const Cell targets,
int  max_len,
bool  case_sensitive = true 
) const
private

◆ match_literal()

◆ operator=()

textscan& octave::textscan::operator= ( const textscan )
delete

◆ parse_options()

◆ read_double()

◆ read_format_once()

◆ read_until()

std::string octave::textscan::read_until ( delimited_stream is,
const Cell delimiters,
const std::string &  ends 
) const
private

◆ scan()

octave_value octave::textscan::scan ( std::istream &  isp,
const std::string &  fmt,
octave_idx_type  ntimes,
const octave_value_list options,
octave_idx_type read_count 
)

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

References do_scan(), parse_options(), and octave::state.

◆ scan_bracket()

int octave::textscan::scan_bracket ( delimited_stream is,
const std::string &  pattern,
std::string &  val 
) const
private

◆ scan_caret()

int octave::textscan::scan_caret ( delimited_stream is,
const std::string &  pattern,
std::string &  val 
) const
private

◆ scan_complex()

◆ scan_cstring()

void octave::textscan::scan_cstring ( delimited_stream is,
const textscan_format_elt fmt,
std::string &  val 
) const
private

◆ scan_one()

◆ scan_qstring()

◆ scan_string()

◆ skip_delim()

◆ skip_whitespace()

◆ whitespace_delim()

bool octave::textscan::whitespace_delim ( void  ) const
inlineprivate

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

Friends And Related Function Documentation

◆ textscan_format_list

friend class textscan_format_list
friend

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

Member Data Documentation

◆ buf

std::string octave::textscan::buf
private

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

◆ buffer_size

octave_idx_type octave::textscan::buffer_size
private

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

Referenced by do_scan(), and parse_options().

◆ collect_output

bool octave::textscan::collect_output
private

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

Referenced by do_scan(), and parse_options().

◆ comment_char

int octave::textscan::comment_char
private

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

Referenced by parse_options(), and skip_whitespace().

◆ comment_len

int octave::textscan::comment_len
private

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

Referenced by do_scan(), parse_options(), and skip_whitespace().

◆ comment_style

Cell octave::textscan::comment_style
private

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

Referenced by parse_options(), and skip_whitespace().

◆ date_locale

std::string octave::textscan::date_locale
private

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

◆ default_exp

bool octave::textscan::default_exp
private

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

Referenced by parse_options().

◆ delim_len

int octave::textscan::delim_len
private

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

Referenced by do_scan(), parse_options(), read_format_once(), and skip_delim().

◆ delim_list

Cell octave::textscan::delim_list
private

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

Referenced by parse_options(), read_format_once(), scan_string(), and skip_delim().

◆ delim_table

std::string octave::textscan::delim_table
private

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

Referenced by do_scan(), and parse_options().

◆ delims

std::string octave::textscan::delims
private

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

Referenced by do_scan(), and parse_options().

◆ empty_value

octave_value octave::textscan::empty_value
private

◆ eol1

short octave::textscan::eol1
private

◆ eol2

short octave::textscan::eol2
private

◆ exp_chars

std::string octave::textscan::exp_chars
private

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

Referenced by parse_options(), and read_double().

◆ header_lines

int octave::textscan::header_lines
private

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

Referenced by do_scan(), and parse_options().

◆ inf_nan

Cell octave::textscan::inf_nan
private

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

Referenced by read_double().

◆ lines

octave_idx_type octave::textscan::lines
private

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

Referenced by do_scan(), skip_delim(), and skip_whitespace().

◆ m_encoding

std::string octave::textscan::m_encoding
private

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

Referenced by scan_cstring(), scan_qstring(), and scan_string().

◆ multiple_delims_as_one

bool octave::textscan::multiple_delims_as_one
private

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

Referenced by do_scan(), parse_options(), and skip_delim().

◆ return_on_error

short octave::textscan::return_on_error
private

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

Referenced by do_scan(), and parse_options().

◆ treat_as_empty

Cell octave::textscan::treat_as_empty
private

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

Referenced by parse_options(), and scan_complex().

◆ treat_as_empty_len

int octave::textscan::treat_as_empty_len
private

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

Referenced by do_scan(), parse_options(), and scan_complex().

◆ whitespace

std::string octave::textscan::whitespace
private

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

Referenced by do_scan(), and parse_options().

◆ whitespace_table

std::string octave::textscan::whitespace_table
private

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

Referenced by parse_options().

◆ who

std::string octave::textscan::who
private

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

Referenced by do_scan(), parse_options(), and read_format_once().


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