Files
chatterino2/lib/twitch-eventsub-ws/src/string.cpp
2025-02-02 16:03:24 +00:00

24 lines
516 B
C++

#include "twitch-eventsub-ws/string.hpp"
#include <boost/json.hpp>
#include <QString>
#include <string>
namespace chatterino::eventsub::lib {
boost::json::result_for<String, boost::json::value>::type tag_invoke(
boost::json::try_value_to_tag<String> /*tag*/,
const boost::json::value &jvRoot)
{
auto v = boost::json::try_value_to<std::string>(jvRoot);
if (v.has_error())
{
return v.error();
}
return String(std::move(v.value()));
}
} // namespace chatterino::eventsub::lib