]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/bcp/file_types.cpp
3 * Copyright (c) 2003 Dr John Maddock
4 * Use, modification and distribution is subject to the
5 * Boost Software License, Version 1.0. (See accompanying file
6 * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 * This file implements the following:
9 * void bcp_implementation::is_source_file(const fs::path& p)
10 * void bcp_implementation::is_html_file(const fs::path& p)
11 * void bcp_implementation::is_binary_file(const fs::path& p)
14 #include "bcp_imp.hpp"
15 #include <boost/regex.hpp>
17 bool bcp_implementation::is_source_file(const fs::path
& p
)
19 static const boost::regex
e(
22 "c|cxx|h|hxx|inc|inl|.?pp|yy?"
24 boost::regex::perl
| boost::regex::icase
26 return boost::regex_match(p
.filename().generic_string(), e
);
29 bool bcp_implementation::is_html_file(const fs::path
& p
)
31 static const boost::regex
e(
37 return boost::regex_match(p
.filename().generic_string(), e
);
40 bool bcp_implementation::is_binary_file(const fs::path
& p
)
42 if(m_cvs_mode
|| m_svn_mode
)
44 std::map
<fs::path
, bool, path_less
>::iterator pos
= m_cvs_paths
.find(p
);
45 if(pos
!= m_cvs_paths
.end()) return pos
->second
;
47 static const boost::regex
e(
50 "c|cxx|cpp|h|hxx|hpp|inc|html?|css|mak|in"
53 "(Jamfile|makefile|configure)",
54 boost::regex::perl
| boost::regex::icase
);
55 return !boost::regex_match(p
.leaf().generic_string(), e
);
59 bool bcp_implementation::is_jam_file(const fs::path
& p
)
61 static const boost::regex
e(
67 "(Jamfile|Jamroot)\\.?",
68 boost::regex::perl
| boost::regex::icase
70 return boost::regex_match(p
.filename().generic_string(), e
);