Loading...
Searching...
No Matches
Process::ExternalFileMap Class Reference

Collects — and in the same pass rewrites — the files a document references. More...

Detailed Description

Collects — and in the same pass rewrites — the files a document references.

Analysis and relocation go through one traversal on purpose: a separate "list the files" and "rewrite the files" pass drift apart as processes are added, and the user then gets a plan that does not match what happened. Pass a mapper that always returns {} to only look.

Processes report their references by calling the helpers below from Process::ProcessModel::mapExternalFiles. The base implementation already covers every file-valued control port (Process::FileChooserBase, Process::FolderChooser and list-of-path controls), which is what all avendish-based processes use, so only processes holding a path outside of a port need to override it.

Public Member Functions

 ExternalFileMap (ExternalFileMapper mapper) noexcept
 
 ExternalFileMap (const ExternalFileMap &)=delete
 
ExternalFileMapoperator= (const ExternalFileMap &)=delete
 
QString map (ExternalFileRef ref)
 
void control (Process::ControlInlet &inlet, score::FileKind kind, FileUsage usage=FileUsage::Input)
 A path (or list of paths) held in a control port's value.
 
void folder (Process::ControlInlet &inlet)
 A folder held in a control port's value.
 
template<typename T >
void property (T &obj, const char *property, score::FileKind kind, FileUsage usage=FileUsage::Input)
 A path held in a QString Q_PROPERTY of a model object.
 
void readOnly (const QString &path, score::FileKind kind)
 A reference score cannot relocate; reported to the user only.
 
void addCommand (score::Command *cmd)
 
std::vector< score::Command * > takeCommands () noexcept
 
bool hasCommands () const noexcept
 

Public Attributes

QString owner
 Name attributed to the references reported next. Set by the traversal.
 

Member Function Documentation

◆ addCommand()

void Process::ExternalFileMap::addCommand ( score::Command cmd)

Queue a rewrite the caller built itself, for models whose path is only reachable through a dedicated command.

◆ map()

QString Process::ExternalFileMap::map ( ExternalFileRef  ref)

Report a reference and ask the mapper what to do with it. Returns the replacement path, or {} if it must stay as it is.

◆ takeCommands()

std::vector< score::Command * > Process::ExternalFileMap::takeCommands ( )
noexcept

Rewrites the mapper asked for. Ownership is transferred to the caller through takeCommands().


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