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 #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 Loading... |
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 Loading... |
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 |
OLD | NEW |