|
HAL
v4.5.0-83-g30c8f0afc
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
|
#include </home/runner/work/hal/hal/plugins/gui/include/gui/python/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) |
Public Member Functions inherited from hal::ProjectSerializer | |
| ProjectSerializer (const std::string &name) | |
| virtual | ~ProjectSerializer () |
Static Public Attributes | |
| static QString | sPythonRelDir = "py" |
| static std::string | sControlFileName = "pythoneditor.json" |
Additional Inherited Members | |
Protected Attributes inherited from hal::ProjectSerializer | |
| std::string | m_name |
Stores the python scripts that are open in the editor together with the project.
Definition at line 64 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(), and hal::ProjectSerializer::m_name.
| 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(), 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 93 of file python_editor.h.
Referenced by serialize_control().
|
static |
Definition at line 92 of file python_editor.h.
Referenced by serialize(), and serialize_control().