29 lines
716 B
C++
29 lines
716 B
C++
/**
|
|
* @file Status.cpp
|
|
* @brief toString(Status) -- one switch, kept in sync with Status.hpp by -Wswitch.
|
|
*/
|
|
#include "hot_reload/Status.hpp"
|
|
|
|
namespace hot_reload
|
|
{
|
|
|
|
std::string_view toString(Status status) noexcept
|
|
{
|
|
switch (status)
|
|
{
|
|
case Status::Ok:
|
|
return "ok";
|
|
case Status::InvalidArgument:
|
|
return "invalid argument";
|
|
case Status::LoadFailed:
|
|
return "load failed";
|
|
case Status::NoPreviousVersion:
|
|
return "no previous version loaded for this module name";
|
|
case Status::UnsupportedArchitecture:
|
|
return "no patch backend for this CPU architecture";
|
|
}
|
|
return "unknown hot reload status"; // unreachable for any enumerator; -Wswitch catches a missing one above
|
|
}
|
|
|
|
}
|