|
HAL
v4.5.0-83-g30c8f0afc
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
|
#include <hal_core/utilities/project_directory.h>


Public Member Functions | |
| ProjectDirectory (const std::string &path=std::string()) | |
| std::filesystem::path | get_default_filename (const std::string &extension=std::string()) const |
| std::filesystem::path | get_filename (const std::string &relative_filename) const |
| std::filesystem::path | get_shadow_filename (const std::string &extension=std::string()) const |
| std::filesystem::path | get_shadow_dir () const |
| std::filesystem::path | get_canonical_path () const |
| std::filesystem::path | get_relative_file_path (const std::string &filename) const |
Static Public Member Functions | |
| static ProjectDirectory | generate_random () |
Static Public Attributes | |
| static const std::string | s_shadow_dir = "autosave" |
Friends | |
| class | ProjectManager |
Represents a project directory.
Definition at line 42 of file project_directory.h.
| hal::ProjectDirectory::ProjectDirectory | ( | const std::string & | path = std::string() | ) |
Constructs a ProjectDirectory object.
| [in] | path | - Path to the project directory. If the path has an extension (like .v or .hal) the extension will be removed. |
Definition at line 9 of file project_directory.cpp.
Referenced by generate_random().
|
static |
Generates a random directory name in the current working directory.
Definition at line 15 of file project_directory.cpp.
References ProjectDirectory().
Referenced by hal::project_manager_init().
| std::filesystem::path hal::ProjectDirectory::get_canonical_path | ( | ) | const |
Returns the canonical path to the project directory.
Definition at line 31 of file project_directory.cpp.
Referenced by get_default_filename(), get_filename(), get_relative_file_path(), get_shadow_dir(), hal::project_manager_init(), and hal::PythonSerializer::serialize_control().
| std::filesystem::path hal::ProjectDirectory::get_default_filename | ( | const std::string & | extension = std::string() | ) | const |
Returns the default file name for the project directory, which is a file with the same name as the project directory plus an extension.
| [in] | extension | - Extension of the default file name. If empty, .hal is assumed. |
Definition at line 38 of file project_directory.cpp.
References get_canonical_path(), and name.
Referenced by hal::ProjectManager::create_project_directory(), hal::FileManager::importFile(), hal::netlist_factory::load_netlist(), hal::FileManager::newProject(), hal::FileManager::openProject(), hal::project_manager_init(), and hal::ProjectManager::serialize_project().
| std::filesystem::path hal::ProjectDirectory::get_filename | ( | const std::string & | relative_filename | ) | const |
Returns the absolute path to a file within the project directory.
| [in] | relative_filename | - The relative file name within the project directory. |
Definition at line 47 of file project_directory.cpp.
References get_canonical_path().
Referenced by hal::ProjectManager::create_project_directory(), hal::project_manager_init(), and hal::PythonSerializer::PythonSerializer().
| std::filesystem::path hal::ProjectDirectory::get_relative_file_path | ( | const std::string & | filename | ) | const |
Returns the relative file path if the file is within the project directory.
| [in] | filename | - The absolute path to the file. |
Definition at line 74 of file project_directory.cpp.
References get_canonical_path().
Referenced by hal::project_manager_init(), hal::DotViewerFactory::serialize(), and hal::SimulatorSerializer::serialize().
| std::filesystem::path hal::ProjectDirectory::get_shadow_dir | ( | ) | const |
Returns the path to the autosave (shadow) directory.
Definition at line 67 of file project_directory.cpp.
References get_canonical_path(), and s_shadow_dir.
Referenced by hal::FileManager::autosave(), get_shadow_filename(), hal::FileManager::openProject(), and hal::project_manager_init().
| std::filesystem::path hal::ProjectDirectory::get_shadow_filename | ( | const std::string & | extension = std::string() | ) | const |
Returns the file name within the autosave (shadow) directory.
| [in] | extension | - Extension of the shadow file name. If empty, .hal is assumed. |
Definition at line 58 of file project_directory.cpp.
References get_shadow_dir(), and name.
Referenced by hal::project_manager_init(), and hal::ProjectManager::serialize_project().
|
friend |
Definition at line 44 of file project_directory.h.
|
static |
Name of autosave subdirectory
Definition at line 110 of file project_directory.h.
Referenced by hal::ProjectManager::create_project_directory(), get_shadow_dir(), hal::project_manager_init(), and hal::ProjectManager::restore_project_file_from_autosave().