OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <iosfwd> | 10 #include <iosfwd> |
(...skipping 14 matching lines...) Expand all Loading... | |
25 | 25 |
26 Version(const Version& other); | 26 Version(const Version& other); |
27 | 27 |
28 ~Version(); | 28 ~Version(); |
29 | 29 |
30 // Initializes from a decimal dotted version number, like "0.1.1". | 30 // Initializes from a decimal dotted version number, like "0.1.1". |
31 // Each component is limited to a uint16_t. Call IsValid() to learn | 31 // Each component is limited to a uint16_t. Call IsValid() to learn |
32 // the outcome. | 32 // the outcome. |
33 explicit Version(const std::string& version_str); | 33 explicit Version(const std::string& version_str); |
34 | 34 |
35 explicit Version(std::vector<uint32_t>&& components); | |
danakj
2016/07/19 19:59:27
this should come with an operator=.
This also del
Alex Z.
2016/07/19 20:46:13
Done.
A copy constructor is explicitly defined (an
danakj
2016/07/19 20:50:07
Oh, there it is. Can you reorder this so that all
| |
36 | |
35 // Returns true if the object contains a valid version number. | 37 // Returns true if the object contains a valid version number. |
36 bool IsValid() const; | 38 bool IsValid() const; |
37 | 39 |
38 // Returns true if the version wildcard string is valid. The version wildcard | 40 // Returns true if the version wildcard string is valid. The version wildcard |
39 // string may end with ".*" (e.g. 1.2.*, 1.*). Any other arrangement with "*" | 41 // string may end with ".*" (e.g. 1.2.*, 1.*). Any other arrangement with "*" |
40 // is invalid (e.g. 1.*.3 or 1.2.3*). This functions defaults to standard | 42 // is invalid (e.g. 1.*.3 or 1.2.3*). This functions defaults to standard |
41 // Version behavior (IsValid) if no wildcard is present. | 43 // Version behavior (IsValid) if no wildcard is present. |
42 static bool IsValidWildcardString(const std::string& wildcard_string); | 44 static bool IsValidWildcardString(const std::string& wildcard_string); |
43 | 45 |
44 // Returns -1, 0, 1 for <, ==, >. | 46 // Returns -1, 0, 1 for <, ==, >. |
(...skipping 22 matching lines...) Expand all Loading... | |
67 BASE_EXPORT bool operator>=(const Version& v1, const Version& v2); | 69 BASE_EXPORT bool operator>=(const Version& v1, const Version& v2); |
68 BASE_EXPORT std::ostream& operator<<(std::ostream& stream, const Version& v); | 70 BASE_EXPORT std::ostream& operator<<(std::ostream& stream, const Version& v); |
69 | 71 |
70 } // namespace base | 72 } // namespace base |
71 | 73 |
72 // TODO(xhwang) remove this when all users are updated to explicitly use the | 74 // TODO(xhwang) remove this when all users are updated to explicitly use the |
73 // namespace | 75 // namespace |
74 using base::Version; | 76 using base::Version; |
75 | 77 |
76 #endif // BASE_VERSION_H_ | 78 #endif // BASE_VERSION_H_ |
OLD | NEW |