source: trunk/lib/CacheCopyer.h @ 1508

Last change on this file since 1508 was 1508, checked in by Peter Johansson, 8 years ago

fixes #521. copy svncopyright cache files as well.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.5 KB
Line 
1#ifndef _theplu_svndigest_cache_copyer_
2#define _theplu_svndigest_cache_copyer_
3
4// $Id: CacheCopyer.h 1508 2012-08-31 11:22:43Z peter $
5
6/*
7  Copyright (C) 2010 Peter Johansson
8
9  This file is part of svndigest, http://dev.thep.lu.se/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 3 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 svndigest. If not, see <http://www.gnu.org/licenses/>.
23*/
24
25#include "NodeVisitor.h"
26
27#include <string>
28
29namespace theplu{
30namespace svndigest{
31
32  class Directory;
33  class File;
34
35  /**
36     Visitor for updating copyright in files.
37  */
38  class CacheCopyer : public NodeVisitor
39  {
40  public:
41    CacheCopyer(const std::string& target, bool verbose);
42
43    /**
44       \return false if dir.ignore or dir.svncopyright_ignore
45     */
46    bool enter(Directory& dir);
47
48    /**
49       Doing nothing
50     */
51    void leave(Directory& dir);
52
53    /**
54       Updating copyright in \a file
55     */
56    void visit(File& file);
57
58  private:
59    void copy(const std::string& src, const std::string& trg_dir) const;
60
61    std::string target_;
62    bool verbose_;
63  };
64}} // end of namespace svndigest and namespace theplu
65
66#endif
Note: See TracBrowser for help on using the repository browser.