1 //  deprecated_name_check header  -------------------------------------------//
2 
3 //  Copyright Beman Dawes   2002
4 //  Copyright Rene Rivera   2004.
5 //  Copyright Gennaro Prota 2006.
6 //  Copyright Hartmut Kaiser 2016.
7 //
8 //  Distributed under the Boost Software License, Version 1.0.
9 //  (See accompanying file LICENSE_1_0.txt or copy at
10 //  http://www.boost.org/LICENSE_1_0.txt)
11 
12 #ifndef HPX_DEPRECATED_NAMES_CHECK_HPP
13 #define HPX_DEPRECATED_NAMES_CHECK_HPP
14 
15 #include "inspector.hpp"
16 
17 #include "boost/regex.hpp"
18 
19 #include <vector>
20 
21 namespace boost
22 {
23   namespace inspect
24   {
25     struct deprecated_names
26     {
27       char const* name_regex;
28       char const* use_instead;
29     };
30 
31     struct deprecated_names_regex_data
32     {
deprecated_names_regex_databoost::inspect::deprecated_names_regex_data33       deprecated_names_regex_data(deprecated_names const* d,
34             std::string const& rx)
35         : data(d), pattern(rx, boost::regex::normal)
36       {}
37 
38       deprecated_names const* data;
39       boost::regex pattern;
40     };
41 
42     class deprecated_name_check : public inspector
43     {
44       long m_errors;
45       std::vector<deprecated_names_regex_data> regex_data;
46 
47     public:
48 
49       deprecated_name_check();
name() const50       virtual const char * name() const { return "*DN*"; }
desc() const51       virtual const char * desc() const { return "uses of deprecated names"; }
52 
53       virtual void inspect(
54         const std::string & library_name,
55         const path & full_path,
56         const std::string & contents);
57 
print_summary(std::ostream & out)58       virtual void print_summary(std::ostream& out)
59       {
60         out << "  " << m_errors << " deprecated names" << line_break();
61       }
62 
~deprecated_name_check()63       virtual ~deprecated_name_check() {}
64     };
65   }
66 }
67 
68 #endif // HPX_DEPRECATED_NAMES_CHECK_HPP
69