jay/shared/result.h

30 lines
587 B
C++

// SPDX-FileCopyrightText: 2024 Yury Gubich <blue@macaw.me>
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include <map>
#include <array>
#include <string_view>
#include "definitions.h"
namespace Shared {
enum Result {
success,
forbidden,
unhandled,
error
};
typedef std::map<Result, Strings> Responses;
constexpr std::array<std::pair<Result, std::string_view>, 4> results = {{
{ success, "success" },
{ forbidden, "forbidden" },
{ unhandled, "unhandled" },
{ error, "error" },
}};
}