24#include <TextEditor.h>
79 void setDocument(
const std::string& path,
const std::string& text);
82 void document(std::string& path, std::string& text)
const;
Main application class for the C/C++ editor backend.
Definition undoAppCpp.hpp:37
void shutdown()
Shutdown the C/C++ editor.
void renameFileTo(const std::string &path)
Record that the file this editor holds has moved on disk.
std::vector< std::string > m_outputLines
Definition undoAppCpp.hpp:103
void saveFile()
Write the editor's current text back to m_currentFilePath.
std::string getLanguageLabel(const std::string &path) const
Get the language label based on file extension.
bool hasUnsavedChanges() const
Whether the text on screen differs from the file on disk.
Definition undoAppCpp.hpp:91
void openFile(const std::string &path)
Open a file and load it into the editor.
void document(std::string &path, std::string &text) const
The editor's text and the file it belongs to.
void setDocument(const std::string &path, const std::string &text)
Put what is on screen back into an editor, under a new file name.
void closeFile()
Clear the editor and forget the current file.
std::unique_ptr< TextEditor > m_editor
Definition undoAppCpp.hpp:102
bool m_isDirty
Editor text differs from the file on disk.
Definition undoAppCpp.hpp:104
void renderEditorPanel()
Render the editor inside the unified "Editor" ImGui window.
static CppApp & getInstance()
Get the singleton instance of CppApp.
void setupEditor()
(Re)create the TextEditor widget with C++ language definition
bool initialize()
Initialize the C/C++ editor (idempotent)
std::string m_currentFilePath
Definition undoAppCpp.hpp:101
bool m_initialized
Definition undoAppCpp.hpp:100
Definition undoAppCpp.hpp:26