diff options
Diffstat (limited to 'source/core/StarAssetPath.cpp')
-rw-r--r-- | source/core/StarAssetPath.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/source/core/StarAssetPath.cpp b/source/core/StarAssetPath.cpp index b49f24d..82eca93 100644 --- a/source/core/StarAssetPath.cpp +++ b/source/core/StarAssetPath.cpp @@ -147,8 +147,13 @@ bool AssetPath::operator==(AssetPath const& rhs) const { return tie(basePath, subPath, directives) == tie(rhs.basePath, rhs.subPath, rhs.directives); } +AssetPath::AssetPath(const char* path) { + *this = move(AssetPath::split(path)); +} + + AssetPath::AssetPath(String const& path) { - *this = move(AssetPath::split(path)); // split code should probably be in here, but whatever + *this = move(AssetPath::split(path)); } AssetPath::AssetPath(String&& basePath, Maybe<String>&& subPath, DirectivesGroup&& directives) { @@ -182,4 +187,19 @@ size_t hash<AssetPath>::operator()(AssetPath const& s) const { return hashOf(s.basePath, s.subPath, s.directives); } +DataStream& operator>>(DataStream& ds, AssetPath& path) { + String string; + ds.read(string); + + path = move(string); + + return ds; +} + +DataStream& operator<<(DataStream& ds, AssetPath const& path) { + ds.write(AssetPath::join(path)); + + return ds; +} + } |