1 // tab_check implementation ------------------------------------------------// 2 3 // Copyright Beman Dawes 2002. 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 #include "tab_check.hpp" 10 11 namespace boost 12 { 13 namespace inspect 14 { tab_check()15 tab_check::tab_check() : m_files_with_errors(0) 16 { 17 register_signature( ".c" ); 18 register_signature( ".cpp" ); 19 register_signature( ".cxx" ); 20 register_signature( ".h" ); 21 register_signature( ".hpp" ); 22 register_signature( ".hxx" ); 23 register_signature( ".ipp" ); 24 register_signature( "Jamfile" ); 25 register_signature( ".py" ); 26 } 27 inspect(const string & library_name,const path & full_path,const string & contents)28 void tab_check::inspect( 29 const string & library_name, 30 const path & full_path, // example: c:/foo/boost/filesystem/path.hpp 31 const string & contents ) // contents of file to be inspected 32 { 33 if (contents.find( "boostinspect:" "notab" ) != string::npos) return; 34 35 if ( contents.find( '\t' ) != string::npos ) 36 { 37 ++m_files_with_errors; 38 error( library_name, full_path, name() ); 39 } 40 } 41 } // namespace inspect 42 } // namespace boost 43 44 45