56 const char *cstr = str.c_str ();
58 for (
int i = 0; i < npat; i++)
59 if (fnmatch (pat(i).c_str (), cstr, fnmatch_flags) != FNM_NOMATCH)
74 for (
int i = 0; i < npat; i++)
76 std::string xpat = pat(i);
82 #if defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) \
83 && ! defined (OCTAVE_HAVE_POSIX_FILESYSTEM)
84 std::replace_if (xpat.begin (), xpat.end (),
85 std::bind2nd (std::equal_to<char> (),
'\\'),
89 int err = gnulib::glob (xpat.c_str (), GLOB_NOSORT, 0, &glob_info);
93 int n = glob_info.gl_pathc;
95 const char *
const *matches = glob_info.gl_pathv;
108 for (
int j = 0; j < n; j++)
110 std::string tmp = matches[j];
112 #if defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) \
113 && ! defined (OCTAVE_HAVE_POSIX_FILESYSTEM)
114 std::replace_if (tmp.begin (), tmp.end (),
115 std::bind2nd (std::equal_to<char> (),
124 gnulib::globfree (&glob_info);
129 return retval.
sort ();
string_vector octave_glob(const string_vector &pat)
bool octave_fnmatch(const string_vector &pat, const std::string &str, int fnmatch_flags)
void resize(octave_idx_type n, const std::string &rfv=std::string())
string_vector & sort(bool make_uniq=false)
octave_idx_type length(void) const
Number of elements in the array.
static bool single_match_exists(const std::string &file)