GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
textscan Class Reference
Collaboration diagram for 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=true)
 
bool whitespace_delim (void) const
 

Private Attributes

std::string m_buf
 
octave_idx_type m_buffer_size
 
bool m_collect_output
 
int m_comment_char
 
int m_comment_len
 
Cell m_comment_style
 
std::string m_date_locale
 
bool m_default_exp
 
int m_delim_len
 
Cell m_delim_list
 
std::string m_delim_table
 
std::string m_delims
 
octave_value m_empty_value
 
std::string m_encoding
 
short m_eol1
 
short m_eol2
 
std::string m_exp_chars
 
int m_header_lines
 
Cell m_inf_nan
 
octave_idx_type m_lines
 
short m_return_on_error
 
Cell m_treat_as_empty
 
int m_treat_as_empty_len
 
std::string m_whitespace
 
std::string m_whitespace_table
 
std::string m_who
 
bool multiple_delims_as_one
 

Friends

class textscan_format_list
 

Detailed Description

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

Constructor & Destructor Documentation

◆ textscan() [1/2]

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

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

◆ textscan() [2/2]

textscan::textscan ( const textscan )
delete

◆ ~textscan()

textscan::~textscan ( void  )
default

Member Function Documentation

◆ do_scan()

◆ is_delim()

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

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

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

◆ isspace()

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

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

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

◆ lookahead()

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

◆ match_literal()

◆ operator=()

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

◆ parse_options()

◆ read_double()

◆ read_format_once()

◆ read_until()

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

◆ scan()

octave_value 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 2597 of file oct-stream.cc.

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

◆ scan_bracket()

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

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

References delimited_stream::get_undelim(), and delimited_stream::putback().

Referenced by scan_one().

◆ scan_caret()

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

◆ scan_complex()

◆ scan_cstring()

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

◆ scan_one()

◆ scan_qstring()

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

◆ scan_string()

◆ skip_delim()

◆ skip_whitespace()

◆ whitespace_delim()

bool textscan::whitespace_delim ( void  ) const
inlineprivate

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

Friends And Related Function Documentation

◆ textscan_format_list

friend class textscan_format_list
friend

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

Member Data Documentation

◆ m_buf

std::string textscan::m_buf
private

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

◆ m_buffer_size

octave_idx_type textscan::m_buffer_size
private

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

Referenced by do_scan(), and parse_options().

◆ m_collect_output

bool textscan::m_collect_output
private

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

Referenced by do_scan(), and parse_options().

◆ m_comment_char

int textscan::m_comment_char
private

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

Referenced by parse_options(), and skip_whitespace().

◆ m_comment_len

int textscan::m_comment_len
private

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

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

◆ m_comment_style

Cell textscan::m_comment_style
private

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

Referenced by parse_options(), and skip_whitespace().

◆ m_date_locale

std::string textscan::m_date_locale
private

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

◆ m_default_exp

bool textscan::m_default_exp
private

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

Referenced by parse_options().

◆ m_delim_len

int textscan::m_delim_len
private

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

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

◆ m_delim_list

Cell textscan::m_delim_list
private

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

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

◆ m_delim_table

std::string textscan::m_delim_table
private

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

Referenced by parse_options().

◆ m_delims

std::string textscan::m_delims
private

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

Referenced by do_scan(), and parse_options().

◆ m_empty_value

octave_value textscan::m_empty_value
private

◆ m_encoding

std::string textscan::m_encoding
private

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

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

◆ m_eol1

short textscan::m_eol1
private

◆ m_eol2

short textscan::m_eol2
private

◆ m_exp_chars

std::string textscan::m_exp_chars
private

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

Referenced by parse_options(), and read_double().

◆ m_header_lines

int textscan::m_header_lines
private

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

Referenced by do_scan(), and parse_options().

◆ m_inf_nan

Cell textscan::m_inf_nan
private

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

Referenced by read_double().

◆ m_lines

octave_idx_type textscan::m_lines
private

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

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

◆ m_return_on_error

short textscan::m_return_on_error
private

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

Referenced by do_scan(), and parse_options().

◆ m_treat_as_empty

Cell textscan::m_treat_as_empty
private

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

Referenced by parse_options(), and scan_complex().

◆ m_treat_as_empty_len

int textscan::m_treat_as_empty_len
private

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

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

◆ m_whitespace

std::string textscan::m_whitespace
private

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

Referenced by do_scan(), and parse_options().

◆ m_whitespace_table

std::string textscan::m_whitespace_table
private

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

Referenced by parse_options().

◆ m_who

std::string textscan::m_who
private

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

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

◆ multiple_delims_as_one

bool textscan::multiple_delims_as_one
private

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

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


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