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

Side by Side Diff: base/files/file_path.cc

Issue 2778183003: Make base::FilePath move constructor and assignment noexcept. (Closed)
Patch Set: Just move constructor Created 3 years, 8 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
« no previous file with comments | « base/files/file_path.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) 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 #include "base/files/file_path.h" 5 #include "base/files/file_path.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 #include <algorithm> 8 #include <algorithm>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 return false; 167 return false;
168 } 168 }
169 169
170 } // namespace 170 } // namespace
171 171
172 FilePath::FilePath() { 172 FilePath::FilePath() {
173 } 173 }
174 174
175 FilePath::FilePath(const FilePath& that) : path_(that.path_) { 175 FilePath::FilePath(const FilePath& that) : path_(that.path_) {
176 } 176 }
177 FilePath::FilePath(FilePath&& that) = default; 177 FilePath::FilePath(FilePath&& that) noexcept = default;
178 178
179 FilePath::FilePath(StringPieceType path) { 179 FilePath::FilePath(StringPieceType path) {
180 path.CopyToString(&path_); 180 path.CopyToString(&path_);
181 StringType::size_type nul_pos = path_.find(kStringTerminator); 181 StringType::size_type nul_pos = path_.find(kStringTerminator);
182 if (nul_pos != StringType::npos) 182 if (nul_pos != StringType::npos)
183 path_.erase(nul_pos, StringType::npos); 183 path_.erase(nul_pos, StringType::npos);
184 } 184 }
185 185
186 FilePath::~FilePath() { 186 FilePath::~FilePath() {
187 } 187 }
(...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after
1336 #endif 1336 #endif
1337 } 1337 }
1338 1338
1339 #if defined(OS_ANDROID) 1339 #if defined(OS_ANDROID)
1340 bool FilePath::IsContentUri() const { 1340 bool FilePath::IsContentUri() const {
1341 return StartsWith(path_, "content://", base::CompareCase::INSENSITIVE_ASCII); 1341 return StartsWith(path_, "content://", base::CompareCase::INSENSITIVE_ASCII);
1342 } 1342 }
1343 #endif 1343 #endif
1344 1344
1345 } // namespace base 1345 } // namespace base
OLDNEW
« no previous file with comments | « base/files/file_path.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698