HAL  v4.5.0-133-g64838ea8d
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
hal::ActionOpenNetlistFile Class Reference

Loads a netlist. More...

#include </home/runner/work/hal/hal/plugins/gui/include/gui/user_action/action_open_netlist_file.h>

Inheritance diagram for hal::ActionOpenNetlistFile:
Inheritance graph
Collaboration diagram for hal::ActionOpenNetlistFile:
Collaboration graph

Public Types

enum  OpenMethod { Undefined , CreateNew , ImportFile , OpenProject }
 

Public Member Functions

 ActionOpenNetlistFile (OpenMethod method=Undefined, const QString &filename_=QString())
 
QString tagname () const override
 
bool exec () override
 
void writeToXml (QXmlStreamWriter &xmlOut) const override
 
void readFromXml (QXmlStreamReader &xmlIn) override
 
void addToHash (QCryptographicHash &cryptoHash) const override
 
- Public Member Functions inherited from hal::UserAction
virtual ~UserAction ()
 
virtual UserActionObject object () const
 
virtual void setObject (const UserActionObject &obj)
 
int compoundOrder () const
 
void setCompoundOrder (int cmpord)
 
qint64 timeStamp () const
 
QString cryptographicHash (int recordNo) const
 
UserAction * undoAction () const
 
QString debugDump () const
 
void setObjectLock (bool lock)
 
void setParentObjectLock (bool lock)
 
bool hasProjectModified () const
 

Additional Inherited Members

- Protected Member Functions inherited from hal::UserAction
 UserAction ()
 
void writeParentObjectToXml (QXmlStreamWriter &xmlOut) const
 
void readParentObjectFromXml (QXmlStreamReader &xmlIn)
 
- Static Protected Member Functions inherited from hal::UserAction
static QString setToText (const QSet< u32 > &set)
 
static QSet< u32 > setFromText (const QString &s)
 
static QString gridToText (const QHash< hal::Node, QPoint > &grid)
 
static QHash< hal::Node, QPoint > gridFromText (const QString &txt)
 
- Protected Attributes inherited from hal::UserAction
UserActionObject mObject
 
UserActionObject mParentObject
 
int mCompoundOrder
 
UserAction * mUndoAction
 
qint64 mTimeStamp
 
bool mObjectLock
 
bool mParentObjectLock
 
bool mProjectModified
 

Detailed Description

Loads a netlist.

This UserAction can not be undone.

Definition at line 37 of file action_open_netlist_file.h.

Member Enumeration Documentation

◆ OpenMethod

Enumerator
Undefined 
CreateNew 
ImportFile 
OpenProject 

Definition at line 40 of file action_open_netlist_file.h.

Constructor & Destructor Documentation

◆ ActionOpenNetlistFile()

hal::ActionOpenNetlistFile::ActionOpenNetlistFile ( OpenMethod  method = Undefined,
const QString &  filename_ = QString() 
)

Action constructor.

Parameters
method- How the netlist gets opened, e.g. by creating a new project or by importing a file.
filename_- The path of the netlist file to open.

Definition at line 23 of file action_open_netlist_file.cpp.

References hal::UserAction::mProjectModified.

Member Function Documentation

◆ addToHash()

void hal::ActionOpenNetlistFile::addToHash ( QCryptographicHash &  cryptoHash) const
overridevirtual

Hook for derived classes to add parameter to cryptographic hash.

Parameters
cryptoHash- Additional hash data.

Reimplemented from hal::UserAction.

Definition at line 48 of file action_open_netlist_file.cpp.

References QCryptographicHash::addData(), and QString::toUtf8().

◆ exec()

bool hal::ActionOpenNetlistFile::exec ( )
overridevirtual

Executes user interaction and returns true on success. Note: Each implementation of exec() must include a call to the exec() method of base class to store the UserAction object in history and to transfer its ownership.

Returns
true on success, false otherwise.

Reimplemented from hal::UserAction.

Definition at line 29 of file action_open_netlist_file.cpp.

References CreateNew, hal::UserAction::exec(), hal::FileManager::get_instance(), hal::FileManager::importFile(), ImportFile, hal::FileManager::newProject(), hal::FileManager::openProject(), OpenProject, and Undefined.

Referenced by hal::OpenFileWidget::dropEvent(), hal::MainWindow::handleActionImportNetlist(), hal::MainWindow::handleActionNew(), hal::MainWindow::handleActionOpenProject(), and hal::RecentFileItem::mousePressEvent().

◆ readFromXml()

void hal::ActionOpenNetlistFile::readFromXml ( QXmlStreamReader &  xmlIn)
overridevirtual

Reads user interaction as well as arguments from xml macro file.

Parameters
xmlIn- The xml reader.

Reimplemented from hal::UserAction.

Definition at line 60 of file action_open_netlist_file.cpp.

References QXmlStreamReader::name(), QXmlStreamReader::readElementText(), QXmlStreamReader::readNextStartElement(), hal::sOpenMethodsPersist, and Undefined.

◆ tagname()

QString hal::ActionOpenNetlistFile::tagname ( ) const
overridevirtual

The xml tagname for the action is purely virtual and needs to be implemented in derived class.

Returns
The tagname.

Implements hal::UserAction.

Definition at line 18 of file action_open_netlist_file.cpp.

References hal::ActionOpenNetlistFileFactory::sFactory, and hal::UserActionFactory::tagname().

◆ writeToXml()

void hal::ActionOpenNetlistFile::writeToXml ( QXmlStreamWriter &  xmlOut) const
overridevirtual

Persist user interaction in xml macro file.

Parameters
xmlOut- The xml writer.

Reimplemented from hal::UserAction.

Definition at line 54 of file action_open_netlist_file.cpp.

References hal::sOpenMethodsPersist, and QXmlStreamWriter::writeTextElement().


The documentation for this class was generated from the following files: