// clang-format off
// DO NOT EDIT: this file is auto-generated by caf-generate-enum-strings.
// Run the target update-enum-strings if this file is out of sync.
#include "caf/config.hpp"
#include "caf/string_view.hpp"

CAF_PUSH_DEPRECATED_WARNING

#include "caf/stream_priority.hpp"

#include <string>

namespace caf {

std::string to_string(stream_priority x) {
  switch(x) {
    default:
      return "???";
    case stream_priority::very_high:
      return "very_high";
    case stream_priority::high:
      return "high";
    case stream_priority::normal:
      return "normal";
    case stream_priority::low:
      return "low";
    case stream_priority::very_low:
      return "very_low";
  };
}

bool from_string(string_view in, stream_priority& out) {
  if (in == "very_high") {
    out = stream_priority::very_high;
    return true;
  } else if (in == "high") {
    out = stream_priority::high;
    return true;
  } else if (in == "normal") {
    out = stream_priority::normal;
    return true;
  } else if (in == "low") {
    out = stream_priority::low;
    return true;
  } else if (in == "very_low") {
    out = stream_priority::very_low;
    return true;
  } else {
    return false;
  }
}

bool from_integer(std::underlying_type_t<stream_priority> in,
                  stream_priority& out) {
  auto result = static_cast<stream_priority>(in);
  switch(result) {
    default:
      return false;
    case stream_priority::very_high:
    case stream_priority::high:
    case stream_priority::normal:
    case stream_priority::low:
    case stream_priority::very_low:
      out = result;
      return true;
  };
}

} // namespace caf

CAF_POP_WARNINGS
