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 #if !defined(QUICKBOOK_DEPENDENCY_TRACKER_HPP)
10 #define QUICKBOOK_DEPENDENCY_TRACKER_HPP
15 #include <boost/filesystem/path.hpp>
19 namespace fs = boost::filesystem;
21 struct dependency_tracker
24 typedef std::map<fs::path, bool> dependency_list;
25 typedef std::map<fs::path, std::set<fs::path> > glob_list;
27 dependency_list dependencies;
28 glob_list glob_dependencies;
29 glob_list::iterator last_glob;
41 // Call this before loading any file so that it will be included in the
42 // list of dependencies. Returns true if file exists.
43 bool add_dependency(fs::path const&);
45 void add_glob(fs::path const&);
46 void add_glob_match(fs::path const&);
48 void write_dependencies(fs::path const&, flags = default_);
49 void write_dependencies(std::ostream&, flags = default_);