4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
9 * Full author contact details are available in file CREDITS.
21 /** Given a string such as
22 * "<glob> <glob> ... *.{abc,def} <glob>",
23 * convert the csh-style brace expresions:
24 * "<glob> <glob> ... *.abc *.def <glob>".
25 * Requires no system support, so should work equally on Unix, Mac, Win32.
27 std::string const convert_brace_glob(std::string const & glob);
30 /** A wrapper for the Posix function 'glob'.
31 * \param pattern the glob to be expanded. Eg "*.[Ch]".
32 * \param flags flags to be passed to the system function. See 'man glob'.
33 * \returns a vector of the files found to match \c pattern.
35 std::vector<std::string> const glob(std::string const & pattern, int flags = 0);
38 /** Given a string "<glob> <glob> <glob>", expand each glob in turn.
39 * Any glob that cannot be expanded is ignored silently.
40 * Invokes \c convert_brace_glob and \c glob internally, so use only
41 * on systems supporting the Posix function 'glob'.
42 * \param mask the string "<glob> <glob> <glob>".
43 * \param directory (if not empty) the current working directory from
44 * which \c glob is invoked.
45 * \returns a vector of all matching file names.
47 std::vector<std::string> const
48 expand_globs(std::string const & mask,
49 std::string const & directory = std::string());
51 } // namespace support
54 #endif // NOT GLOBBING_H