]> git.lyx.org Git - lyx.git/blob - src/support/globbing.C
Clean-up FileFilterList API.
[lyx.git] / src / support / globbing.C
1 /**
2  * \file globbing.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Angus Leeming
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "support/globbing.h"
14
15 #include <glob.h>
16
17 using std::string;
18 using std::vector;
19
20
21 namespace lyx {
22 namespace support {
23
24 vector<string> const glob(string const & pattern, int flags)
25 {
26         glob_t glob_buffer;
27         glob_buffer.gl_offs = 0;
28         glob(pattern.c_str(), flags, 0, &glob_buffer);
29         vector<string> const matches(glob_buffer.gl_pathv,
30                                      glob_buffer.gl_pathv +
31                                      glob_buffer.gl_pathc);
32         globfree(&glob_buffer);
33         return matches;
34 }
35
36 } // namespace support
37 } // namespace lyx