Public Member Functions | |
textscan (const std::string &who_arg="textscan", const std::string &encoding="utf-8") | |
textscan (const textscan &)=delete | |
~textscan (void)=default | |
textscan & | operator= (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 |
Definition at line 1840 of file oct-stream.cc.
textscan::textscan | ( | const std::string & | who_arg = "textscan" , |
const std::string & | encoding = "utf-8" |
||
) |
Definition at line 2584 of file oct-stream.cc.
|
delete |
|
default |
|
private |
Definition at line 2620 of file oct-stream.cc.
References cat_op(), error(), m_buffer_size, m_collect_output, m_comment_len, m_delim_len, m_delims, m_eol1, m_eol2, m_header_lines, m_lines, m_return_on_error, m_treat_as_empty_len, m_whitespace, m_who, max(), min(), multiple_delims_as_one, textscan_format_list::num_conversions(), textscan_format_list::numel(), octave_value(), textscan_format_list::out_buf(), ra_idx, textscan_format_list::read_first_row(), read_format_once(), textscan_format_list::set_from_first, and skip_delim().
Referenced by scan().
|
inlineprivate |
Definition at line 1914 of file oct-stream.cc.
Referenced by read_format_once(), scan_string(), and skip_delim().
|
inlineprivate |
Definition at line 1921 of file oct-stream.cc.
Referenced by parse_options(), skip_delim(), and skip_whitespace().
|
private |
Definition at line 3937 of file oct-stream.cc.
References delimited_stream::clear(), Array< T, Alloc >::numel(), octave_strncasecmp(), delimited_stream::read(), delimited_stream::seekg(), strncmp(), and delimited_stream::tellg().
Referenced by read_double(), read_format_once(), and skip_delim().
|
private |
Definition at line 4051 of file oct-stream.cc.
References delimited_stream::get_undelim(), delimited_stream::putback(), delimited_stream::setstate(), skip_whitespace(), textscan_format_elt::text, and textscan_format_elt::width.
Referenced by read_format_once().
|
private |
Definition at line 3618 of file oct-stream.cc.
References octave_value_list::cell_value(), do_string_escapes(), error(), textscan_format_list::has_string, isspace(), len, octave_value_list::length(), m_buffer_size, m_collect_output, m_comment_char, m_comment_len, m_comment_style, m_default_exp, m_delim_len, m_delim_list, m_delim_table, m_delims, m_empty_value, m_eol1, m_eol2, m_exp_chars, m_header_lines, m_return_on_error, m_treat_as_empty, m_treat_as_empty_len, m_whitespace, m_whitespace_table, m_who, max(), multiple_delims_as_one, n, Array< T, Alloc >::numel(), Array< T, Alloc >::size(), and transform().
Referenced by scan().
|
private |
Definition at line 2822 of file oct-stream.cc.
References delimited_stream::clear(), delimited_stream::get(), delimited_stream::get_undelim(), Inf, lookahead(), m_exp_chars, m_inf_nan, NaN, delimited_stream::peek_undelim(), pown(), textscan_format_elt::prec, delimited_stream::putback(), delimited_stream::rdstate(), delimited_stream::remaining(), delimited_stream::setstate(), and textscan_format_elt::width.
Referenced by scan_complex(), and scan_one().
|
private |
Definition at line 3493 of file oct-stream.cc.
References delimited_stream::clear(), elem, delimited_stream::eof(), error(), delimited_stream::fail(), textscan_format_list::first(), is_delim(), Array< T, Alloc >::isempty(), textscan_format_elt::literal_conversion, lookahead(), m_delim_len, m_delim_list, m_who, match_literal(), textscan_format_list::next(), textscan_format_list::numel(), delimited_stream::peek_undelim(), delimited_stream::rdstate(), scan_one(), delimited_stream::seekg(), delimited_stream::setstate(), skip_delim(), delimited_stream::tellg(), and warning().
Referenced by do_scan().
|
private |
Definition at line 3151 of file oct-stream.cc.
References delimited_stream::eof(), delimited_stream::get_undelim(), m_eol1, m_eol2, next, Array< T, Alloc >::numel(), delimited_stream::putback(), and scan_caret().
Referenced by scan_string().
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.
|
private |
Definition at line 3248 of file oct-stream.cc.
References delimited_stream::get_undelim(), and delimited_stream::putback().
Referenced by scan_one().
|
private |
Definition at line 3126 of file oct-stream.cc.
References delimited_stream::eof(), delimited_stream::get_undelim(), and delimited_stream::putback().
Referenced by read_until(), scan_one(), scan_qstring(), and skip_whitespace().
|
private |
Definition at line 2979 of file oct-stream.cc.
References delimited_stream::clear(), delimited_stream::eof(), delimited_stream::fail(), delimited_stream::get(), delimited_stream::get_undelim(), Inf, is_NaN_or_NA(), m_empty_value, m_treat_as_empty, m_treat_as_empty_len, Array< T, Alloc >::numel(), delimited_stream::peek_undelim(), delimited_stream::putback(), delimited_stream::rdstate(), delimited_stream::read(), read_double(), octave_value::scalar_value(), delimited_stream::seekg(), state, strncmp(), and delimited_stream::tellg().
Referenced by textscan_format_list::read_first_row(), and scan_one().
|
private |
Definition at line 3301 of file oct-stream.cc.
References delimited_stream::get_undelim(), m_encoding, u8_from_encoding(), and textscan_format_elt::width.
Referenced by scan_one().
|
private |
Definition at line 3326 of file oct-stream.cc.
References textscan_format_elt::bitwidth, cat_op(), textscan_format_elt::char_class, delimited_stream::clear(), textscan_format_elt::discard, delimited_stream::fail(), octave_base_value::fast_elem_insert(), delimited_stream::field_done(), octave_value::internal_rep(), octave_value::isreal(), m_empty_value, textscan_format_elt::numeric, delimited_stream::rdstate(), read_double(), scan_bracket(), scan_caret(), scan_complex(), scan_cstring(), scan_qstring(), scan_string(), skip_whitespace(), and textscan_format_elt::type.
Referenced by read_format_once().
|
private |
Definition at line 3268 of file oct-stream.cc.
References delimited_stream::get(), delimited_stream::get_undelim(), m_encoding, delimited_stream::peek_undelim(), scan_caret(), scan_string(), skip_whitespace(), and u8_from_encoding().
Referenced by scan_one().
|
private |
Definition at line 3200 of file oct-stream.cc.
References delimited_stream::get_undelim(), is_delim(), Array< T, Alloc >::isempty(), m_delim_list, m_encoding, m_eol1, m_eol2, max(), Array< T, Alloc >::numel(), delimited_stream::putback(), read_until(), u8_from_encoding(), and textscan_format_elt::width.
Referenced by scan_one(), and scan_qstring().
|
private |
Definition at line 3975 of file oct-stream.cc.
References delimited_stream::get(), delimited_stream::get_undelim(), is_delim(), isspace(), lookahead(), m_delim_len, m_delim_list, m_eol1, m_eol2, m_lines, multiple_delims_as_one, Array< T, Alloc >::numel(), delimited_stream::peek_undelim(), delimited_stream::putback(), and skip_whitespace().
Referenced by do_scan(), textscan_format_list::read_first_row(), and read_format_once().
|
private |
Definition at line 3847 of file oct-stream.cc.
References delimited_stream::clear(), delimited_stream::eof(), delimited_stream::get_undelim(), isspace(), m_comment_char, m_comment_len, m_comment_style, m_eol1, m_eol2, m_lines, Array< T, Alloc >::numel(), delimited_stream::peek_undelim(), delimited_stream::putback(), delimited_stream::rdstate(), delimited_stream::read(), scan_caret(), delimited_stream::seekg(), state, strncmp(), and delimited_stream::tellg().
Referenced by match_literal(), textscan_format_list::read_first_row(), scan_one(), scan_qstring(), and skip_delim().
|
inlineprivate |
Definition at line 1925 of file oct-stream.cc.
|
friend |
Definition at line 1864 of file oct-stream.cc.
|
private |
Definition at line 1934 of file oct-stream.cc.
|
private |
Definition at line 1957 of file oct-stream.cc.
Referenced by do_scan(), and parse_options().
|
private |
Definition at line 1984 of file oct-stream.cc.
Referenced by do_scan(), and parse_options().
|
private |
Definition at line 1955 of file oct-stream.cc.
Referenced by parse_options(), and skip_whitespace().
|
private |
Definition at line 1952 of file oct-stream.cc.
Referenced by do_scan(), parse_options(), and skip_whitespace().
|
private |
Definition at line 1949 of file oct-stream.cc.
Referenced by parse_options(), and skip_whitespace().
|
private |
Definition at line 1959 of file oct-stream.cc.
|
private |
Definition at line 1986 of file oct-stream.cc.
Referenced by parse_options().
|
private |
Definition at line 1968 of file oct-stream.cc.
Referenced by do_scan(), parse_options(), read_format_once(), and skip_delim().
|
private |
Definition at line 1965 of file oct-stream.cc.
Referenced by parse_options(), read_format_once(), scan_string(), and skip_delim().
|
private |
Definition at line 1944 of file oct-stream.cc.
Referenced by parse_options().
|
private |
Definition at line 1947 of file oct-stream.cc.
Referenced by do_scan(), and parse_options().
|
private |
Definition at line 1970 of file oct-stream.cc.
Referenced by parse_options(), textscan_format_list::read_first_row(), scan_complex(), and scan_one().
|
private |
Definition at line 1932 of file oct-stream.cc.
Referenced by scan_cstring(), scan_qstring(), and scan_string().
|
private |
Definition at line 1980 of file oct-stream.cc.
Referenced by do_scan(), parse_options(), textscan_format_list::read_first_row(), read_until(), scan_string(), skip_delim(), and skip_whitespace().
|
private |
Definition at line 1981 of file oct-stream.cc.
Referenced by do_scan(), parse_options(), textscan_format_list::read_first_row(), read_until(), scan_string(), skip_delim(), and skip_whitespace().
|
private |
Definition at line 1971 of file oct-stream.cc.
Referenced by parse_options(), and read_double().
|
private |
Definition at line 1972 of file oct-stream.cc.
Referenced by do_scan(), and parse_options().
|
private |
Definition at line 1962 of file oct-stream.cc.
Referenced by read_double().
|
private |
Definition at line 1988 of file oct-stream.cc.
Referenced by do_scan(), skip_delim(), and skip_whitespace().
|
private |
Definition at line 1982 of file oct-stream.cc.
Referenced by do_scan(), and parse_options().
|
private |
Definition at line 1973 of file oct-stream.cc.
Referenced by parse_options(), and scan_complex().
|
private |
Definition at line 1976 of file oct-stream.cc.
Referenced by do_scan(), parse_options(), and scan_complex().
|
private |
Definition at line 1978 of file oct-stream.cc.
Referenced by do_scan(), and parse_options().
|
private |
Definition at line 1941 of file oct-stream.cc.
Referenced by parse_options().
|
private |
Definition at line 1930 of file oct-stream.cc.
Referenced by do_scan(), parse_options(), and read_format_once().
|
private |
Definition at line 1985 of file oct-stream.cc.
Referenced by do_scan(), parse_options(), and skip_delim().