23 #if defined (HAVE_CONFIG_H) 57 int npat = pat.
numel ();
59 const char *cstr =
str.c_str ();
61 for (
int i = 0;
i < npat;
i++)
74 int npat = pat.
numel ();
84 for (
int i = 0;
i < npat;
i++)
90 #if (defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) \ 91 && ! defined (OCTAVE_HAVE_POSIX_FILESYSTEM)) 92 std::replace_if (xpat.begin (), xpat.end (),
93 std::bind2nd (std::equal_to<char> (),
'\\'),
105 const char *
const *matches
119 for (
int j = 0; j < n; j++)
123 #if defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) \ 124 && ! defined (OCTAVE_HAVE_POSIX_FILESYSTEM) 125 std::replace_if (
tmp.begin (),
tmp.end (),
126 std::bind2nd (std::equal_to<char> (),
150 int npat = pat.
numel ();
160 for (
int i = 0;
i < npat;
i++)
167 escaped.reserve (xpat.length ());
169 for (
size_t j = 0; j < xpat.length (); j++)
171 #if (defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) \ 172 && ! defined (OCTAVE_HAVE_POSIX_FILESYSTEM)) 178 if (xpat[j] ==
']' || xpat[j] ==
'[')
186 int len = escaped.length ();
187 if (len >= 3 && escaped.substr (len - 3) ==
"*.*")
188 escaped = escaped.substr (0, len - 2);
198 const char *
const *matches
212 for (
int j = 0; j < n; j++)
217 unescaped.reserve (
tmp.length ());
219 for (
size_t m = 0; m <
tmp.length (); m++)
221 #if (defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) \ 222 && ! defined (OCTAVE_HAVE_POSIX_FILESYSTEM)) 229 && ++m ==
tmp.length ())
void octave_globfree_wrapper(void *glob_info)
bool fnmatch(const string_vector &pat, const std::string &str, int fnm_flags)
For example cd octave end example noindent changes the current working directory to file
int octave_glob_num_matches(void *glob_info)
void add_fcn(void(*fcn)(void))
int octave_fnmatch_wrapper(const char *pattern, const char *name, int flags)
int octave_glob_nosort_wrapper(void)
int octave_glob_wrapper(const char *pattern, int flags, void *glob_info)
octave_value resize(const dim_vector &dv, bool fill=false) const
int octave_fnm_nomatch_wrapper(void)
octave_value sort(octave_idx_type dim=0, sortmode mode=ASCENDING) const
char ** octave_glob_match_list(void *glob_info)
string_vector windows_glob(const string_vector &pat)
void * octave_create_glob_info_struct(void)
void octave_destroy_glob_info_struct(void *glob_info)
octave::unwind_protect frame
OCTAVE_EXPORT octave_value_list error nd deftypefn *const octave_scalar_map err
octave_idx_type numel(void) const
Number of elements in the array.
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
string_vector glob(const string_vector &pat)
static bool single_match_exists(const std::string &file)