diff --git a/doomsday/sdk/libcore/include/de/data/path.h b/doomsday/sdk/libcore/include/de/data/path.h index a3a073da28..5a840c051f 100644 --- a/doomsday/sdk/libcore/include/de/data/path.h +++ b/doomsday/sdk/libcore/include/de/data/path.h @@ -472,7 +472,35 @@ class DENG2_PUBLIC DotPath : public Path DotPath(QString const &str) : Path(str, '.') {} DotPath(char const *nullTerminatedCStr) : Path(nullTerminatedCStr, '.') {} DotPath(Path const &other) : Path(other) {} + DotPath(Path &&moved) : Path(moved) {} DotPath(DotPath const &other) : Path(other.toStringRef(), other.separator()) {} + DotPath(DotPath &&moved) : Path(moved) {} + + DotPath &operator = (char const *nullTerminatedCStr) { + return *this = DotPath(nullTerminatedCStr); + } + DotPath &operator = (String const &str) { + return *this = DotPath(str); + } + DotPath &operator = (QString const &str) { + return *this = DotPath(str); + } + DotPath &operator = (Path const &other) { + Path::operator = (other); + return *this; + } + DotPath &operator = (DotPath const &other) { + Path::operator = (other); + return *this; + } + DotPath &operator = (Path &&moved) { + Path::operator = (moved); + return *this; + } + DotPath &operator = (DotPath &&moved) { + Path::operator = (moved); + return *this; + } bool operator == (DotPath const &other) const { return Path::operator == (other); diff --git a/doomsday/sdk/libcore/include/de/filesys/nativepath.h b/doomsday/sdk/libcore/include/de/filesys/nativepath.h index b23e99f1f8..df355bfac5 100644 --- a/doomsday/sdk/libcore/include/de/filesys/nativepath.h +++ b/doomsday/sdk/libcore/include/de/filesys/nativepath.h @@ -51,6 +51,9 @@ class DENG2_PUBLIC NativePath : public Path */ NativePath(); + NativePath(NativePath const &other); + NativePath(NativePath &&moved); + /** * Constructs a native path from any string. * @@ -72,6 +75,8 @@ class DENG2_PUBLIC NativePath : public Path NativePath &operator = (String const &str); NativePath &operator = (QString const &str); + NativePath &operator = (NativePath &&moved); + NativePath &operator = (NativePath const &other); NativePath &operator = (char const *nullTerminatedCStr); /** diff --git a/doomsday/sdk/libcore/src/filesys/nativepath.cpp b/doomsday/sdk/libcore/src/filesys/nativepath.cpp index 838904c439..de82db91ba 100644 --- a/doomsday/sdk/libcore/src/filesys/nativepath.cpp +++ b/doomsday/sdk/libcore/src/filesys/nativepath.cpp @@ -65,6 +65,14 @@ static QString toNative(String const &s) NativePath::NativePath() : Path() {} +NativePath::NativePath(NativePath const &other) + : Path(other) +{} + +NativePath::NativePath(NativePath &&moved) + : Path(moved) +{} + NativePath::NativePath(String const &str) : Path(toNative(str), DIR_SEPARATOR) {} @@ -91,6 +99,18 @@ NativePath &NativePath::operator = (QString const &str) return *this; } +NativePath &NativePath::operator = (NativePath &&moved) +{ + Path::operator = (moved); + return *this; +} + +NativePath &NativePath::operator = (NativePath const &other) +{ + Path::operator = (other); + return *this; +} + NativePath &NativePath::operator = (char const *nullTerminatedCStr) { return (*this) = String(nullTerminatedCStr);