| 52 | // -------------------------------------------------------------------------------------------------------------------- |
| 53 | |
| 54 | bool 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 | |
| 69 | void ImGuiTextEditor::setFileWithKnownText(const std::string& file, const std::string& text) |
| 70 | { |