#include "PathUtils.h"


std::string PathUtils::getBaseFilename(const Path& path)
{
    return path.stem().string();
}

Path PathUtils::getRelativePath(const Path& input, const Path& relativeTo)
{
    return std::filesystem::relative(input, relativeTo);
}

std::string PathUtils::getPathDelimited(const Path& path, char delimiter)
{
    std::string name;

    unsigned count = 0;
    for(const auto& element : path)
    {
        if (count == 0)
        {
            name += element.stem().string();
        }
        else
        {
            name += delimiter + element.stem().string();
        }
        count++;
    }

    return name;
}
