diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-25 01:16:40 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-25 01:16:40 +1000 |
commit | 008bd6d3df469f69eaf667bc3ae357a03894bddb (patch) | |
tree | 0aa0548dae863c727cd32fc2b0d562783c7edb4e /source/core/StarAssetPath.cpp | |
parent | 2bd399fd00d87683e37b41bfc1a25772c6cde71f (diff) |
more!! more!!!!
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; +} + } |