]> git.lyx.org Git - lyx.git/blobdiff - src/support/globbing.h
tostr -> convert and some bformat work
[lyx.git] / src / support / globbing.h
index 0ee11415124c9e69814a20e241080bd5f69c9408..d495a9670c8925f768d6a49fc96338ea591c7cb4 100644 (file)
 namespace lyx {
 namespace support {
 
-/** Given a string such as
- *      "<glob> <glob> ... *.{abc,def} <glob>",
- *  convert the csh-style brace expresions:
- *      "<glob> <glob> ... *.abc *.def <glob>".
- *  Requires no system support, so should work equally on Unix, Mac, Win32.
- */
-std::string const convert_brace_glob(std::string const & glob);
-
-
 /** A wrapper for the Posix function 'glob'.
+ *  \param matches files found to match \c pattern are appended.
  *  \param pattern the glob to be expanded. Eg "*.[Ch]".
+ *  \param working_dir the starting directory from which \c pattern
+ *  is to be expanded. Used only if \c pattern is a relative path.
  *  \param flags flags to be passed to the system function. See 'man glob'.
- *  \returns a vector of the files found to match \c pattern.
- */
-std::vector<std::string> const glob(std::string const & pattern, int flags = 0);
-
-
-/** Given a string "<glob> <glob> <glob>", expand each glob in turn.
- *  Any glob that cannot be expanded is ignored silently.
- *  Invokes \c convert_brace_glob and \c glob internally, so use only
- *  on systems supporting the Posix function 'glob'.
- *  \param mask the string "<glob> <glob> <glob>".
- *  \param directory (if not empty) the current working directory from
- *  which \c glob is invoked.
- *  \returns a vector of all matching file names.
  */
-std::vector<std::string> const
-expand_globs(std::string const & mask,
-            std::string const & directory = std::string());
+void glob(std::vector<std::string> & matches,
+         std::string const & pattern,
+         std::string const & working_dir,
+         int flags = 0);
 
 } // namespace support
 } // namespace lyx