source: branches/0.6-stable/lib/Directory.h @ 479

Last change on this file since 479 was 430, checked in by Peter Johansson, 14 years ago

changing lev.thep.lu.se to trac.thep.lu.se

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.6 KB
Line 
1#ifndef _theplu_svndigest_directory_
2#define _theplu_svndigest_directory_
3
4// $Id: Directory.h 430 2007-07-06 23:33:11Z peter $
5
6/*
7  Copyright (C) 2005, 2006, 2007 Jari Häkkinen, Peter Johansson
8
9  This file is part of svndigest, http://trac.thep.lu.se/trac/svndigest
10
11  svndigest is free software; you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation; either version 2 of the License, or
14  (at your option) any later version.
15
16  svndigest is distributed in the hope that it will be useful, but
17  WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  General Public License for more details.
20
21  You should have received a copy of the GNU General Public License
22  along with this program; if not, write to the Free Software
23  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
24  02111-1307, USA.
25*/
26
27#include "Node.h"
28
29#include <list>
30#include <map>
31#include <string>
32
33namespace theplu{
34namespace svndigest{
35
36  ///
37  /// Class taking care of directories.
38  ///
39  class Directory : public Node
40  {
41  public:
42
43    ///
44    /// @brief Constructor
45    ///
46    /// Recursively create a directory tree starting from \a path. All
47    /// entries except explicit directories are treated as File nodes,
48    /// i.e. symbolic links to directories are treated as File
49    /// nodes. This will ensure that the directory structure is a tree
50    /// and double counting of branches is avoided.
51    ///
52    /// @note Nodes named '.', '..', and '.svn' are ignored and not
53    /// traversed.
54    ///
55    Directory(const u_int level, const std::string& path, 
56              const std::string& output="");
57
58    ///
59    /// @brief Destructor
60    ///
61    ~Directory(void);
62
63    ///
64    /// @return true
65    ///
66    bool dir(void) const;
67
68    ///
69    /// @return directory-name/index.html
70    ///
71    std::string href(void) const;
72
73    /**
74       @return The explicit string "directory", nothing else.
75    */
76    std::string node_type(void) const;
77
78    /**
79       @return output path for example 'lib/File.h.html' for this file
80     */
81    std::string output_path(void) const;
82
83    const Stats& parse(const bool verbose=false);
84
85    void print_copyright(std::map<std::string, Alias>&) const;
86
87  private:
88    ///
89    /// @brief Copy Constructor, not implemented
90    ///
91    Directory(const Directory&);
92
93    void print_core(bool verbose=false) const;
94
95    void print_core(const std::string& user, const std::string& line_type,
96                    const SVNlog&) const;
97
98
99    typedef std::list<Node*> NodeContainer;
100    typedef NodeContainer::iterator NodeIterator;
101    typedef NodeContainer::const_iterator NodeConstIterator;
102    NodeContainer daughters_;
103  };
104
105}} // end of namespace svndigest and namespace theplu
106
107#endif
Note: See TracBrowser for help on using the repository browser.