2 Copyright (C) 2000-2007 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __libmisc_pathscanner_h__
21 #define __libmisc_pathscanner_h__
26 #include <ardourext/misc.h>
31 #include "pbd/libpbd_visibility.h"
33 class LIBPBD_API PathScanner
37 std::vector<std::string> operator() (const std::string &dirpath,
38 bool (*filter)(const std::string &, void *arg),
40 bool match_fullpath = true,
41 bool return_fullpath = true,
43 bool recurse = false) {
44 return run_scan (dirpath,
52 std::vector<std::string> operator() (const std::string &dirpath,
53 const std::string ®exp,
54 bool match_fullpath = true,
55 bool return_fullpath = true,
57 bool recurse = false);
59 std::string find_first (const std::string &dirpath,
60 const std::string ®exp,
61 bool match_fullpath = true,
62 bool return_fullpath = true);
64 std::string find_first (const std::string &dirpath,
65 bool (*filter)(const std::string &, void *),
67 bool match_fullpath = true,
68 bool return_fullpath = true);
72 std::vector<std::string> run_scan (const std::string &dirpath,
73 bool (*filter)(const std::string &, void *),
78 bool recurse = false);
80 void run_scan_internal (std::vector<std::string>&,
81 const std::string &dirpath,
82 bool (*filter)(const std::string &, void *),
87 bool recurse = false);
90 #endif // __libmisc_pathscanner_h__