source: trunk/lib/SVNproperty.h

Last change on this file was 1515, checked in by Peter Johansson, 9 years ago

update copyright years

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.0 KB
Line 
1#ifndef _theplu_svndigest_svnproperty_
2#define _theplu_svndigest_svnproperty_
3
4// $Id: SVNproperty.h 1515 2012-09-26 00:35:10Z peter $
5
6/*
7  Copyright (C) 2006 Jari Häkkinen
8  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
9  Copyright (C) 2010, 2011, 2012 Peter Johansson
10
11  This file is part of svndigest, http://dev.thep.lu.se/svndigest
12
13  svndigest is free software; you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation; either version 3 of the License, or
16  (at your option) any later version.
17
18  svndigest is distributed in the hope that it will be useful, but
19  WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21  General Public License for more details.
22
23  You should have received a copy of the GNU General Public License
24  along with svndigest. If not, see <http://www.gnu.org/licenses/>.
25*/
26
27#include "yat/SegmentSet.h"
28
29#include <subversion-1/svn_types.h>
30
31#include <map>
32#include <string>
33
34namespace theplu {
35namespace svndigest {
36
37  class SVN;
38
39  ///
40  /// The SVNproperty class is a utility class for taking care of 'svn
41  /// property' information. An 'svn property' is non-recursively
42  /// performed on an item.
43  ///
44  class SVNproperty {
45  public:
46
47    ///
48    /// @brief The contructor.
49    ///
50    /// The constructor performs an 'svn property' on \a path.
51    ///
52    explicit SVNproperty(const std::string& path);
53
54    /**
55       @brief Check whether item used to create this object is binary.
56
57       @return True if item is binary.
58    */
59    bool binary(void) const;
60
61    /**
62       @brief Check if item used to create this object has been
63       assigned property svndigest:ignore.
64
65       Currently files with property svndigest:ignore are to be
66       ignored by svndigest. It is the responsibility of the
67       statistics implementer to obey the ignore state.
68
69       @return True if item property svndigest:digest was set.
70    */
71    bool svndigest_ignore(void) const;
72    svn_revnum_t svndigest_ignore_rev(void) const;
73
74    /**
75       \return true if propert svncopyright::ignore has been set
76
77       \see svndigest_ignore
78     */
79    bool svncopyright_ignore(void) const;
80
81    /**
82       \return revs that svncopyright should ignore
83     */
84    const yat::utility::SegmentSet<svn_revnum_t>&
85    svncopyright_ignore_rev(void) const;
86
87    /**
88       @brief Get the list of properties for item used to creat this
89       SVNproperty object.
90    */
91    //const std::map<std::string, std::string>&
92    //properties(void) const { return property_; }
93
94  private:
95    ///
96    /// @brief Copy Constructor, not implemented.
97    ///
98    SVNproperty(const SVNproperty&);
99
100    void add(std::map<std::string, std::string>::const_iterator first,
101             std::map<std::string, std::string>::const_iterator last);
102
103    void add_svncopyright_ignore(const std::string& value);
104    void add_svndigest_ignore(const std::string& value);
105
106    bool binary_;
107    bool svncopyright_ignore_;
108    yat::utility::SegmentSet<svn_revnum_t> svncopyright_ignore_rev_;
109    svn_revnum_t svndigest_ignore_rev_;
110  };
111
112}} // end of namespace svndigest and namespace theplu
113
114#endif
Note: See TracBrowser for help on using the repository browser.