source: trunk/lib/Directory.h @ 101

Last change on this file since 101 was 101, checked in by Peter Johansson, 15 years ago

closes #28 #18 and added some lippstick to the node daughters table output

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