303 |
11 May 07 |
peter |
// $Id$ |
303 |
11 May 07 |
peter |
2 |
|
303 |
11 May 07 |
peter |
3 |
/* |
1635 |
30 Mar 23 |
peter |
Copyright (C) 2007 Peter Johansson |
1635 |
30 Mar 23 |
peter |
Copyright (C) 2008 Jari Häkkinen, Peter Johansson |
1635 |
30 Mar 23 |
peter |
Copyright (C) 2023 Peter Johansson |
303 |
11 May 07 |
peter |
7 |
|
687 |
04 Aug 08 |
peter |
This file is part of svndigest, http://dev.thep.lu.se/svndigest |
303 |
11 May 07 |
peter |
9 |
|
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 |
14 |
|
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 |
19 |
|
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 |
22 |
*/ |
303 |
11 May 07 |
peter |
23 |
|
1619 |
12 Mar 23 |
peter |
24 |
#include <config.h> |
1619 |
12 Mar 23 |
peter |
25 |
|
303 |
11 May 07 |
peter |
26 |
#include "Alias.h" |
303 |
11 May 07 |
peter |
27 |
|
303 |
11 May 07 |
peter |
28 |
#include <string> |
303 |
11 May 07 |
peter |
29 |
|
303 |
11 May 07 |
peter |
30 |
namespace theplu{ |
303 |
11 May 07 |
peter |
31 |
namespace svndigest{ |
303 |
11 May 07 |
peter |
32 |
|
303 |
11 May 07 |
peter |
33 |
Alias::Alias(void) |
303 |
11 May 07 |
peter |
34 |
: name_(std::string()), id_(0) |
303 |
11 May 07 |
peter |
35 |
{} |
303 |
11 May 07 |
peter |
36 |
|
303 |
11 May 07 |
peter |
37 |
|
303 |
11 May 07 |
peter |
38 |
Alias::Alias(std::string name, size_t id) |
303 |
11 May 07 |
peter |
39 |
: name_(name), id_(id) |
303 |
11 May 07 |
peter |
40 |
{} |
303 |
11 May 07 |
peter |
41 |
|
1513 |
23 Sep 12 |
peter |
42 |
|
303 |
11 May 07 |
peter |
43 |
std::string Alias::name(void) const |
303 |
11 May 07 |
peter |
44 |
{ |
303 |
11 May 07 |
peter |
45 |
return name_; |
303 |
11 May 07 |
peter |
46 |
} |
303 |
11 May 07 |
peter |
47 |
|
303 |
11 May 07 |
peter |
48 |
|
303 |
11 May 07 |
peter |
49 |
size_t Alias::id(void) const |
303 |
11 May 07 |
peter |
50 |
{ |
303 |
11 May 07 |
peter |
51 |
return id_; |
303 |
11 May 07 |
peter |
52 |
} |
303 |
11 May 07 |
peter |
53 |
|
303 |
11 May 07 |
peter |
54 |
bool operator<(const Alias& lhs, const Alias& rhs) |
1513 |
23 Sep 12 |
peter |
55 |
{ |
1513 |
23 Sep 12 |
peter |
56 |
return lhs.name() < rhs.name(); |
303 |
11 May 07 |
peter |
57 |
} |
303 |
11 May 07 |
peter |
58 |
|
303 |
11 May 07 |
peter |
59 |
|
303 |
11 May 07 |
peter |
60 |
bool operator==(const Alias& lhs, const Alias& rhs) |
1513 |
23 Sep 12 |
peter |
61 |
{ |
1513 |
23 Sep 12 |
peter |
62 |
return lhs.name() == rhs.name(); |
303 |
11 May 07 |
peter |
63 |
} |
303 |
11 May 07 |
peter |
64 |
|
303 |
11 May 07 |
peter |
65 |
}} // end of namespace svndigest and namespace theplu |