source: trunk/lib/Node.h @ 23

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

added print functionality

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