From 008bd6d3df469f69eaf667bc3ae357a03894bddb Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Sun, 25 Jun 2023 01:16:40 +1000 Subject: more!! more!!!! --- source/core/StarAssetPath.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'source/core/StarAssetPath.cpp') 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&& subPath, DirectivesGroup&& directives) { @@ -182,4 +187,19 @@ size_t hash::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; +} + } -- cgit v1.2.3