MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / dataToJson

Method dataToJson

plugins/Cardinal/src/TextEditor.cpp:64–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62#endif
63
64 json_t* dataToJson() override
65 {
66 json_t* const rootJ = json_object();
67 DISTRHO_SAFE_ASSERT_RETURN(rootJ != nullptr, nullptr);
68
69#ifndef HEADLESS
70 if (ImGuiTextEditor* const widget = widgetPtr)
71 text = widget->getText();
72#endif
73
74 json_object_set_new(rootJ, "filepath", json_string(file.c_str()));
75 json_object_set_new(rootJ, "lang", json_string(lang.c_str()));
76 json_object_set_new(rootJ, "etext", json_string(text.c_str()));
77 json_object_set_new(rootJ, "width", json_integer(width));
78 return rootJ;
79 }
80
81 void process(const ProcessArgs&) override
82 {}

Callers

nothing calls this directly

Calls 5

json_objectFunction · 0.85
json_object_set_newFunction · 0.85
json_integerFunction · 0.85
getTextMethod · 0.80
c_strMethod · 0.80

Tested by

no test coverage detected