303 |
11 May 07 |
peter |
1 |
#ifndef _theplu_svndigest_alias_ |
303 |
11 May 07 |
peter |
2 |
#define _theplu_svndigest_alias_ |
303 |
11 May 07 |
peter |
3 |
|
303 |
11 May 07 |
peter |
// $Id$ |
303 |
11 May 07 |
peter |
5 |
|
303 |
11 May 07 |
peter |
6 |
/* |
1635 |
30 Mar 23 |
peter |
Copyright (C) 2007 Peter Johansson |
1635 |
30 Mar 23 |
peter |
Copyright (C) 2008 Jari Häkkinen, Peter Johansson |
303 |
11 May 07 |
peter |
9 |
|
687 |
04 Aug 08 |
peter |
This file is part of svndigest, http://dev.thep.lu.se/svndigest |
303 |
11 May 07 |
peter |
11 |
|
303 |
11 May 07 |
peter |
svndigest is free software; you can redistribute it and/or modify it |
303 |
11 May 07 |
peter |
under the terms of the GNU General Public License as published by |
693 |
11 Sep 08 |
jari |
the Free Software Foundation; either version 3 of the License, or |
303 |
11 May 07 |
peter |
(at your option) any later version. |
303 |
11 May 07 |
peter |
16 |
|
303 |
11 May 07 |
peter |
svndigest is distributed in the hope that it will be useful, but |
303 |
11 May 07 |
peter |
WITHOUT ANY WARRANTY; without even the implied warranty of |
303 |
11 May 07 |
peter |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
303 |
11 May 07 |
peter |
General Public License for more details. |
303 |
11 May 07 |
peter |
21 |
|
303 |
11 May 07 |
peter |
You should have received a copy of the GNU General Public License |
693 |
11 Sep 08 |
jari |
along with svndigest. If not, see <http://www.gnu.org/licenses/>. |
303 |
11 May 07 |
peter |
24 |
*/ |
303 |
11 May 07 |
peter |
25 |
|
303 |
11 May 07 |
peter |
26 |
#include <string> |
303 |
11 May 07 |
peter |
27 |
|
303 |
11 May 07 |
peter |
28 |
namespace theplu{ |
303 |
11 May 07 |
peter |
29 |
namespace svndigest{ |
303 |
11 May 07 |
peter |
30 |
|
1513 |
23 Sep 12 |
peter |
31 |
/// |
303 |
11 May 07 |
peter |
/// @brief Class holding a copyright alias |
1513 |
23 Sep 12 |
peter |
33 |
/// |
303 |
11 May 07 |
peter |
34 |
class Alias |
303 |
11 May 07 |
peter |
35 |
{ |
303 |
11 May 07 |
peter |
36 |
public: |
303 |
11 May 07 |
peter |
37 |
/// |
303 |
11 May 07 |
peter |
/// @brief default constructor |
303 |
11 May 07 |
peter |
39 |
/// |
303 |
11 May 07 |
peter |
40 |
Alias(void); // to allow stl::container |
303 |
11 May 07 |
peter |
41 |
|
303 |
11 May 07 |
peter |
42 |
/// |
303 |
11 May 07 |
peter |
/// \brief Constructor |
303 |
11 May 07 |
peter |
44 |
/// |
303 |
11 May 07 |
peter |
45 |
Alias(std::string alias, size_t id); |
1513 |
23 Sep 12 |
peter |
46 |
|
303 |
11 May 07 |
peter |
47 |
/// |
303 |
11 May 07 |
peter |
/// @return name |
303 |
11 May 07 |
peter |
49 |
/// |
303 |
11 May 07 |
peter |
50 |
std::string name(void) const; |
303 |
11 May 07 |
peter |
51 |
|
303 |
11 May 07 |
peter |
52 |
/// |
303 |
11 May 07 |
peter |
/// @return id |
303 |
11 May 07 |
peter |
54 |
/// |
303 |
11 May 07 |
peter |
55 |
size_t id(void) const; |
303 |
11 May 07 |
peter |
56 |
|
303 |
11 May 07 |
peter |
57 |
private: |
303 |
11 May 07 |
peter |
//Alias& Alias(const Alias&) using compiler generated copy ctor |
303 |
11 May 07 |
peter |
//Alias& operator=(const Alias&) using compiler generated operator |
1513 |
23 Sep 12 |
peter |
60 |
|
303 |
11 May 07 |
peter |
61 |
std::string name_; |
303 |
11 May 07 |
peter |
62 |
size_t id_; |
303 |
11 May 07 |
peter |
63 |
}; |
303 |
11 May 07 |
peter |
64 |
|
303 |
11 May 07 |
peter |
65 |
bool operator<(const Alias& lhs, const Alias& rhs); |
303 |
11 May 07 |
peter |
66 |
bool operator==(const Alias& lhs, const Alias& rhs); |
303 |
11 May 07 |
peter |
67 |
|
303 |
11 May 07 |
peter |
68 |
|
303 |
11 May 07 |
peter |
69 |
/// |
303 |
11 May 07 |
peter |
/// @brief Functor to compare using Id |
1513 |
23 Sep 12 |
peter |
71 |
/// |
303 |
11 May 07 |
peter |
72 |
struct IdCompare |
303 |
11 May 07 |
peter |
73 |
{ |
303 |
11 May 07 |
peter |
74 |
inline bool operator()(const Alias& lhs, const Alias& rhs) const |
303 |
11 May 07 |
peter |
75 |
{ return lhs.id()<rhs.id(); } |
303 |
11 May 07 |
peter |
76 |
}; |
303 |
11 May 07 |
peter |
77 |
|
303 |
11 May 07 |
peter |
78 |
}} // end of namespace svndigest and namespace theplu |
303 |
11 May 07 |
peter |
79 |
#endif |