source: trunk/lib/Directory.h @ 661

Last change on this file since 661 was 661, checked in by Peter Johansson, 13 years ago

updating include

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.9 KB
RevLine 
[165]1#ifndef _theplu_svndigest_directory_
2#define _theplu_svndigest_directory_
3
[7]4// $Id: Directory.h 661 2008-06-12 23:29:16Z peter $
5
[84]6/*
[408]7  Copyright (C) 2005, 2006, 2007 Jari Häkkinen, Peter Johansson
[84]8
[519]9  This file is part of svndigest, http://trac.thep.lu.se/svndigest
[84]10
[149]11  svndigest is free software; you can redistribute it and/or modify it
[84]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
[149]16  svndigest is distributed in the hope that it will be useful, but
[84]17  WITHOUT ANY WARRANTY; without even the implied warranty of
[149]18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
[84]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
[4]27#include "Node.h"
28
[226]29#include <map>
[18]30#include <string>
[661]31#include <vector>
[4]32
33namespace theplu{
[149]34namespace svndigest{
[4]35
[9]36  ///
37  /// Class taking care of directories.
38  ///
39  class Directory : public Node
40  {
41  public:
[91]42
[9]43    ///
44    /// @brief Constructor
45    ///
[22]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
[18]53    /// traversed.
54    ///
[589]55    Directory(const unsigned int level, const std::string& path, 
[112]56              const std::string& output="");
[4]57
[9]58    ///
59    /// @brief Destructor
60    ///
[10]61    ~Directory(void);
[4]62
[100]63    ///
[101]64    /// @return true
65    ///
66    bool dir(void) const;
67
68    ///
[175]69    /// @return directory-name/index.html
[100]70    ///
[175]71    std::string href(void) const;
[112]72
[380]73    /**
74       @return The explicit string "directory", nothing else.
75    */
[343]76    std::string node_type(void) const;
[182]77
[343]78    /**
79       @return output path for example 'lib/File.h.html' for this file
80     */
81    std::string output_path(void) const;
82
[538]83    const StatsCollection& parse(bool verbose, bool ignore);
[9]84
[653]85    using Node::print_copyright;
86    /**
87       virtual function typically called from Node::print_copyright
88    */
89    void print_copyright(std::map<std::string, Alias>&, bool verbose,
90                         const std::map<int, svn_revnum_t>&) const;
[226]91
[9]92  private:
[452]93    /**
94       @return union of logs from daughter nodes.
95    */
96    SVNlog log_core(void) const;
97
[9]98    ///
99    /// @brief Copy Constructor, not implemented
100    ///
101    Directory(const Directory&);
102
[258]103    void print_core(bool verbose=false) const;
[207]104
[497]105    void print_core(const std::string& stats_type, const std::string& user, 
106                    const std::string& line_type, const SVNlog&) const;
[207]107
[258]108
[658]109    typedef std::vector<Node*> NodeContainer;
[91]110    typedef NodeContainer::iterator NodeIterator;
111    typedef NodeContainer::const_iterator NodeConstIterator;
112    NodeContainer daughters_;
[9]113  };
114
[149]115}} // end of namespace svndigest and namespace theplu
[7]116
117#endif
Note: See TracBrowser for help on using the repository browser.