Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/tools/inspect/link_check.hpp @ 14

Last change on this file since 14 was 12, checked in by landauf, 18 years ago

added boost

File size: 1.8 KB
Line 
1//  link_check header  -------------------------------------------------------//
2
3//  Copyright Beman Dawes 2002
4//  Copyright Rene Rivera 2004.
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_LINK_CHECK_HPP
10#define BOOST_LINK_CHECK_HPP
11
12#include "inspector.hpp"
13
14#include <map>
15#include <utility> // for make_pair()
16
17namespace boost
18{
19  namespace inspect
20  {
21    const int m_linked_to = 1;
22    const int m_present = 2;
23
24    class link_check : public hypertext_inspector
25    {
26      long m_broken_errors;
27      long m_unlinked_errors;
28      long m_invalid_errors;
29      long m_bookmark_errors;
30
31      typedef std::map< string, int > m_path_map;
32      m_path_map m_paths; // first() is relative initial_path()
33
34      void do_url( const string & url,
35        const string & library_name, const path & full_source_path );
36    public:
37
38      link_check();
39      virtual const char * name() const { return "link-check"; }
40      virtual const char * desc() const { return "invalid bookmarks, invalid urls, broken links, unlinked files"; }
41
42      virtual void inspect(
43        const std::string & library_name,
44        const path & full_path );
45
46      virtual void inspect(
47        const std::string & library_name,
48        const path & full_path,
49        const std::string & contents );
50
51      virtual void close();
52
53      virtual ~link_check()
54        {
55          std::cout << "  " << m_bookmark_errors << " bookmarks with invalid characters\n";
56          std::cout << "  " << m_invalid_errors << " invalid urls\n";
57          std::cout << "  " << m_broken_errors << " broken links\n";
58          std::cout << "  " << m_unlinked_errors << " unlinked files\n";
59        }
60    };
61  }
62}
63
64#endif // BOOST_LINK_CHECK_HPP
Note: See TracBrowser for help on using the repository browser.