#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(*fcn)(const octave_value_list &, int), const char *fcn_name, const octave_value_list &args) |
OCTINTERP_API octave_value_list | do_simple_cellfun (octave_value_list(*fcn)(const octave_value_list &, int), const char *fcn_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 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) |
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 int almost_match | ( | const std::string & | std, |
const std::string & | s, | ||
int | min_match_len = 1 , |
||
int | case_sens = 1 |
||
) |
Definition at line 408 of file utils.cc.
References octave_strncasecmp(), and strncmp().
Referenced by keyword_almost_match().
OCTINTERP_API std::string asprintf | ( | const char * | fmt, |
... | |||
) |
Definition at line 1513 of file utils.cc.
References vasprintf().
OCTINTERP_API void check_dimensions | ( | dim_vector & | dim, |
const char * | warnfor | ||
) |
Definition at line 1324 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 782 of file utils.cc.
References __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 1404 of file utils.cc.
References error(), octave_value::index_vector(), octave_value::is_magic_colon(), octave_value::isnumeric(), len, 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) | fcn, |
const char * | fcn_name, | ||
const octave_value_list & | args | ||
) |
Definition at line 1731 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) | fcn, |
const char * | fcn_name, | ||
const octave_value_list & | args, | ||
int | nargout | ||
) |
Definition at line 1663 of file utils.cc.
References octave_value::cell_value(), Array< T, Alloc >::dims(), error(), octave_value::iscell(), octave_value_list::length(), n, 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 804 of file utils.cc.
References len, min(), and warning().
Referenced by Fdlmread(), Fdo_string_escapes(), stream::oscanf(), textscan::parse_options(), stream::printf(), stream::scanf(), and textscan_internal().
OCTINTERP_API std::string fcn_file_in_path | ( | const std::string & | name | ) |
Definition at line 742 of file utils.cc.
References __get_load_path__(), absolute_pathname(), load_path::find_fcn_file(), and len.
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 691 of file utils.cc.
References __get_load_path__(), load_path::find_file(), and make_absolute().
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 703 of file utils.cc.
References __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 1473 of file utils.cc.
References vformat().
Referenced by Table::columnformat(), symbol_info_accumulator::display(), symbol_info_list::display(), do_printf_conv(), variable_editor_stack::do_save(), F__magick_finfo__(), Faudiodevinfo(), formatComplex(), opengl_functions::glDrawPixels(), opengl_functions::glReadPixels(), opengl_functions::glTexImage2D(), itemFor(), load_save_system::load(), symbol_info_list::parse_whos_line_format(), qStringValueFor(), load_save_system::save(), variable_editor_stack::save(), load_save_system::save_header_format_string(), documentation::select_all_occurrences(), set_format_style(), Table::updateColumnname(), Table::updateData(), Table::updateDataColumn(), and Table::updateRowname().
OCTINTERP_API void get_dimensions | ( | const octave_value & | a, |
const char * | warn_for, | ||
dim_vector & | dim | ||
) |
Definition at line 1342 of file utils.cc.
References check_dimensions(), octave_value::dims(), error(), dim_vector::isvector(), n, dim_vector::numel(), 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 1371 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 1394 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 423 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 135 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 294 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(), 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 521 of file utils.cc.
References directory_path::find_all_first_of(), len, make_absolute(), string_vector::numel(), 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 511 of file utils.cc.
References directory_path::find_first_of(), make_absolute(), and string_vector::std_list().
Referenced by Ffile_in_path(), and have_gnuplot_binary().
OCTINTERP_API void sleep | ( | double | seconds, |
bool | do_graphics_events = false |
||
) |
Definition at line 1532 of file utils.cc.
References __get_gh_manager__(), flush_stdout(), 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 986 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 1033 of file utils.cc.
References undo_string_escape().
Referenced by octave_char_matrix_str::edit_display(), Fundo_string_escapes(), base_parser::make_constant(), octave_print_internal(), scanf_format_list::printme(), printf_format_list::printme(), and textscan_format_list::printme().
OCTINTERP_API bool valid_identifier | ( | const char * | s | ) |
Definition at line 78 of file utils.cc.
Referenced by make_valid_name_options::make_valid_name_options(), tree_evaluator::assignin(), 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(), main_window::run_file_in_terminal(), and valid_identifier().
OCTINTERP_API bool valid_identifier | ( | const std::string & | s | ) |
Definition at line 90 of file utils.cc.
References valid_identifier().
OCTINTERP_API std::string vasprintf | ( | const char * | fmt, |
va_list | args | ||
) |
Definition at line 1496 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 1487 of file utils.cc.
References vasprintf().
Referenced by format(), format_message(), and mexPrintf().