MCPcopy Create free account
hub / github.com/Alexays/Waybar / parseOutputRaw

Method parseOutputRaw

src/modules/custom.cpp:222–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220}
221
222void waybar::modules::Custom::parseOutputRaw() {
223 std::istringstream output(output_.out);
224 std::string line;
225 int i = 0;
226 while (getline(output, line)) {
227 Glib::ustring validated_line = line;
228 if (!validated_line.validate()) {
229 validated_line = validated_line.make_valid();
230 }
231
232 if (i == 0) {
233 if (config_["escape"].isBool() && config_["escape"].asBool()) {
234 text_ = Glib::Markup::escape_text(validated_line);
235 tooltip_ = Glib::Markup::escape_text(validated_line);
236 } else {
237 text_ = validated_line;
238 tooltip_ = validated_line;
239 }
240 tooltip_ = validated_line;
241 class_.clear();
242 } else if (i == 1) {
243 if (config_["escape"].isBool() && config_["escape"].asBool()) {
244 tooltip_ = Glib::Markup::escape_text(validated_line);
245 } else {
246 tooltip_ = validated_line;
247 }
248 } else if (i == 2) {
249 class_.push_back(validated_line);
250 } else {
251 break;
252 }
253 i++;
254 }
255}
256
257void waybar::modules::Custom::parseOutputJson() {
258 std::istringstream output(output_.out);

Callers

nothing calls this directly

Calls 1

validateMethod · 0.45

Tested by

no test coverage detected