1 | // $Id: Alias.cc 519 2007-12-23 20:14:50Z jari $ |
---|
2 | |
---|
3 | /* |
---|
4 | Copyright (C) 2007 Peter Johansson |
---|
5 | |
---|
6 | This file is part of svndigest, http://trac.thep.lu.se/svndigest |
---|
7 | |
---|
8 | svndigest is free software; you can redistribute it and/or modify it |
---|
9 | under the terms of the GNU General Public License as published by |
---|
10 | the Free Software Foundation; either version 2 of the License, or |
---|
11 | (at your option) any later version. |
---|
12 | |
---|
13 | svndigest is distributed in the hope that it will be useful, but |
---|
14 | WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
16 | General Public License for more details. |
---|
17 | |
---|
18 | You should have received a copy of the GNU General Public License |
---|
19 | along with this program; if not, write to the Free Software |
---|
20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
---|
21 | 02111-1307, USA. |
---|
22 | */ |
---|
23 | |
---|
24 | #include "Alias.h" |
---|
25 | |
---|
26 | #include <string> |
---|
27 | |
---|
28 | namespace theplu{ |
---|
29 | namespace svndigest{ |
---|
30 | |
---|
31 | Alias::Alias(void) |
---|
32 | : name_(std::string()), id_(0) |
---|
33 | {} |
---|
34 | |
---|
35 | |
---|
36 | Alias::Alias(std::string name, size_t id) |
---|
37 | : name_(name), id_(id) |
---|
38 | {} |
---|
39 | |
---|
40 | |
---|
41 | std::string Alias::name(void) const |
---|
42 | { |
---|
43 | return name_; |
---|
44 | } |
---|
45 | |
---|
46 | |
---|
47 | size_t Alias::id(void) const |
---|
48 | { |
---|
49 | return id_; |
---|
50 | } |
---|
51 | |
---|
52 | bool operator<(const Alias& lhs, const Alias& rhs) |
---|
53 | { |
---|
54 | return lhs.name() < rhs.name(); |
---|
55 | } |
---|
56 | |
---|
57 | |
---|
58 | bool operator==(const Alias& lhs, const Alias& rhs) |
---|
59 | { |
---|
60 | return lhs.name() == rhs.name(); |
---|
61 | } |
---|
62 | |
---|
63 | }} // end of namespace svndigest and namespace theplu |
---|