1 // unnamed_namespace_check -----------------------------------------// 2 3 // Copyright Gennaro Prota 2006. 4 5 // Distributed under the Boost Software License, Version 1.0. 6 // (See accompanying file LICENSE_1_0.txt or copy at 7 // http://www.boost.org/LICENSE_1_0.txt) 8 9 #ifndef BOOST_UNNAMED_NAMESPACE_CHECK_HPP_GP_20060718 10 #define BOOST_UNNAMED_NAMESPACE_CHECK_HPP_GP_20060718 11 12 #include "inspector.hpp" 13 14 namespace boost 15 { 16 namespace inspect 17 { 18 class unnamed_namespace_check : public inspector 19 { 20 long m_errors; 21 public: 22 23 unnamed_namespace_check(); name() const24 virtual const char * name() const { return "*U*"; } desc() const25 virtual const char * desc() const { return "unnamed namespace in header"; } 26 27 virtual void inspect( 28 const std::string & library_name, 29 const path & full_path, 30 const std::string & contents ); 31 ~unnamed_namespace_check()32 virtual ~unnamed_namespace_check() 33 { std::cout << " " << m_errors << " usages of unnamed namespaces in headers (including .ipp files)" << line_break(); } 34 }; 35 } 36 } 37 38 39 #endif // include guard 40