source: trunk/lib/SVNproperty.cc @ 1267

Last change on this file since 1267 was 1267, checked in by Peter Johansson, 11 years ago

updating copyright statements

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.0 KB
Line 
1// $Id: SVNproperty.cc 1267 2010-11-02 03:56:19Z peter $
2
3/*
4  Copyright (C) 2006 Jari Häkkinen
5  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
6  Copyright (C) 2010 Peter Johansson
7
8  This file is part of svndigest, http://dev.thep.lu.se/svndigest
9
10  svndigest is free software; you can redistribute it and/or modify it
11  under the terms of the GNU General Public License as published by
12  the Free Software Foundation; either version 3 of the License, or
13  (at your option) any later version.
14
15  svndigest is distributed in the hope that it will be useful, but
16  WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  General Public License for more details.
19
20  You should have received a copy of the GNU General Public License
21  along with svndigest. If not, see <http://www.gnu.org/licenses/>.
22*/
23
24#include "SVNproperty.h"
25
26#include "Configuration.h"
27#include "SVN.h"
28#include "utility.h"
29
30#include <string>
31
32namespace theplu {
33namespace svndigest {
34
35
36  SVNproperty::SVNproperty(const std::string& path)
37    : binary_(false), svndigest_ignore_(false)
38  {
39    SVN::instance()->client_proplist(path, property_);
40
41    const Configuration& config = Configuration::instance();
42    typedef std::map<std::string, std::string> str_map;
43    const str_map& props = config.svn_properties(file_name(path));
44    std::map<std::string, std::string>::const_iterator i = props.begin();
45    std::map<std::string, std::string>::const_iterator e = props.end();
46    // we can not use map::insert because we want config to have precedence
47    for ( ; i!=e; ++i)
48      property_[i->first] = i->second;
49   
50    i = property_.begin();
51    e = property_.end();
52    for ( ; i!=e ; ++i)
53      if (i->first == "svndigest:ignore")
54        svndigest_ignore_=true;
55      else
56        if ((i->first == "svn:mime-type") &&
57            (svn_mime_type_is_binary(i->second.c_str())))
58          binary_=true;
59  }
60
61
62  bool SVNproperty::svncopyright_ignore(void) const
63  {
64    return property_.find("svncopyright:ignore") != property_.end();
65  }
66
67}} // end of namespace svndigest and namespace theplu
Note: See TracBrowser for help on using the repository browser.