0f8a29fdb9
Co-authored-by: nerix <nerixdev@outlook.de>
24 lines
516 B
C++
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
|