OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_VERSION_H_ | 5 #ifndef BASE_VERSION_H_ |
6 #define BASE_VERSION_H_ | 6 #define BASE_VERSION_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/base_api.h" | 12 #include "base/base_export.h" |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
15 | 15 |
16 // Version represents a dotted version number, like "1.2.3.4", supporting | 16 // Version represents a dotted version number, like "1.2.3.4", supporting |
17 // parsing and comparison. | 17 // parsing and comparison. |
18 class BASE_API Version { | 18 class BASE_EXPORT Version { |
19 public: | 19 public: |
20 // The only thing you can legally do to a default constructed | 20 // The only thing you can legally do to a default constructed |
21 // Version object is assign to it. | 21 // Version object is assign to it. |
22 Version(); | 22 Version(); |
23 | 23 |
24 ~Version(); | 24 ~Version(); |
25 | 25 |
26 // Initializes from a decimal dotted version number, like "0.1.1". | 26 // Initializes from a decimal dotted version number, like "0.1.1". |
27 // Each component is limited to a uint16. Call IsValid() to learn | 27 // Each component is limited to a uint16. Call IsValid() to learn |
28 // the outcome. | 28 // the outcome. |
(...skipping 25 matching lines...) Expand all Loading... |
54 // Return the string representation of this version. | 54 // Return the string representation of this version. |
55 const std::string GetString() const; | 55 const std::string GetString() const; |
56 | 56 |
57 const std::vector<uint16>& components() const { return components_; } | 57 const std::vector<uint16>& components() const { return components_; } |
58 | 58 |
59 private: | 59 private: |
60 std::vector<uint16> components_; | 60 std::vector<uint16> components_; |
61 }; | 61 }; |
62 | 62 |
63 #endif // BASE_VERSION_H_ | 63 #endif // BASE_VERSION_H_ |
OLD | NEW |