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

Method setFile

plugins/Cardinal/src/ImGuiTextEditor.cpp:54–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52// --------------------------------------------------------------------------------------------------------------------
53
54bool ImGuiTextEditor::setFile(const std::string& file)
55{
56 std::ifstream f(file);
57
58 if (! f.good())
59 {
60 pData->file.clear();
61 return false;
62 }
63
64 pData->file = file;
65 pData->editor.SetText(std::string((std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>()));
66 return true;
67}
68
69void ImGuiTextEditor::setFileWithKnownText(const std::string& file, const std::string& text)
70{

Callers

nothing calls this directly

Calls 2

SetTextMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected