26 #if defined (HAVE_CONFIG_H)
60 int npat = pat.
numel ();
62 const char *cstr = str.c_str ();
64 for (
int i = 0; i < npat; i++)
77 int npat = pat.
numel ();
87 for (
int i = 0; i < npat; i++)
89 std::string xpat = pat(i);
93 #if (defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) \
94 && ! defined (OCTAVE_HAVE_POSIX_FILESYSTEM))
95 std::replace_if (xpat.begin (), xpat.end (),
96 std::bind2nd (std::equal_to<char> (),
'\\'),
108 const char *
const *matches
122 for (
int j = 0; j <
n; j++)
124 std::string tmp = matches[j];
126 #if defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) \
127 && ! defined (OCTAVE_HAVE_POSIX_FILESYSTEM)
128 std::replace_if (tmp.begin (), tmp.end (),
129 std::bind2nd (std::equal_to<char> (),
153 int npat = pat.
numel ();
163 for (
int i = 0; i < npat; i++)
165 std::string xpat = pat(i);
170 escaped.reserve (xpat.length ());
172 for (
size_t j = 0; j < xpat.length (); j++)
174 #if (defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) \
175 && ! defined (OCTAVE_HAVE_POSIX_FILESYSTEM))
181 if (xpat[j] ==
']' || xpat[j] ==
'[')
189 int len = escaped.length ();
190 if (
len >= 3 && escaped.substr (
len - 3) ==
"*.*")
191 escaped = escaped.substr (0,
len - 2);
201 const char *
const *matches
215 for (
int j = 0; j <
n; j++)
217 std::string tmp = matches[j];
219 std::string unescaped;
220 unescaped.reserve (tmp.length ());
222 for (
size_t m = 0;
m < tmp.length ();
m++)
224 #if (defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) \
225 && ! defined (OCTAVE_HAVE_POSIX_FILESYSTEM))
232 && ++
m == tmp.length ())
Array< T > sort(int dim=0, sortmode mode=ASCENDING) const
Size of the specified dimension.
void resize(const dim_vector &dv, const T &rfv)
Size of the specified dimension.
void add_fcn(void(*fcn)(Params...), Args &&... args)
octave_idx_type numel(void) const
int octave_fnm_nomatch_wrapper(void)
int octave_glob_nosort_wrapper(void)
void octave_destroy_glob_info_struct(void *glob_info)
void octave_globfree_wrapper(void *glob_info)
void * octave_create_glob_info_struct(void)
int octave_glob_num_matches(void *glob_info)
int octave_glob_wrapper(const char *pattern, int flags, void *glob_info)
int octave_fnmatch_wrapper(const char *pattern, const char *name, int flags)
char ** octave_glob_match_list(void *glob_info)
string_vector windows_glob(const string_vector &pat)
bool fnmatch(const string_vector &pat, const std::string &str, int fnm_flags)
string_vector glob(const string_vector &pat)
static bool single_match_exists(const std::string &file)
octave_value::octave_value(const Array< char > &chm, char type) return retval