elna/source/result.cpp

37 lines
877 B
C++
Raw Normal View History

2024-03-07 09:15:11 +01:00
#include "elna/source/result.hpp"
#include "elna/source/types.hpp"
2024-02-22 21:29:25 +01:00
2024-03-07 09:15:11 +01:00
namespace elna::source
2024-03-03 13:11:39 +01:00
{
error::error(const std::filesystem::path& path, const position position)
: m_position(position), m_path(path)
2024-02-22 21:29:25 +01:00
{
}
2024-03-03 13:11:39 +01:00
std::size_t error::line() const noexcept
2024-02-22 21:29:25 +01:00
{
2024-03-09 08:36:07 +01:00
return this->m_position.line;
2024-02-22 21:29:25 +01:00
}
2024-03-03 13:11:39 +01:00
std::size_t error::column() const noexcept
2024-02-22 21:29:25 +01:00
{
2024-03-09 08:36:07 +01:00
return this->m_position.column;
2024-02-22 21:29:25 +01:00
}
2024-03-14 08:52:45 +01:00
const std::filesystem::path& error::path() const noexcept
{
return this->m_path;
}
name_collision::name_collision(const std::string& name, const std::filesystem::path& path,
const position current, const position previous)
: error(path, current), name(name), previous(previous)
2024-03-14 08:52:45 +01:00
{
}
std::string name_collision::what() const
{
return "Name '" + name + "' was already defined";
}
2024-03-03 13:11:39 +01:00
}