MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / getStringArrayHelper

Function getStringArrayHelper

plugins/twitch/channel-selection.cpp:90–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90static std::vector<std::string>
91getStringArrayHelper(const OBSDataAutoRelease &data, const std::string &value)
92{
93 std::vector<std::string> result;
94 auto jsonStr = obs_data_get_json(data);
95 if (!jsonStr) {
96 return result;
97 }
98 try {
99 auto json = nlohmann::json::parse(jsonStr);
100 auto &array = json[value];
101 if (!array.is_array()) {
102 return result;
103 }
104 for (const auto &element : array) {
105 std::string strElement = element.get<std::string>();
106 result.emplace_back(strElement);
107 }
108 } catch (const nlohmann::json::exception &) {
109 }
110 return result;
111}
112
113std::optional<ChannelLiveInfo>
114TwitchChannel::GetLiveInfo(const TwitchToken &token) const

Callers 2

GetLiveInfoMethod · 0.85
GetInfoMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected