26#if ! defined (octave_utils_h)
27#define octave_utils_h 1
29#include "octave-config.h"
88 const std::string&
get_prefix ()
const {
return m_prefix; }
92 std::string m_replacement_style{
"underscore"};
93 std::string m_prefix{
"x"};
103extern OCTINTERP_API
bool
106OCTAVE_DEPRECATED (9,
"octave::same_file is obsolete, use octave::sys::same_file")
107extern OCTINTERP_API
bool
108same_file (const std::
string&
f, const std::
string& g);
110extern OCTINTERP_API
int almost_match (const std::
string& std,
111 const std::
string& s,
112 int min_match_len = 1,
115extern OCTINTERP_API
int
117 const std::
string& s,
int min_toks_to_match,
120extern OCTINTERP_API std::
string
126extern OCTINTERP_API std::
string
129extern OCTINTERP_API std::
string
131 const std::
string& file,
132 bool require_regular_file = false);
138extern OCTINTERP_API
void
139display_file_lines (std::
ostream& os, const std::
string& file_name,
int start,
int end,
int target_line, const std::
string& marker, const std::
string& who);
147extern OCTINTERP_API
void
150extern OCTINTERP_API
void
154extern OCTINTERP_API
void
159extern OCTINTERP_API
void
166extern OCTINTERP_API
Matrix
172extern OCTINTERP_API std::
size_t
175extern OCTINTERP_API std::
size_t
178extern OCTINTERP_API std::
string
179vasprintf (const
char *fmt, va_list args);
181extern OCTINTERP_API std::
string asprintf (const
char *fmt, ...);
183extern OCTINTERP_API
void sleep (
double seconds,
184 bool do_graphics_events = false);
197OCTAVE_END_NAMESPACE(octave)
Vector representing the dimensions (size) of an Array.
Helper class for make_valid_name function calls.
const std::string & get_replacement_style() const
make_valid_name_options()=default
Default options for make_valid_name function calls.
const std::string & get_prefix() const
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
F77_RET_T const F77_DBLE const F77_DBLE * f
std::size_t vformat(std::ostream &os, const char *fmt, va_list args)
std::string find_data_file_in_load_path(const std::string &fcn, const std::string &file, bool require_regular_file=false)
std::string asprintf(const char *fmt,...)
std::string do_string_escapes(const std::string &s)
octave_idx_type dims_to_numel(const dim_vector &dims, const octave_value_list &idx)
std::string undo_string_escapes(const std::string &s)
int almost_match(const std::string &std, const std::string &s, int min_match_len=1, int case_sens=1)
std::string file_in_path(const std::string &, const std::string &)
string_vector search_path_for_all_files(const std::string &, const string_vector &)
std::string contents_file_in_path(const std::string &)
int keyword_almost_match(const char *const *std, int *min_len, const std::string &s, int min_toks_to_match, int max_toks)
std::string search_path_for_file(const std::string &, const string_vector &)
Matrix identity_matrix(octave_idx_type nr, octave_idx_type nc)
std::string vasprintf(const char *fmt, va_list args)
void get_dimensions(const octave_value &a, const char *warn_for, dim_vector &dim)
bool valid_identifier(const char *s)
FloatMatrix float_identity_matrix(octave_idx_type nr, octave_idx_type nc)
std::size_t format(std::ostream &os, const char *fmt,...)
const char * undo_string_escape(char c)
void display_file_lines(std::ostream &os, const std::string &file_name, int start, int end, int target_line, const std::string &marker, const std::string &who)
bool make_valid_name(std::string &str, const make_valid_name_options &options)
Modify str to be a valid variable name.
std::string fcn_file_in_path(const std::string &)
void sleep(double seconds, bool do_graphics_events=false)
void check_dimensions(dim_vector &dim, const char *warnfor)
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)
bool same_file(const std::string &f, const std::string &g)