mpd/src/fs/Path2.cxx

32 lines
628 B
C++
Raw Normal View History

// SPDX-License-Identifier: GPL-2.0-or-later
// Copyright The Music Player Daemon Project
#include "Path.hxx"
#include "AllocatedPath.hxx"
AllocatedPath
Path::GetDirectoryName() const noexcept
{
return AllocatedPath::FromFS(PathTraitsFS::GetParent(c_str()));
}
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);
}
AllocatedPath
operator/(Path a, Path b) noexcept
{
return AllocatedPath::Build(a, b);
}