summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '3rdParty/Boost/src/tools/bcp/file_types.cpp')
-rw-r--r--3rdParty/Boost/src/tools/bcp/file_types.cpp57
1 files changed, 57 insertions, 0 deletions
diff --git a/3rdParty/Boost/src/tools/bcp/file_types.cpp b/3rdParty/Boost/src/tools/bcp/file_types.cpp
new file mode 100644
index 0000000..bc9ca31
--- /dev/null
+++ b/3rdParty/Boost/src/tools/bcp/file_types.cpp
@@ -0,0 +1,57 @@
+/*
+ *
+ * Copyright (c) 2003 Dr John Maddock
+ * Use, modification and distribution is subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ * This file implements the following:
+ * void bcp_implementation::is_source_file(const fs::path& p)
+ * void bcp_implementation::is_html_file(const fs::path& p)
+ * void bcp_implementation::is_binary_file(const fs::path& p)
+ */
+
+#include "bcp_imp.hpp"
+#include <boost/regex.hpp>
+
+bool bcp_implementation::is_source_file(const fs::path& p)
+{
+ static const boost::regex e(
+ ".*\\."
+ "(?:"
+ "c|cxx|h|hxx|inc|.?pp|yy?"
+ ")",
+ boost::regex::perl | boost::regex::icase
+ );
+ return boost::regex_match(p.string(), e);
+}
+
+bool bcp_implementation::is_html_file(const fs::path& p)
+{
+ static const boost::regex e(
+ ".*\\."
+ "(?:"
+ "html?|css"
+ ")"
+ );
+ return boost::regex_match(p.string(), e);
+}
+
+bool bcp_implementation::is_binary_file(const fs::path& p)
+{
+ if(m_cvs_mode || m_svn_mode)
+ {
+ std::map<fs::path, bool, path_less>::iterator pos = m_cvs_paths.find(p);
+ if(pos != m_cvs_paths.end()) return pos->second;
+ }
+ static const boost::regex e(
+ ".*\\."
+ "(?:"
+ "c|cxx|cpp|h|hxx|hpp|inc|html?|css|mak|in"
+ ")"
+ "|"
+ "(Jamfile|makefile|configure)",
+ boost::regex::perl | boost::regex::icase);
+ return !boost::regex_match(p.leaf(), e);
+
+}