![]() |
HAL
|
#include <graph_context_serializer.h>
Public Member Functions | |
GraphContextSerializer () | |
std::string | serialize (Netlist *netlist, const std::filesystem::path &savedir, bool isAutoSave) |
void | deserialize (Netlist *netlist, const std::filesystem::path &loaddir) |
bool | restore (const std::filesystem::path &loaddir=std::filesystem::path()) |
GraphContext * | selectedContext () const |
![]() | |
ProjectSerializer (const std::string &name) | |
virtual | ~ProjectSerializer () |
Additional Inherited Members | |
![]() | |
std::string | m_name |
Definition at line 33 of file graph_context_serializer.h.
|
inline |
Definition at line 37 of file graph_context_serializer.h.
|
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 9 of file graph_context_serializer.cpp.
References test_multiple::netlist, and restore().
bool hal::GraphContextSerializer::restore | ( | const std::filesystem::path & | loaddir = std::filesystem::path() | ) |
Definition at line 15 of file graph_context_serializer.cpp.
References QString::fromStdString(), hal::ProjectManager::get_filename(), hal::ProjectManager::get_project_directory(), hal::gGraphContextManager, hal::ProjectManager::instance(), hal::ProjectSerializer::m_name, and hal::GraphContextManager::restoreFromFile().
Referenced by deserialize(), and hal::ContentManager::handleOpenDocument().
|
inline |
Definition at line 45 of file graph_context_serializer.h.
Referenced by hal::ContentManager::handleOpenDocument().
|
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 26 of file graph_context_serializer.cpp.
References QString::fromStdString(), hal::gGraphContextManager, hal::GraphContextManager::handleSaveTriggered(), and test_multiple::netlist.