![]() |
HAL
|
#include <module_color_manager.h>
Public Member Functions | |
ModuleColorSerializer () | |
std::string | serialize (Netlist *netlist, const std::filesystem::path &savedir, bool isAutosave) override |
void | deserialize (Netlist *netlist, const std::filesystem::path &loaddir) override |
void | restore (ModuleColorManager *mcm) |
![]() | |
ProjectSerializer (const std::string &name) | |
virtual | ~ProjectSerializer () |
Additional Inherited Members | |
![]() | |
std::string | m_name |
Persist module color settings to file and restore module color assignment from previous session
Definition at line 112 of file module_color_manager.h.
hal::ModuleColorSerializer::ModuleColorSerializer | ( | ) |
Definition at line 72 of file module_color_manager.cpp.
|
overridevirtual |
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 121 of file module_color_manager.cpp.
References hal::ProjectManager::get_filename(), hal::ProjectManager::instance(), hal::ProjectSerializer::m_name, and test_multiple::netlist.
void hal::ModuleColorSerializer::restore | ( | ModuleColorManager * | mcm | ) |
Definition at line 76 of file module_color_manager.cpp.
References hal::ProjectManager::get_filename(), hal::ProjectManager::get_project_directory(), hal::ProjectManager::instance(), and hal::ProjectSerializer::m_name.
Referenced by hal::NetlistRelay::debugHandleFileOpened().
|
overridevirtual |
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 97 of file module_color_manager.cpp.
References QDir::absoluteFilePath(), QJsonDocument::Compact, QString::fromStdString(), hal::NetlistRelay::getModuleColorManager(), hal::gNetlistRelay, test_multiple::netlist, QFile::open(), QString::toStdString(), QIODevice::write(), and QIODevice::WriteOnly.