2017-04-04 05:47:30 +08:00
|
|
|
#include "pch.h"
|
2017-04-28 09:08:52 +08:00
|
|
|
|
2017-04-04 05:47:30 +08:00
|
|
|
#include "PackageSpecParseResult.h"
|
2017-04-28 09:08:52 +08:00
|
|
|
#include "vcpkg_Checks.h"
|
2017-04-04 05:47:30 +08:00
|
|
|
|
|
|
|
namespace vcpkg
|
|
|
|
{
|
2017-06-06 06:58:47 +08:00
|
|
|
CStringView to_string(PackageSpecParseResult ev) noexcept
|
2017-04-04 05:47:30 +08:00
|
|
|
{
|
2017-06-06 06:58:47 +08:00
|
|
|
switch (ev)
|
2017-04-04 05:47:30 +08:00
|
|
|
{
|
2017-04-28 09:08:52 +08:00
|
|
|
case PackageSpecParseResult::SUCCESS: return "OK";
|
|
|
|
case PackageSpecParseResult::TOO_MANY_COLONS: return "Too many colons";
|
2017-04-04 05:47:30 +08:00
|
|
|
case PackageSpecParseResult::INVALID_CHARACTERS:
|
2017-04-28 09:08:52 +08:00
|
|
|
return "Contains invalid characters. Only alphanumeric lowercase ASCII characters and dashes are "
|
|
|
|
"allowed";
|
|
|
|
default: Checks::unreachable(VCPKG_LINE_INFO);
|
2017-04-04 05:47:30 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|