source: trunk/lib/Alias.h @ 389

Last change on this file since 389 was 303, checked in by Peter Johansson, 14 years ago

Sorting authors in copyright statement in same order as stated in config file. fixes #172

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.8 KB
Line 
1#ifndef _theplu_svndigest_alias_
2#define _theplu_svndigest_alias_
3
4// $Id: Alias.h 303 2007-05-11 20:13:00Z peter $
5
6/*
7  Copyright (C) 2007 Peter Johansson
8
9  This file is part of svndigest, http://lev.thep.lu.se/trac/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 2 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 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
27#include "Node.h"
28
29#include <string>
30
31namespace theplu{
32namespace svndigest{
33
34  ///
35  /// @brief Class holding a copyright alias
36  ///
37  class Alias
38  {
39  public:
40    ///
41    /// @brief default constructor
42    ///
43    Alias(void); // to allow stl::container
44
45    ///
46    /// \brief Constructor
47    ///
48    Alias(std::string alias, size_t id);
49   
50    ///
51    /// @return name
52    ///
53    std::string name(void) const;
54
55    ///
56    /// @return id
57    ///
58    size_t id(void) const;
59
60  private:
61    //Alias& Alias(const Alias&) using compiler generated copy ctor
62    //Alias& operator=(const Alias&) using compiler generated operator
63   
64    std::string name_;
65    size_t id_;
66  };
67
68  bool operator<(const Alias& lhs, const Alias& rhs);
69  bool operator==(const Alias& lhs, const Alias& rhs);
70
71
72  ///
73  /// @brief Functor to compare using Id
74  ///
75  struct IdCompare
76  {
77    inline bool operator()(const Alias& lhs, const Alias& rhs) const
78    { return lhs.id()<rhs.id(); }
79  };
80
81
82}} // end of namespace svndigest and namespace theplu
83
84#endif
85
86
Note: See TracBrowser for help on using the repository browser.