LifeV
license_check.cpp
Go to the documentation of this file.
1 // license_check implementation --------------------------------------------//
2 
3 // Copyright Beman Dawes 2002-2003.
4 // Distributed under the Boost Software License, Version 1.0.
5 // (See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
7 
8 #include <boost/regex.hpp>
9 #include "license_check.hpp"
10 
11 namespace
12 {
13 boost::regex license_regex (
14  "General(\\s+|\\s+#\\s*|\\s+//\\s*)Public(\\s+|\\s+#\\s*|\\s+//\\s*)License",
16 
17 } // unnamed namespace
18 
19 namespace boost
20 {
21 namespace inspect
22 {
24 {
25 }
26 
28  const string& library_name,
29  const path& full_path, // example: c:/foo/boost/filesystem/path.hpp
30  const string& contents ) // contents of file to be inspected
31 {
32  if ( !boost::regex_search ( contents, license_regex ) )
33  {
35  error ( library_name, full_path, desc() );
36  }
37 }
38 } // namespace inspect
39 } // namespace boost
boost::regex license_regex("General(\+|\+#\*|\+//\*)Public(\+|\+#\*|\+//\*)License", boost::regbase::normal|boost::regbase::icase)
virtual void inspect(const std::string &library_name, const path &full_path, const std::string &contents)