Commit 590f8e67 authored by dmurph's avatar dmurph Committed by Commit bot

Move constructor for base::FilePath

R=danakj@chromium.org
BUG=670043

Review-Url: https://codereview.chromium.org/2627713002
Cr-Commit-Position: refs/heads/master@{#443129}
parent 5d0bae6b
...@@ -174,6 +174,7 @@ FilePath::FilePath() { ...@@ -174,6 +174,7 @@ FilePath::FilePath() {
FilePath::FilePath(const FilePath& that) : path_(that.path_) { FilePath::FilePath(const FilePath& that) : path_(that.path_) {
} }
FilePath::FilePath(FilePath&& that) = default;
FilePath::FilePath(StringPieceType path) { FilePath::FilePath(StringPieceType path) {
path.CopyToString(&path_); path.CopyToString(&path_);
...@@ -190,6 +191,8 @@ FilePath& FilePath::operator=(const FilePath& that) { ...@@ -190,6 +191,8 @@ FilePath& FilePath::operator=(const FilePath& that) {
return *this; return *this;
} }
FilePath& FilePath::operator=(FilePath&& that) = default;
bool FilePath::operator==(const FilePath& that) const { bool FilePath::operator==(const FilePath& that) const {
#if defined(FILE_PATH_USES_DRIVE_LETTERS) #if defined(FILE_PATH_USES_DRIVE_LETTERS)
return EqualDriveLetterCaseInsensitive(this->path_, that.path_); return EqualDriveLetterCaseInsensitive(this->path_, that.path_);
......
...@@ -182,6 +182,13 @@ class BASE_EXPORT FilePath { ...@@ -182,6 +182,13 @@ class BASE_EXPORT FilePath {
~FilePath(); ~FilePath();
FilePath& operator=(const FilePath& that); FilePath& operator=(const FilePath& that);
// Constructs FilePath with the contents of |that|, which is left in valid but
// unspecified state.
FilePath(FilePath&& that);
// Replaces the contents with those of |that|, which is left in valid but
// unspecified state.
FilePath& operator=(FilePath&& that);
bool operator==(const FilePath& that) const; bool operator==(const FilePath& that) const;
bool operator!=(const FilePath& that) const; bool operator!=(const FilePath& that) const;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment