GNU Octave  9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
utils.h File Reference
#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

int almost_match (const std::string &std, const std::string &s, int min_match_len=1, int case_sens=1)
 
std::string asprintf (const char *fmt,...)
 
void check_dimensions (dim_vector &dim, const char *warnfor)
 
std::string contents_file_in_path (const std::string &)
 
octave_idx_type dims_to_numel (const dim_vector &dims, const octave_value_list &idx)
 
octave_value do_simple_cellfun (octave_value_list(*fcn)(const octave_value_list &, int), const char *fcn_name, const octave_value_list &args)
 
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)
 
std::string do_string_escapes (const std::string &s)
 
std::string fcn_file_in_path (const std::string &)
 
std::string file_in_path (const std::string &, const std::string &)
 
std::string find_data_file_in_load_path (const std::string &fcn, const std::string &file, bool require_regular_file=false)
 
FloatMatrix float_identity_matrix (octave_idx_type nr, octave_idx_type nc)
 
std::size_t format (std::ostream &os, const char *fmt,...)
 
void get_dimensions (const octave_value &a, const char *warn_for, dim_vector &dim)
 
void get_dimensions (const octave_value &a, const char *warn_for, octave_idx_type &nr, octave_idx_type &nc)
 
void get_dimensions (const octave_value &a, const octave_value &b, const char *warn_for, octave_idx_type &nr, octave_idx_type &nc)
 
Matrix identity_matrix (octave_idx_type nr, octave_idx_type nc)
 
int keyword_almost_match (const char *const *std, int *min_len, const std::string &s, int min_toks_to_match, int max_toks)
 
bool make_valid_name (std::string &str, const make_valid_name_options &options)
 Modify str to be a valid variable name. More...
 
bool same_file (const std::string &f, const std::string &g)
 
string_vector search_path_for_all_files (const std::string &, const string_vector &)
 
std::string search_path_for_file (const std::string &, const string_vector &)
 
void sleep (double seconds, bool do_graphics_events=false)
 
const char * undo_string_escape (char c)
 
std::string undo_string_escapes (const std::string &s)
 
bool valid_identifier (const char *s)
 
bool valid_identifier (const std::string &s)
 
std::string vasprintf (const char *fmt, va_list args)
 
std::size_t vformat (std::ostream &os, const char *fmt, va_list args)
 

Function Documentation

◆ almost_match()

int almost_match ( const std::string &  std,
const std::string &  s,
int  min_match_len = 1,
int  case_sens = 1 
)

◆ asprintf()

std::string asprintf ( const char *  fmt,
  ... 
)

◆ check_dimensions()

void check_dimensions ( dim_vector dim,
const char *  warnfor 
)

Referenced by Fcell(), and octave::get_dimensions().

◆ contents_file_in_path()

std::string contents_file_in_path ( const std::string &  )

◆ dims_to_numel()

octave_idx_type dims_to_numel ( const dim_vector dims,
const octave_value_list idx 
)

Referenced by Fnumel().

◆ do_simple_cellfun() [1/2]

octave_value do_simple_cellfun ( octave_value_list(*)(const octave_value_list &, int)  fcn,
const char *  fcn_name,
const octave_value_list args 
)

◆ do_simple_cellfun() [2/2]

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 
)

◆ do_string_escapes()

std::string do_string_escapes ( const std::string &  s)

◆ fcn_file_in_path()

std::string fcn_file_in_path ( const std::string &  )

◆ file_in_path()

std::string file_in_path ( const std::string &  ,
const std::string &   
)

◆ find_data_file_in_load_path()

std::string find_data_file_in_load_path ( const std::string &  fcn,
const std::string &  file,
bool  require_regular_file = false 
)

◆ float_identity_matrix()

FloatMatrix float_identity_matrix ( octave_idx_type  nr,
octave_idx_type  nc 
)

◆ format()

◆ get_dimensions() [1/3]

void get_dimensions ( const octave_value a,
const char *  warn_for,
dim_vector dim 
)

◆ get_dimensions() [2/3]

void get_dimensions ( const octave_value a,
const char *  warn_for,
octave_idx_type nr,
octave_idx_type nc 
)

◆ get_dimensions() [3/3]

void get_dimensions ( const octave_value a,
const octave_value b,
const char *  warn_for,
octave_idx_type nr,
octave_idx_type nc 
)

◆ identity_matrix()

Matrix identity_matrix ( octave_idx_type  nr,
octave_idx_type  nc 
)

◆ keyword_almost_match()

int keyword_almost_match ( const char *const *  std,
int *  min_len,
const std::string &  s,
int  min_toks_to_match,
int  max_toks 
)

◆ make_valid_name()

bool make_valid_name ( std::string &  str,
const make_valid_name_options options 
)

Modify str to be a valid variable name.

Parameters
strinput string
optionssee also help matlab.lang.makeValidName.
Returns
true, if str was modified.

Referenced by octave::F__make_valid_name__().

◆ same_file()

bool same_file ( const std::string &  f,
const std::string &  g 
)

◆ search_path_for_all_files()

string_vector search_path_for_all_files ( const std::string &  ,
const string_vector  
)

◆ search_path_for_file()

std::string search_path_for_file ( const std::string &  ,
const string_vector  
)

Referenced by octave::Ffile_in_path().

◆ sleep()

void sleep ( double  seconds,
bool  do_graphics_events = false 
)

◆ undo_string_escape()

const char* undo_string_escape ( char  c)

◆ undo_string_escapes()

std::string undo_string_escapes ( const std::string &  s)

◆ valid_identifier() [1/2]

bool valid_identifier ( const char *  s)

◆ valid_identifier() [2/2]

bool valid_identifier ( const std::string &  s)

◆ vasprintf()

std::string vasprintf ( const char *  fmt,
va_list  args 
)

◆ vformat()

std::size_t vformat ( std::ostream &  os,
const char *  fmt,
va_list  args 
)

Referenced by octave::format().