#include "package_path.h"
#include "asset/file_manager.h"
namespace engineapi {
	PackagePath PackagePath::ToSuffixPath(const string_view& suffix)const
	{
		string_view name = ParsePackage();
		if(name.empty() || suffix.empty())
			return *this;
		string suffixPath;
		suffixPath.reserve(path.size() + suffix.size());
		suffixPath.append(name);
		suffixPath.append(suffix);
		suffixPath.append(path.substr(name.size()));
		return PackagePath{FileManager::FindPathView(suffixPath)};
	}
	PackagePath PackagePath::SafePath()const
	{
		return PackagePath{ FileManager::FindPathView(path) };
	}
	string PackagePath::RealPath() const
	{
		return FileManager::RealPath(*this);
	}
}

