|
WSF
|
#include <ExportFiles.hpp>
Public Member Functions | |
| ExportFiles (const UtPath &aProjectDir, QWidget *aRequestingWidget=nullptr) | |
| bool | ExportProject (const ParseIncludes &aIncludes) |
| bool | ExportRevision (RevisionStore &aRevStore, int aRevNo) |
| QString | GetExportPath (const QString &aExportDirPath, const QString &aFilePath) const |
This class is used for exporting project/scenario files to a user-chosen directory. The methods will attempt to preserve the relative directory structure of the project and any external items it may include. However, it cannot perfectly handle the case where external items are found on different drives on Windows; e.g. the project is on C:\ and an included external item is on D:. In that case, the external item will be added to a folder at the root of the export folder called "_external_items" and scenario files that included such external items will need to be updated to look for them there instead. Linux does not have this problem.
| wizard::ExportFiles::ExportFiles | ( | const UtPath & | aProjectDir, |
| QWidget * | aRequestingWidget = nullptr ) |
Initializing constructor.
| aProjectDir | The root directory of the project. |
| aRequestingWidget | The widget requesting the export. This will be set as the parent widget of the file dialog where the user selects an export directory. |
| bool wizard::ExportFiles::ExportProject | ( | const ParseIncludes & | aIncludes | ) |
Exports the given project includes. Presumably the includes represent the current state of the open project. The includes are used directly. That is, the file contents are not fetched off the disk. Unsaved changes will therefore potentially be exported.
| aIncludes | The files included in the project. |
Referenced by wizard::Project::ExportProjectAction().
| bool wizard::ExportFiles::ExportRevision | ( | RevisionStore & | aRevStore, |
| int | aRevNo ) |
Exports the project files as it existed at the given revision number.
| aRevStore | The project revision store. |
| aRevNo | The revision number to export. |
References wizard::RevisionStore::Close(), wizard::RevisionStore::DB(), wizard::RevisionDb::ExistingFiles(), wizard::RevisionStore::IsOpen(), and wizard::RevisionStore::Open().
Referenced by wizard::ChangeHistory::ExportSelectedRevision().
| QString wizard::ExportFiles::GetExportPath | ( | const QString & | aExportDirPath, |
| const QString & | aFilePath ) const |
Given an export directory path and a file path (relative unless on another drive), return the path that the file should be exported to.
| aExportDirPath | The directory to export files to. |
| aFilePath | The file path to compute an export file path for. |