| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "chrome/installer/util/version.h" | 8 #include "chrome/installer/util/version.h" |
| 9 | 9 |
| 10 installer::Version::Version(int64 major, int64 minor, int64 build, | 10 installer::Version::Version(int64 major, int64 minor, int64 build, |
| 11 int64 patch) : | 11 int64 patch) : |
| (...skipping 14 matching lines...) Expand all Loading... |
| 26 return ((major_ > other->major_) || | 26 return ((major_ > other->major_) || |
| 27 ((major_ == other->major_) && (minor_ > other->minor_)) || | 27 ((major_ == other->major_) && (minor_ > other->minor_)) || |
| 28 ((major_ == other->major_) && (minor_ == other->minor_) | 28 ((major_ == other->major_) && (minor_ == other->minor_) |
| 29 && (build_ > other->build_)) || | 29 && (build_ > other->build_)) || |
| 30 ((major_ == other->major_) && (minor_ == other->minor_) | 30 ((major_ == other->major_) && (minor_ == other->minor_) |
| 31 && (build_ == other->build_) | 31 && (build_ == other->build_) |
| 32 && (patch_ > other->patch_))); | 32 && (patch_ > other->patch_))); |
| 33 } | 33 } |
| 34 | 34 |
| 35 installer::Version* installer::Version::GetVersionFromString( | 35 installer::Version* installer::Version::GetVersionFromString( |
| 36 std::wstring version_str) { | 36 const std::wstring& version_str) { |
| 37 std::vector<std::wstring> numbers; | 37 std::vector<std::wstring> numbers; |
| 38 SplitString(version_str, '.', &numbers); | 38 SplitString(version_str, '.', &numbers); |
| 39 | 39 |
| 40 if (numbers.size() != 4) { | 40 if (numbers.size() != 4) { |
| 41 return NULL; | 41 return NULL; |
| 42 } | 42 } |
| 43 | 43 |
| 44 return new Version(StringToInt64(numbers[0]), StringToInt64(numbers[1]), | 44 return new Version(StringToInt64(numbers[0]), StringToInt64(numbers[1]), |
| 45 StringToInt64(numbers[2]), StringToInt64(numbers[3])); | 45 StringToInt64(numbers[2]), StringToInt64(numbers[3])); |
| 46 } | 46 } |
| OLD | NEW |