2023-03-06 14:42:04 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
// Copyright The Music Player Daemon Project
|
2014-12-02 06:44:57 +01:00
|
|
|
|
|
|
|
#include "Path.hxx"
|
|
|
|
#include "AllocatedPath.hxx"
|
|
|
|
|
|
|
|
AllocatedPath
|
2017-05-08 14:44:49 +02:00
|
|
|
Path::GetDirectoryName() const noexcept
|
2014-12-02 06:44:57 +01:00
|
|
|
{
|
|
|
|
return AllocatedPath::FromFS(PathTraitsFS::GetParent(c_str()));
|
|
|
|
}
|
2018-07-17 17:01:02 +02:00
|
|
|
|
2022-07-14 15:59:55 +02:00
|
|
|
AllocatedPath
|
|
|
|
Path::WithSuffix(const_pointer new_suffix) const noexcept
|
|
|
|
{
|
|
|
|
AllocatedPath result{*this};
|
|
|
|
result.SetSuffix(new_suffix);
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2022-07-14 18:36:22 +02:00
|
|
|
AllocatedPath
|
|
|
|
operator+(Path a, PathTraitsFS::string_view b) noexcept
|
|
|
|
{
|
|
|
|
return AllocatedPath::Concat(a.c_str(), b);
|
|
|
|
}
|
|
|
|
|
2018-07-17 17:01:02 +02:00
|
|
|
AllocatedPath
|
|
|
|
operator/(Path a, Path b) noexcept
|
|
|
|
{
|
|
|
|
return AllocatedPath::Build(a, b);
|
|
|
|
}
|