Commit | Line | Data |
---|---|---|
970ed795 | 1 | /////////////////////////////////////////////////////////////////////////////// |
3abe9331 | 2 | // Copyright (c) 2000-2015 Ericsson Telecom AB |
970ed795 EL |
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 | #undef new | |
9 | ||
10 | #include <new> | |
11 | #include <sstream> | |
12 | #include "ModuleVersion.hh" | |
13 | #include "dbgnew.hh" | |
14 | ||
15 | std::string ModuleVersion::toString() const { | |
16 | std::stringstream stream; | |
17 | const char separator = ' '; | |
18 | if (!productNumber.empty()) { | |
19 | stream << productNumber; | |
20 | } | |
21 | ||
22 | if (suffix != 0) { | |
23 | stream << "/" << suffix; | |
24 | } | |
25 | if (release != 0) { | |
26 | stream << separator << 'R' << release << separator | |
27 | << (char)('A' + patch); | |
28 | } | |
29 | if (build != 0) { | |
30 | stream << separator << build; | |
31 | } | |
32 | ||
33 | if (!extra.empty()) { | |
34 | stream << extra; | |
35 | } | |
36 | return stream.str(); | |
37 | } | |
38 | ||
39 | bool ModuleVersion::operator<(const ModuleVersion& other) const{ | |
40 | return productNumber < other.productNumber | |
41 | && suffix < other.suffix | |
42 | && build < other.build | |
43 | && extra < other.extra; | |
44 | } |