1 /*=============================================================================
2 Copyright (c) 2013 Daniel James
4 Use, modification and distribution is subject to the Boost Software
5 License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6 http://www.boost.org/LICENSE_1_0.txt)
7 =============================================================================*/
9 #include <boost/utility/string_ref.hpp>
14 struct glob_error : std::runtime_error
16 explicit glob_error(char const* error) :
17 std::runtime_error(error) {}
20 // Is this path a glob? Throws glob_error if glob is invalid.
21 bool check_glob(boost::string_ref);
23 // pre: glob is valid (call check_glob first on user data).
24 bool glob(boost::string_ref const& pattern,
25 boost::string_ref const& filename);
27 std::size_t find_glob_char(boost::string_ref,
28 std::size_t start = 0);
29 std::string glob_unescape(boost::string_ref);