source: trunk/lib/Node.h @ 60

Last change on this file since 60 was 60, checked in by Peter Johansson, 16 years ago

plotting vs date rather than revision

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.8 KB
Line 
1// $Id: Node.h 60 2006-01-16 10:03:04Z peter $
2
3#ifndef _theplu_svnstat_node_
4#define _theplu_svnstat_node_
5
6#include "Stats.h"
7
8#include <ostream>
9#include <string>
10
11namespace theplu{
12namespace svnstat{
13
14  ///
15  /// Abstract Base Class for files.
16  ///
17  class Node
18  {
19  public:
20    ///
21    /// @brief Constructor
22    ///
23    Node(const std::string& path, const std::string& output="");
24
25    ///
26    /// @brief Destructor
27    ///
28    virtual inline ~Node(void) {};
29
30    const std::string& output_name(void) const { return output_name_; }
31
32    ///
33    /// @brief parsing file using svn blame.
34    ///
35    virtual const Stats& parse(const bool verbose=false)=0;
36
37    ///
38    /// Function printing HTML in current working directory
39    ///
40    virtual void print(const bool verbose=false) const=0;
41
42    ///
43    /// Prints a html link.
44    ///
45    inline void print_link(std::ostream& os) const
46    { os << "<a href=\"" << output_name() << ".html\">" << name() << "</a>"; }
47 
48    ///
49    ///
50    ///
51    inline virtual void purge(const bool verbose=false) 
52    { /* Nothing to be done */ };
53
54    ///
55    /// Check if the node is under subversion control. This is done by
56    /// checking the return status of 'svn proplist <Node>.
57    ///
58    /// @return True if subversion controlled, false otherwise.
59    ///
60    bool subversion_controlled(void) const;
61
62  protected:
63    ///
64    /// Function returning everything after the last '/'
65    ///
66    /// @return name of node (not full path)
67    ///
68    std::string name(void) const;
69
70    ///
71    /// @brief print html footer of page
72    ///
73    void print_footer(std::ostream&) const;
74   
75    ///
76    /// @brief print html header of page
77    ///
78    void print_header(std::ostream&) const;
79
80    std::string output_name_; //without suffix
81    std::string path_;
82    Stats stats_;
83
84  private:
85    ///
86    /// @brief Copy Constructor, not implemented
87    ///
88    Node(const Node&);
89
90  };
91
92}} // end of namespace svnstat and namespace theplu
93
94#endif
Note: See TracBrowser for help on using the repository browser.