Commit | Line | Data |
---|---|---|
d44e3c4f | 1 | /****************************************************************************** |
2 | * Copyright (c) 2000-2016 Ericsson Telecom AB | |
3 | * All rights reserved. This program and the accompanying materials | |
4 | * are made available under the terms of the Eclipse Public License v1.0 | |
5 | * which accompanies this distribution, and is available at | |
6 | * http://www.eclipse.org/legal/epl-v10.html | |
7 | * | |
8 | * Contributors: | |
9 | * | |
10 | * Balasko, Jeno | |
11 | * | |
12 | ******************************************************************************/ | |
970ed795 EL |
13 | #undef new |
14 | ||
15 | #include <new> | |
16 | #include <sstream> | |
17 | #include "ModuleVersion.hh" | |
18 | #include "dbgnew.hh" | |
19 | ||
20 | std::string ModuleVersion::toString() const { | |
21 | std::stringstream stream; | |
22 | const char separator = ' '; | |
23 | if (!productNumber.empty()) { | |
24 | stream << productNumber; | |
25 | } | |
26 | ||
27 | if (suffix != 0) { | |
28 | stream << "/" << suffix; | |
29 | } | |
30 | if (release != 0) { | |
31 | stream << separator << 'R' << release << separator | |
32 | << (char)('A' + patch); | |
33 | } | |
34 | if (build != 0) { | |
35 | stream << separator << build; | |
36 | } | |
37 | ||
38 | if (!extra.empty()) { | |
39 | stream << extra; | |
40 | } | |
41 | return stream.str(); | |
42 | } | |
43 | ||
44 | bool ModuleVersion::operator<(const ModuleVersion& other) const{ | |
45 | return productNumber < other.productNumber | |
46 | && suffix < other.suffix | |
47 | && build < other.build | |
48 | && extra < other.extra; | |
49 | } |