Files
Bigfoot/Bigfoot/Sources/System/File.cpp
Romain BOULLARD 6cd9801ef7
Some checks failed
Bigfoot / Build & Test Debug (Unity Build: ON) (push) Has been cancelled
Bigfoot / Build & Test RelWithDebInfo (Unity Build: OFF) (push) Has been cancelled
Bigfoot / Build & Test RelWithDebInfo (Unity Build: ON) (push) Has been cancelled
Bigfoot / Build & Test Release (Unity Build: OFF) (push) Has been cancelled
Bigfoot / Build & Test Release (Unity Build: ON) (push) Has been cancelled
Bigfoot / Build & Test Debug (Unity Build: OFF) (push) Has been cancelled
GiteaCI (#1)
Reviewed-on: #1
Co-authored-by: Romain BOULLARD <romain.boullard@protonmail.com>
Co-committed-by: Romain BOULLARD <romain.boullard@protonmail.com>
2026-01-28 14:29:12 +00:00

67 lines
1.6 KiB
C++

/*********************************************************************
* \file File.cpp
*
* \author Romain BOULLARD
* \date December 2025
*********************************************************************/
#include <System/File.hpp>
namespace Bigfoot
{
File::File(const eastl::string_view p_path):
m_path(p_path.data()),
m_pathString(p_path)
{
}
/****************************************************************************************/
bool File::IsAbsolute() const
{
return m_path.is_absolute();
}
/****************************************************************************************/
bool File::IsRelative() const
{
return m_path.is_relative();
}
/****************************************************************************************/
bool File::Exists() const
{
return std::filesystem::exists(m_path);
}
/****************************************************************************************/
eastl::string_view File::Path() const
{
return m_pathString;
}
/****************************************************************************************/
File File::Absolute() const
{
return File {std::filesystem::absolute(m_path)};
}
/****************************************************************************************/
File File::Relative() const
{
return File {std::filesystem::relative(m_path)};
}
/****************************************************************************************/
File::File(const std::filesystem::path& p_path):
m_path(p_path),
m_pathString(m_path.string().c_str())
{
}
} // namespace Bigfoot