![]() |
HAL
|
#include <python_editor.h>
Public Member Functions | |
PythonSerializer () | |
std::string | serialize (Netlist *netlist, const std::filesystem::path &savedir, bool isAutosave) |
void | deserialize (Netlist *netlist, const std::filesystem::path &loaddir) |
QString | getDirectory () const |
std::string | serialize_control (const std::filesystem::path &savedir=std::filesystem::path(), bool isAutosave=false) |
![]() | |
ProjectSerializer (const std::string &name) | |
virtual | ~ProjectSerializer () |
Static Public Attributes | |
static QString | sPythonRelDir = "py" |
static std::string | sControlFileName = "pythoneditor.json" |
Additional Inherited Members | |
![]() | |
std::string | m_name |
Definition at line 61 of file python_editor.h.
hal::PythonSerializer::PythonSerializer | ( | ) |
Definition at line 41 of file python_editor.cpp.
References QString::fromStdString(), hal::ProjectDirectory::get_filename(), hal::ProjectManager::get_filename(), hal::ProjectManager::get_project_directory(), hal::ProjectManager::get_project_status(), hal::ProjectManager::instance(), hal::ProjectSerializer::m_name, and QDir::mkpath().
|
virtual |
Abstract deserialize method to be implemented by derived class. Note that it can be assumed upon calling this method that the deserialization of the netlist has been successful. Caller will provide project directory name but not the filename. The latter one can be queried from ProjectManager.
[in] | netlist | The netlist already deserialized |
[in] | loaddir | Project directory to load files from |
Implements hal::ProjectSerializer.
Definition at line 141 of file python_editor.cpp.
References hal::ProjectManager::get_filename(), hal::ProjectManager::instance(), hal::ProjectSerializer::m_name, and test_multiple::netlist.
QString hal::PythonSerializer::getDirectory | ( | ) | const |
|
virtual |
Abstract serialize method to be implemented by derived class. If there was no need for serialization or serialization failed an empty file name should be returned.
[in] | netlist | The netlist to be serialized |
[in] | savedir | Target project directory |
[in] | isAutosave | True if serialize call was issued from autosave, false otherwise |
Implements hal::ProjectSerializer.
Definition at line 58 of file python_editor.cpp.
References QDir::absolutePath(), QString::fromStdString(), hal::gContentManager, hal::ContentManager::getPythonEditorWidget(), test_multiple::netlist, hal::PythonEditor::saveAllTabs(), serialize_control(), sPythonRelDir, and QString::toStdString().
std::string hal::PythonSerializer::serialize_control | ( | const std::filesystem::path & | savedir = std::filesystem::path() , |
bool | isAutosave = false |
||
) |
Definition at line 96 of file python_editor.cpp.
References QDir::absoluteFilePath(), QDir::absolutePath(), hal::PythonEditor::autosaveFilename(), QTabWidget::count, QTabWidget::currentWidget(), QString::fromStdString(), hal::gContentManager, hal::ProjectDirectory::get_canonical_path(), hal::ProjectManager::get_project_directory(), hal::PythonEditor::getPythonEditor(), hal::ContentManager::getPythonEditorWidget(), hal::PythonCodeEditor::getRelFilename(), hal::PythonEditor::getTabWidget(), hal::ProjectManager::instance(), QString::isEmpty(), log_warning, QString::mid(), sControlFileName, QString::size(), sPythonRelDir, QString::startsWith(), QString::toStdString(), and hal::PythonEditor::unnamedFilename().
Referenced by hal::PythonEditor::saveControl(), and serialize().
|
static |
Definition at line 87 of file python_editor.h.
Referenced by serialize_control().
|
static |
Definition at line 86 of file python_editor.h.
Referenced by serialize(), and serialize_control().