// 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/invoke_message_result.hpp"

#include <string>

namespace caf {

std::string to_string(invoke_message_result x) {
  switch(x) {
    default:
      return "???";
    case invoke_message_result::consumed:
      return "consumed";
    case invoke_message_result::skipped:
      return "skipped";
    case invoke_message_result::dropped:
      return "dropped";
  };
}

bool from_string(string_view in, invoke_message_result& out) {
  if (in == "consumed") {
    out = invoke_message_result::consumed;
    return true;
  } else if (in == "skipped") {
    out = invoke_message_result::skipped;
    return true;
  } else if (in == "dropped") {
    out = invoke_message_result::dropped;
    return true;
  } else {
    return false;
  }
}

bool from_integer(std::underlying_type_t<invoke_message_result> in,
                  invoke_message_result& out) {
  auto result = static_cast<invoke_message_result>(in);
  switch(result) {
    default:
      return false;
    case invoke_message_result::consumed:
    case invoke_message_result::skipped:
    case invoke_message_result::dropped:
      out = result;
      return true;
  };
}

} // namespace caf

CAF_POP_WARNINGS
