Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: base/version.cc

Issue 7131008: Clang needs dtor in the cc file (build fix) (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/version.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
Scott Hess - ex-Googler 2011/06/07 17:52:25 Sneaky. I like it.
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 "base/version.h" 5 #include "base/version.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
11 #include "base/string_split.h" 11 #include "base/string_split.h"
12 #include "base/string_util.h" 12 #include "base/string_util.h"
13 13
14 Version::Version() { 14 Version::Version() {
15 } 15 }
16 16
17 Version::~Version() {
18 }
19
17 Version::Version(const std::string& version_str) { 20 Version::Version(const std::string& version_str) {
18 std::vector<std::string> numbers; 21 std::vector<std::string> numbers;
19 base::SplitString(version_str, '.', &numbers); 22 base::SplitString(version_str, '.', &numbers);
20 if (numbers.empty()) 23 if (numbers.empty())
21 return; 24 return;
22 std::vector<uint16> parsed; 25 std::vector<uint16> parsed;
23 for (std::vector<std::string>::iterator i = numbers.begin(); 26 for (std::vector<std::string>::iterator i = numbers.begin();
24 i != numbers.end(); ++i) { 27 i != numbers.end(); ++i) {
25 int num; 28 int num;
26 if (!base::StringToInt(*i, &num)) 29 if (!base::StringToInt(*i, &num))
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 DCHECK(IsValid()); 93 DCHECK(IsValid());
91 std::string version_str; 94 std::string version_str;
92 size_t count = components_.size(); 95 size_t count = components_.size();
93 for (size_t i = 0; i < count - 1; ++i) { 96 for (size_t i = 0; i < count - 1; ++i) {
94 version_str.append(base::IntToString(components_[i])); 97 version_str.append(base::IntToString(components_[i]));
95 version_str.append("."); 98 version_str.append(".");
96 } 99 }
97 version_str.append(base::IntToString(components_[count - 1])); 100 version_str.append(base::IntToString(components_[count - 1]));
98 return version_str; 101 return version_str;
99 } 102 }
OLDNEW
« no previous file with comments | « base/version.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698