![]() |
HAL
|
#include <grouping_color_serializer.h>
Public Member Functions | |
GroupingColorSerializer () | |
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 (GroupingTableModel *gtm) |
![]() | |
ProjectSerializer (const std::string &name) | |
virtual | ~ProjectSerializer () |
Additional Inherited Members | |
![]() | |
std::string | m_name |
Definition at line 34 of file grouping_color_serializer.h.
hal::GroupingColorSerializer::GroupingColorSerializer | ( | ) |
Definition at line 20 of file grouping_color_serializer.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 64 of file grouping_color_serializer.cpp.
References hal::ProjectManager::get_filename(), hal::ProjectManager::instance(), hal::ProjectSerializer::m_name, and test_multiple::netlist.
void hal::GroupingColorSerializer::restore | ( | GroupingTableModel * | gtm | ) |
Definition at line 24 of file grouping_color_serializer.cpp.
References hal::ProjectManager::get_filename(), hal::ProjectManager::get_project_directory(), hal::ProjectManager::instance(), and hal::ProjectSerializer::m_name.
Referenced by hal::GroupingManagerWidget::GroupingManagerWidget().
|
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 32 of file grouping_color_serializer.cpp.
References QDir::absoluteFilePath(), QJsonArray::append(), hal::GroupingTableEntry::color(), QJsonDocument::Compact, QString::fromStdString(), hal::gContentManager, hal::ContentManager::getGroupingManagerWidget(), hal::GroupingManagerWidget::getModel(), hal::GroupingTableModel::groupingAt(), QColor::HexArgb, hal::GroupingTableEntry::id(), QColor::name(), test_multiple::netlist, QFile::open(), hal::GroupingTableModel::rowCount(), QJsonDocument::toJson(), QString::toStdString(), QIODevice::write(), and QIODevice::WriteOnly.