26 #if ! defined (octave_utils_h)
27 #define octave_utils_h 1
29 #include "octave-config.h"
49 extern OCTINTERP_API
bool
50 same_file (
const std::string&
f,
const std::string& g);
52 extern OCTINTERP_API
int almost_match (
const std::string& std,
54 int min_match_len = 1,
57 extern OCTINTERP_API
int
59 const std::string& s,
int min_toks_to_match,
62 extern OCTINTERP_API std::string
68 extern OCTINTERP_API std::string
71 extern OCTINTERP_API std::string
73 const std::string& file,
74 bool require_regular_file =
false);
86 extern OCTINTERP_API
void
89 extern OCTINTERP_API
void
93 extern OCTINTERP_API
void
98 extern OCTINTERP_API
void
105 extern OCTINTERP_API
Matrix
111 extern OCTINTERP_API
size_t
112 format (std::ostream& os,
const char *fmt, ...);
114 extern OCTINTERP_API
size_t
115 format (std::ostream& os,
const std::string& enc,
const char *fmt, ...);
117 extern OCTINTERP_API
size_t
118 vformat (std::ostream& os,
const char *fmt, va_list args);
120 extern OCTINTERP_API
size_t
121 vformat (std::ostream& os,
const std::string& enc,
122 const char *fmt, va_list args);
124 extern OCTINTERP_API std::string
125 vasprintf (
const char *fmt, va_list args);
127 extern OCTINTERP_API std::string
asprintf (
const char *fmt, ...);
129 extern OCTINTERP_API
void sleep (
double seconds,
130 bool do_graphics_events =
false);
144 #if defined (OCTAVE_USE_DEPRECATED_FUNCTIONS)
146 OCTAVE_DEPRECATED (5,
"use 'octave::valid_identifier' instead")
147 extern OCTINTERP_API
bool
151 extern OCTINTERP_API
bool
155 extern OCTINTERP_API
bool
156 same_file (const std::
string&
f, const std::
string& g);
159 extern OCTINTERP_API
int
160 almost_match (const std::
string& std, const std::
string& s,
161 int min_match_len = 1,
int case_sens = 1);
164 extern OCTINTERP_API
int
166 const std::
string& s,
int min_toks_to_match,
170 extern OCTINTERP_API std::
string
178 extern OCTINTERP_API std::
string
182 extern OCTINTERP_API std::
string
184 bool require_regular_file = false);
187 extern OCTINTERP_API std::
string
191 extern OCTINTERP_API std::
string
195 extern OCTINTERP_API std::
string
199 extern OCTINTERP_API const
char *
203 extern OCTINTERP_API std::
string
207 extern OCTINTERP_API
void
211 extern OCTINTERP_API
void
216 extern OCTINTERP_API
void
222 extern OCTINTERP_API
void
231 extern OCTINTERP_API
Matrix
238 template <typename ... Args>
241 octave_format (std::ostream& os, const
char *fmt, Args&& ... args)
246 OCTAVE_DEPRECATED (5,
"use 'octave::vformat' instead")
247 extern OCTINTERP_API
size_t
251 extern OCTINTERP_API std::
string
254 template <typename ... Args>
257 octave_asprintf (const
char *fmt, Args&& ... args)
262 OCTAVE_DEPRECATED (5,
"use 'octave::sleep' instead")
263 extern OCTINTERP_API
void
Vector representing the dimensions (size) of an Array.
octave_value identity_matrix(int nr, int nc)
F77_RET_T const F77_DBLE const F77_DBLE * f
void get_dimensions(const octave_value &a, const char *warn_for, dim_vector &dim)
int almost_match(const std::string &std, const std::string &s, int min_match_len, int case_sens)
std::string vasprintf(const char *fmt, va_list args)
std::string contents_file_in_path(const std::string &dir)
bool valid_identifier(const char *s)
static void check_dimensions(octave_idx_type &nr, octave_idx_type &nc, const char *warnfor)
static double f(double k, double l_nu, double c_pm)
std::string do_string_escapes(const std::string &s)
string_vector search_path_for_all_files(const std::string &path, const string_vector &names)
const char * undo_string_escape(char c)
std::string asprintf(const char *fmt,...)
void sleep(double seconds, bool do_graphics_events)
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)
Matrix identity_matrix(octave_idx_type nr, octave_idx_type nc)
std::string fcn_file_in_path(const std::string &name)
int keyword_almost_match(const char *const *std, int *min_len, const std::string &s, int min_toks_to_match, int max_toks)
size_t vformat(std::ostream &os, const char *fmt, va_list args)
std::string file_in_path(const std::string &name, const std::string &suffix)
std::string find_data_file_in_load_path(const std::string &fcn, const std::string &file, bool require_regular_file)
size_t format(std::ostream &os, const char *fmt,...)
FloatMatrix float_identity_matrix(octave_idx_type nr, octave_idx_type nc)
bool same_file(const std::string &f, const std::string &g)
std::string search_path_for_file(const std::string &path, const string_vector &names)
std::string undo_string_escapes(const std::string &s)
octave_idx_type dims_to_numel(const dim_vector &dims, const octave_value_list &idx_arg)
std::string do_string_escapes(const std::string &s)
std::string find_data_file_in_load_path(const std::string &fcn, const std::string &file, bool require_regular_file)
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, int case_sens)
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 file_in_path(const std::string &name, const std::string &suffix)
FloatMatrix float_identity_matrix(octave_idx_type nr, octave_idx_type nc)
void octave_sleep(double seconds)
string_vector search_path_for_all_files(const std::string &path, const string_vector &names)
std::string contents_file_in_path(const std::string &s)
size_t octave_vformat(std::ostream &os, const char *fmt, va_list args)
std::string fcn_file_in_path(const std::string &s)
const char * undo_string_escape(char c)
std::string search_path_for_file(const std::string &path, const string_vector &names)
void check_dimensions(dim_vector &dim, const char *warnfor)
bool same_file(const std::string &f, const std::string &g)
std::string octave_vasprintf(const char *fmt, va_list args)