WSF
wizard::ExportFiles Class Reference

#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

Detailed Description

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.

Constructor & Destructor Documentation

◆ ExportFiles()

wizard::ExportFiles::ExportFiles ( const UtPath & aProjectDir,
QWidget * aRequestingWidget = nullptr )

Initializing constructor.

Parameters
aProjectDirThe root directory of the project.
aRequestingWidgetThe widget requesting the export. This will be set as the parent widget of the file dialog where the user selects an export directory.

Member Function Documentation

◆ ExportProject()

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.

Parameters
aIncludesThe files included in the project.
Returns
Whether or not the export was successful.

Referenced by wizard::Project::ExportProjectAction().

◆ ExportRevision()

bool wizard::ExportFiles::ExportRevision ( RevisionStore & aRevStore,
int aRevNo )

Exports the project files as it existed at the given revision number.

Parameters
aRevStoreThe project revision store.
aRevNoThe revision number to export.
Returns
Whether or not the export was successful.

References wizard::RevisionStore::Close(), wizard::RevisionStore::DB(), wizard::RevisionDb::ExistingFiles(), wizard::RevisionStore::IsOpen(), and wizard::RevisionStore::Open().

Referenced by wizard::ChangeHistory::ExportSelectedRevision().

◆ GetExportPath()

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.

Parameters
aExportDirPathThe directory to export files to.
aFilePathThe file path to compute an export file path for.
Returns
The export path for the given file path.

The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved