#include "octave-config.h"
#include <cstdarg>
#include <iosfwd>
#include <string>
#include <list>
#include "dMatrix.h"
#include "lo-utils.h"
Go to the source code of this file.
Classes | |
class | make_valid_name_options |
Helper class for make_valid_name function calls. More... | |
Functions | |
OCTINTERP_API int | almost_match (const std::string &std, const std::string &s, int min_match_len=1, int case_sens=1) |
OCTINTERP_API std::string | asprintf (const char *fmt,...) |
OCTINTERP_API void | check_dimensions (dim_vector &dim, const char *warnfor) |
OCTINTERP_API std::string | contents_file_in_path (const std::string &) |
OCTINTERP_API octave_idx_type | dims_to_numel (const dim_vector &dims, const octave_value_list &idx) |
OCTINTERP_API octave_value | do_simple_cellfun (octave_value_list(*fun)(const octave_value_list &, int), const char *fun_name, const octave_value_list &args) |
OCTINTERP_API octave_value_list | do_simple_cellfun (octave_value_list(*fun)(const octave_value_list &, int), const char *fun_name, const octave_value_list &args, int nargout) |
OCTINTERP_API std::string | do_string_escapes (const std::string &s) |
OCTINTERP_API std::string | fcn_file_in_path (const std::string &) |
OCTINTERP_API std::string | file_in_path (const std::string &, const std::string &) |
OCTINTERP_API std::string | find_data_file_in_load_path (const std::string &fcn, const std::string &file, bool require_regular_file=false) |
OCTINTERP_API FloatMatrix | float_identity_matrix (octave_idx_type nr, octave_idx_type nc) |
OCTINTERP_API std::size_t | format (std::ostream &os, const char *fmt,...) |
OCTINTERP_API std::size_t | format (std::ostream &os, const std::string &enc, const char *fmt,...) |
OCTINTERP_API void | get_dimensions (const octave_value &a, const char *warn_for, dim_vector &dim) |
OCTINTERP_API void | get_dimensions (const octave_value &a, const char *warn_for, octave_idx_type &nr, octave_idx_type &nc) |
OCTINTERP_API void | get_dimensions (const octave_value &a, const octave_value &b, const char *warn_for, octave_idx_type &nr, octave_idx_type &nc) |
OCTINTERP_API Matrix | identity_matrix (octave_idx_type nr, octave_idx_type nc) |
OCTINTERP_API int | keyword_almost_match (const char *const *std, int *min_len, const std::string &s, int min_toks_to_match, int max_toks) |
OCTINTERP_API bool | make_valid_name (std::string &str, const make_valid_name_options &options) |
Modify str to be a valid variable name. More... | |
OCTINTERP_API bool | same_file (const std::string &f, const std::string &g) |
OCTINTERP_API string_vector | search_path_for_all_files (const std::string &, const string_vector &) |
OCTINTERP_API std::string | search_path_for_file (const std::string &, const string_vector &) |
OCTINTERP_API void | sleep (double seconds, bool do_graphics_events=false) |
OCTINTERP_API const char * | undo_string_escape (char c) |
OCTINTERP_API std::string | undo_string_escapes (const std::string &s) |
OCTAVE_NAMESPACE_BEGIN OCTINTERP_API bool | valid_identifier (const char *s) |
OCTINTERP_API bool | valid_identifier (const std::string &s) |
OCTINTERP_API std::string | vasprintf (const char *fmt, va_list args) |
OCTINTERP_API std::size_t | vformat (std::ostream &os, const char *fmt, va_list args) |
OCTINTERP_API std::size_t | vformat (std::ostream &os, const std::string &enc, const char *fmt, va_list args) |
OCTINTERP_API int almost_match | ( | const std::string & | std, |
const std::string & | s, | ||
int | min_match_len = 1 , |
||
int | case_sens = 1 |
||
) |
Definition at line 407 of file utils.cc.
References octave_strncasecmp(), and octave::string::strncmp().
Referenced by keyword_almost_match().
OCTINTERP_API std::string asprintf | ( | const char * | fmt, |
... | |||
) |
Definition at line 1538 of file utils.cc.
References vasprintf().
OCTINTERP_API void check_dimensions | ( | dim_vector & | dim, |
const char * | warnfor | ||
) |
Definition at line 1321 of file utils.cc.
References dim_vector::ndims(), and warning_with_id().
OCTINTERP_API std::string contents_file_in_path | ( | const std::string & | dir | ) |
Definition at line 779 of file utils.cc.
References octave::__get_load_path__(), concat(), load_path::find_dir(), and make_absolute().
OCTINTERP_API octave_idx_type dims_to_numel | ( | const dim_vector & | dims, |
const octave_value_list & | idx | ||
) |
Definition at line 1402 of file utils.cc.
References error(), octave_value::index_vector(), octave_value::is_magic_colon(), octave_value::isnumeric(), len, octave::idx_vector::length(), octave_value_list::length(), dim_vector::numel(), octave_value::numel(), and dim_vector::redim().
Referenced by Fnumel(), and octave_base_value::xnumel().
OCTINTERP_API octave_value do_simple_cellfun | ( | octave_value_list(*)(const octave_value_list &, int) | fun, |
const char * | fun_name, | ||
const octave_value_list & | args | ||
) |
Definition at line 1756 of file utils.cc.
References do_simple_cellfun(), and octave_value_list::length().
OCTINTERP_API octave_value_list do_simple_cellfun | ( | octave_value_list(*)(const octave_value_list &, int) | fun, |
const char * | fun_name, | ||
const octave_value_list & | args, | ||
int | nargout | ||
) |
Definition at line 1688 of file utils.cc.
References octave_value::cell_value(), Array< T, Alloc >::dims(), error(), octave_value::iscell(), octave_value_list::length(), numel(), Array< T, Alloc >::numel(), OCTAVE_LOCAL_BUFFER, and octave_value_list::resize().
Referenced by do_simple_cellfun(), Fstrfind(), and Fstrrep().
OCTINTERP_API std::string do_string_escapes | ( | const std::string & | s | ) |
Definition at line 801 of file utils.cc.
References len, min(), and warning().
Referenced by Fdlmread(), Fdo_string_escapes(), octave::stream::oscanf(), octave::textscan::parse_options(), octave::stream::printf(), octave::stream::scanf(), and textscan_internal().
OCTINTERP_API std::string fcn_file_in_path | ( | const std::string & | name | ) |
Definition at line 739 of file utils.cc.
References octave::__get_load_path__(), absolute_pathname(), load_path::find_fcn_file(), len, and name.
Referenced by do_dbtype(), tree_evaluator::echo(), get_help_from_file(), and octave_user_function::mark_as_system_fcn_file().
OCTINTERP_API std::string file_in_path | ( | const std::string & | name, |
const std::string & | suffix | ||
) |
Definition at line 688 of file utils.cc.
References octave::__get_load_path__(), load_path::find_file(), make_absolute(), and name.
Referenced by interpreter::execute_startup_files(), and symbol_exist().
OCTINTERP_API std::string find_data_file_in_load_path | ( | const std::string & | fcn, |
const std::string & | file, | ||
bool | require_regular_file = false |
||
) |
Definition at line 700 of file utils.cc.
References octave::__get_load_path__(), absolute_pathname(), load_path::find_file(), make_absolute(), and warn_data_file_in_path().
Referenced by do_stream_open(), Fdlmread(), and find_file_to_load().
OCTINTERP_API FloatMatrix float_identity_matrix | ( | octave_idx_type | nr, |
octave_idx_type | nc | ||
) |
OCTINTERP_API std::size_t format | ( | std::ostream & | os, |
const char * | fmt, | ||
... | |||
) |
Definition at line 1471 of file utils.cc.
References vformat().
Referenced by octave::Table::columnformat(), octave::symbol_info_accumulator::display(), octave::symbol_info_list::display(), octave::do_printf_conv(), octave::variable_editor_stack::do_save(), F__magick_finfo__(), Faudiodevinfo(), octave::formatComplex(), octave::opengl_functions::glDrawPixels(), octave::opengl_functions::glReadPixels(), octave::opengl_functions::glTexImage2D(), octave::itemFor(), load_save_system::load(), octave::symbol_info_list::parse_whos_line_format(), octave::qStringValueFor(), load_save_system::save(), octave::variable_editor_stack::save(), load_save_system::save_header_format_string(), octave::documentation::select_all_occurrences(), set_format_style(), octave::Table::updateColumnname(), octave::Table::updateData(), octave::Table::updateDataColumn(), and octave::Table::updateRowname().
OCTINTERP_API std::size_t format | ( | std::ostream & | os, |
const std::string & | enc, | ||
const char * | fmt, | ||
... | |||
) |
OCTINTERP_API void get_dimensions | ( | const octave_value & | a, |
const char * | warn_for, | ||
dim_vector & | dim | ||
) |
Definition at line 1339 of file utils.cc.
References check_dimensions(), octave_value::dims(), error(), dim_vector::isvector(), Array< T, Alloc >::numel(), octave_value::octave_idx_type_vector_value(), and dim_vector::resize().
Referenced by Fcell(), Feye(), fill_matrix(), and Fsparse().
OCTINTERP_API void get_dimensions | ( | const octave_value & | a, |
const char * | warn_for, | ||
octave_idx_type & | nr, | ||
octave_idx_type & | nc | ||
) |
Definition at line 1369 of file utils.cc.
References check_dimensions(), octave_value::columns(), error(), octave_value::idx_type_value(), octave_value::is_scalar_type(), octave_value::octave_idx_type_vector_value(), and octave_value::rows().
OCTINTERP_API void get_dimensions | ( | const octave_value & | a, |
const octave_value & | b, | ||
const char * | warn_for, | ||
octave_idx_type & | nr, | ||
octave_idx_type & | nc | ||
) |
Definition at line 1392 of file utils.cc.
References check_dimensions(), octave_value::idx_type_value(), and octave_value::isempty().
OCTINTERP_API Matrix identity_matrix | ( | octave_idx_type | nr, |
octave_idx_type | nc | ||
) |
OCTINTERP_API int keyword_almost_match | ( | const char *const * | std, |
int * | min_len, | ||
const std::string & | s, | ||
int | min_toks_to_match, | ||
int | max_toks | ||
) |
Definition at line 422 of file utils.cc.
References almost_match(), and strsave().
Referenced by set_DASPK_options(), set_DASRT_options(), set_DASSL_options(), set_LSODE_options(), set_Quad_options(), show_DASPK_options(), show_DASRT_options(), show_DASSL_options(), show_LSODE_options(), and show_Quad_options().
OCTINTERP_API bool make_valid_name | ( | std::string & | str, |
const make_valid_name_options & | options | ||
) |
Modify str
to be a valid variable name.
str | input string |
options | see also help matlab.lang.makeValidName . |
str
was modified. Definition at line 134 of file utils.cc.
References make_valid_name_options::get_prefix(), make_valid_name_options::get_replacement_style(), iskeyword(), valid_identifier(), and x.
Referenced by F__make_valid_name__().
OCTINTERP_API bool same_file | ( | const std::string & | f, |
const std::string & | g | ||
) |
Definition at line 293 of file utils.cc.
References f, and same_file_internal().
Referenced by load_path::contains_canonical(), load_path::contains_file_in_dir(), interpreter::execute_startup_files(), octave::file_editor::find_tab_widget(), Fis_same_file(), out_of_date_check(), and load_path::remove().
OCTINTERP_API string_vector search_path_for_all_files | ( | const std::string & | path, |
const string_vector & | names | ||
) |
Definition at line 520 of file utils.cc.
References len, make_absolute(), string_vector::numel(), path, and string_vector::std_list().
Referenced by Ffile_in_path().
OCTINTERP_API std::string search_path_for_file | ( | const std::string & | path, |
const string_vector & | names | ||
) |
Definition at line 510 of file utils.cc.
References make_absolute(), path, and string_vector::std_list().
Referenced by Ffile_in_path(), and have_gnuplot_binary().
Definition at line 1557 of file utils.cc.
References octave::__get_gh_manager__(), flush_stdout(), octave::math::isinf(), kbhit(), and octave_nanosleep_wrapper().
Referenced by Fpause(), Fwaitfor(), debugger::server_loop(), and tree_evaluator::server_loop().
OCTINTERP_API const char * undo_string_escape | ( | char | c | ) |
Definition at line 982 of file utils.cc.
Referenced by octave_lex(), and undo_string_escapes().
OCTINTERP_API std::string undo_string_escapes | ( | const std::string & | s | ) |
Definition at line 1029 of file utils.cc.
References undo_string_escape().
Referenced by octave_char_matrix_str::edit_display(), Fundo_string_escapes(), octave::base_parser::make_constant(), octave_print_internal(), octave::scanf_format_list::printme(), octave::printf_format_list::printme(), and octave::textscan_format_list::printme().
OCTAVE_NAMESPACE_BEGIN OCTINTERP_API bool valid_identifier | ( | const char * | s | ) |
Definition at line 77 of file utils.cc.
Referenced by make_valid_name_options::make_valid_name_options(), tree_evaluator::assignin(), octave::file_editor_tab::check_valid_identifier(), Farrayfun(), Fcellfun(), Fdisplay(), Fisvarname(), load_path::dir_info::get_file_list(), hdf5_read_next_data_internal(), make_valid_name(), maybe_warn_invalid_field_name(), read_mat_ascii_data(), read_text_data(), octave::main_window::run_file_in_terminal(), and valid_identifier().
OCTINTERP_API bool valid_identifier | ( | const std::string & | s | ) |
Definition at line 89 of file utils.cc.
References valid_identifier().
OCTINTERP_API std::string vasprintf | ( | const char * | fmt, |
va_list | args | ||
) |
Definition at line 1521 of file utils.cc.
References free(), and octave_vasprintf_wrapper().
Referenced by asprintf(), octave_vasprintf_wrapper(), and vformat().
OCTINTERP_API std::size_t vformat | ( | std::ostream & | os, |
const char * | fmt, | ||
va_list | args | ||
) |
Definition at line 1485 of file utils.cc.
References vasprintf().
Referenced by format(), format_message(), and mexPrintf().
OCTINTERP_API std::size_t vformat | ( | std::ostream & | os, |
const std::string & | enc, | ||
const char * | fmt, | ||
va_list | args | ||
) |
Definition at line 1508 of file utils.cc.
References octave::string::u8_to_encoding(), and vasprintf().