source: trunk/lib/Node.h @ 72

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

prefer stl algorithms...

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.8 KB
Line 
1// $Id: Node.h 72 2006-03-02 22:16:24Z 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#include <sstream>
11
12namespace theplu{
13namespace svnstat{
14
15  ///
16  /// Abstract Base Class for files.
17  ///
18  class Node
19  {
20  public:
21    ///
22    /// @brief Constructor
23    ///
24    Node(const std::string& path, const std::string& output="");
25
26    ///
27    /// @brief Destructor
28    ///
29    virtual inline ~Node(void) {};
30
31    inline const std::string& output_name(void) const { return output_name_; }
32
33    ///
34    /// @brief parsing file using svn blame.
35    ///
36    virtual const Stats& parse(const bool verbose=false)=0;
37
38    ///
39    /// Function printing HTML in current working directory
40    ///
41    virtual void print(const bool verbose=false) const=0;
42
43    ///
44    /// @return html link.
45    ///
46    std::string html_link(void) const;
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.