Limo
A simple mod manager
Loading...
Searching...
No Matches
ReverseDeployer Class Reference

Moves all files not managed by another deployer out of the target directory and links them back in. More...

#include <reversedeployer.h>

Inheritance diagram for ReverseDeployer:
Collaboration diagram for ReverseDeployer:

Public Member Functions

 ReverseDeployer (const std::filesystem::path &source_path, const std::filesystem::path &dest_path, const std::string &name, DeployMode deploy_mode=hard_link, bool separate_profile_dirs=false, bool update_ignore_list=false)
 Constructor.
 
void updateManagedFiles (bool write=false, std::optional< ProgressNode * > progress_node={})
 Scans the target directory for files not managed by other deployers.
 
std::map< int, unsigned long > deploy (std::optional< ProgressNode * > progress_node={}) override
 Updates all managed files and links / unlinks files depending on whether or not they are disabled.
 
std::map< int, unsigned long > deploy (const std::vector< int > &loadorder, std::optional< ProgressNode * > progress_node={}) override
 Updates all managed files and links / unlinks files depending on whether or not they are disabled.
 
virtual void unDeploy (std::optional< ProgressNode * > progress_node={}) override
 Unlinks all managed files.
 
void changeLoadorder (int from_index, int to_index) override
 Moves a mod from one position in the load order to another. Saves changes to disk.
 
void setModStatus (int mod_id, bool status) override
 Enables or disables the given mod in the load order. Saves changes to disk.
 
std::vector< std::vector< int > > getConflictGroups () const override
 Conflict groups are not supported by this type.
 
std::vector< std::string > getModNames () const override
 Returns the vector of managed files.
 
void addProfile (int source=-1) override
 Adds a new profile and optionally copies it's load order from an existing profile. Profiles are stored in the deactivated list file.
 
void removeProfile (int profile) override
 Removes a profile.
 
void setProfile (int profile) override
 Sets the current profile to the given profile. Updates the current loadorder.
 
void setConflictGroups (const std::vector< std::vector< int > > &newConflict_groups) override
 Not supported by this type.
 
int getNumMods () const override
 Returns the number of managed files.
 
std::vector< std::tuple< int, bool > > getLoadorder () const override
 Getter for the current plugin load order.
 
bool addMod (int mod_id, bool enabled=true, bool update_conflicts=true) override
 Does nothing since this deployer manages its own mods.
 
bool removeMod (int mod_id) override
 Not supported by this type.
 
bool hasMod (int mod_id) const override
 Since this deployer uses its own internal mod ids, this function always returns false.
 
bool swapMod (int old_id, int new_id) override
 Does nothing since this deployer manages its own mods.
 
std::vector< ConflictInfogetFileConflicts (int mod_id, bool show_disabled=false, std::optional< ProgressNode * > progress_node={}) const override
 Not supported.
 
std::unordered_set< int > getModConflicts (int mod_id, std::optional< ProgressNode * > progress_node={}) override
 Checks for conflicts with other mods. Two mods are conflicting if they share at least one record.
 
void sortModsByConflicts (std::optional< ProgressNode * > progress_node={}) override
 Sorting is not supported.
 
void cleanup () override
 Moves all files back to their original location.
 
std::optional< bool > getModStatus (int mod_id)
 Searches the load order for the given mod id and returns the corresponding mods activation status, if found.
 
virtual std::vector< std::vector< std::string > > getAutoTags () override
 Getter for mod tags.
 
virtual std::map< std::string, int > getAutoTagMap () override
 Returns all available auto tag names.
 
virtual std::vector< std::pair< std::filesystem::path, int > > getExternallyModifiedFiles (std::optional< ProgressNode * > progress_node={}) const override
 Iterates over all deployed files in the source and target directory and checks if they have been deleted externally.
 
virtual void keepOrRevertFileModifications (const FileChangeChoices &changes_to_keep) override
 For all given files: If change is to be kept: Delete the file, else: Restore the file.
 
virtual void updateDeployedFilesForMod (int mod_id, std::optional< ProgressNode * > progress_node={}) const override
 This is not supported for this deployer type.
 
void updateIgnoredFiles (bool write=false)
 Adds all files currently in the target directory and not managed by another deployer to the list of ignored files.
 
void deleteIgnoredFiles ()
 Removes all currently ignored files from the list.
 
std::vector< std::string > getIgnoredFiles () const
 Returns a vector containing the ignored files.
 
void enableSeparateDirs (bool enabled)
 Enables/ disables separate managed files directories for every profile.
 
bool usesSeparateDirs () const
 Returns whether or not each profile uses a separate directory to store files.
 
int getNumIgnoredFiles () const
 Returns the number of files in the ignore list.
 
int getNumProfiles () const
 Returns the number of profiles.
 
virtual int getDeployPriority () const override
 Returns the order in which the deploy function of different deployers should be called.
 
virtual bool supportsSorting () const override
 Returns whether or not this deployer type supports sorting mods.
 
virtual bool supportsReordering () const override
 Returns whether or not this deployer type supports reordering mods.
 
virtual bool supportsModConflicts () const override
 Returns whether or not this deployer type supports showing mod conflicts.
 
virtual bool supportsFileConflicts () const override
 Returns whether or not this deployer type supports showing file conflicts.
 
virtual bool supportsFileBrowsing () const override
 Returns whether or not this deployer type supports browsing mod files.
 
void addModToIgnoreList (int mod_id)
 Adds the file matching the given position in the current loadorder to the ignore list.
 
virtual std::vector< std::vector< int > > getValidModActions () const override
 Returns a vector containing valid mod actions.
 
- Public Member Functions inherited from Deployer
 Deployer (const std::filesystem::path &source_path, const std::filesystem::path &dest_path, const std::string &name, DeployMode deploy_mode=hard_link)
 Constructor.
 
std::string getDestPath () const
 Getter for path to deployment target directory.
 
std::string getSourcePath () const
 Getter for the path to the deployer's source directory.
 
std::string getName () const
 Getter for deployer name.
 
void setName (const std::string &name)
 Setter for deployer name.
 
void setLoadorder (const std::vector< std::tuple< int, bool > > &loadorder)
 Setter for the load order used for deployment.
 
std::string getType () const
 Returns the type of this deployer, i.e. SIMPLEDEPLOYER.
 
const std::filesystem::path & destPath () const
 Getter for path to deployment target directory.
 
void setDestPath (const std::filesystem::path &path)
 Setter for path to deployment target directory.
 
int getProfile () const
 Getter for the active profile.
 
std::pair< int, std::string > verifyDirectories ()
 Checks if writing to the deployment directory is possible.
 
DeployMode getDeployMode () const
 Getter for the current DeployMode.
 
virtual void setDeployMode (DeployMode deploy_mode)
 Sets the current DeployMode.
 
bool isAutonomous ()
 Getter for is_autonomous_.
 
std::filesystem::path sourcePath () const
 Getter for mod source path.
 
void setSourcePath (const std::filesystem::path &newSourcePath)
 Setter for mod source path.
 
void setLog (const std::function< void(Log::LogLevel, const std::string &)> &newLog)
 Setter for log callback.
 
void updateConflictGroups (std::optional< ProgressNode * > progress_node={})
 Updates conflict_groups_ for the current profile.
 
bool autoUpdateConflictGroups () const
 Getter for auto_update_conflict_groups_.
 
void setAutoUpdateConflictGroups (bool status)
 Setter for auto_update_conflict_groups_.
 
std::optional< bool > getModStatus (int mod_id)
 Searches the load order for the given mod id and returns the corresponding mods activation status, if found.
 
virtual void fixInvalidLinkDeployMode ()
 If using hard_link deploy mode and links cannot be created: Switch to sym links.
 
virtual bool idsAreSourceReferences () const
 Returns whether or not this deployer type uses mod ids as references to source mods. This is usually done by autonomous deployers.
 
virtual std::vector< std::pair< std::string, std::string > > getModActions () const
 Returns names and icon names for additional actions which can be applied to a mod.
 
virtual void applyModAction (int action, int mod_id)
 Applies the given mod action to the given mod.
 

Private Member Functions

void readIgnoredFiles ()
 Reads a list of ignored files from the ignore list file.
 
void writeIgnoredFiles () const
 Writes the list of ignored files to disk.
 
void readManagedFiles ()
 Reads all files for every profile from a file in source_path_.
 
void writeManagedFiles () const
 Writes all files for every profile to a file in source_path_.
 
int updateFilesInDir (const std::filesystem::path &target_dir, const std::unordered_set< std::filesystem::path > &deployed_files, std::filesystem::path current_deployer_path, bool update_ignored_files=false, std::optional< ProgressNode * > progress_node={})
 Recursively adds all files not ignored or handled by other deployers in dir to profile_files_ for the current profile.
 
void moveFilesFromTargetToSource () const
 Moves all managed files from dest_path_ to source_path_.
 
void updateCurrentLoadorder ()
 Updates current_loadorder_ to reflect managed_files_[current_profile_].
 
void deployManagedFiles ()
 Uses the operation specified in deploy mode to copy/ link files from source to target.
 
std::filesystem::path getSourcePath (const std::filesystem::path &path, int profile) const
 Returns the full path pointing to the given file in source_path_.
 
void deleteFile (const std::filesystem::path &path, int profile)
 Deletes the given file from disk and the given profile. If separate directories are NOT used: Deletes the file from all profiles. Does NOT write manged files or update the current loadorder.
 

Private Attributes

const std::string ignore_list_file_name_ = ".revdepl-ignored_files.json"
 Name of the file containing paths of ignored files.
 
const std::string managed_files_name_ = ".revdepl-managed_files.json"
 Name of the file containing file paths and activation status for every profile.
 
const std::string deployed_loadorder_name_ = ".revdepl-deployed_files.json"
 Name of the file containing the currently deployed load order.
 
std::vector< std::map< std::filesystem::path, bool > > managed_files_
 For every profile: A vector containing every file that is not to be deployed.
 
std::vector< std::pair< std::filesystem::path, bool > > current_loadorder_
 Contains all files and their enabled status for the current load order.
 
std::vector< std::pair< std::filesystem::path, bool > > deployed_loadorder_
 Contains all files and their enabled status for the currently deployed load order.
 
std::unordered_set< std::string > ignored_files_
 Contains all files which should be ignored by this deployer.
 
int deployed_profile_ = -1
 Currently deployed profile.
 
bool separate_profile_dirs_ = false
 If true: Store files on a per profile basis. Else: All profiles use the same files.
 
const int deploy_priority_ = 2
 Determines the order in which the deploy function of different deployers should be called.
 
int number_of_files_in_target_ = 0
 The total number of files in the target directory during previous deployment.
 

Additional Inherited Members

- Public Types inherited from Deployer
enum  DeployMode { hard_link = 0 , sym_link = 1 , copy = 2 }
 Describes how files should be deployed to the target directory. More...
 
- Protected Member Functions inherited from Deployer
std::pair< std::map< std::filesystem::path, int >, std::map< int, unsigned long > > getDeploymentSourceFilesAndModSizes (const std::vector< int > &loadorder) const
 Creates a pair of maps. One maps relative file paths to the mod id from which that file is to be deployed. The other maps mod ids to their total file size on disk.
 
void backupOrRestoreFiles (const std::map< std::filesystem::path, int > &source_files, const std::map< std::filesystem::path, int > &dest_files) const
 Backs up all files which would be overwritten during deployment and restores all files backed up during previous deployments files which are no longer overwritten.
 
void deployFiles (const std::map< std::filesystem::path, int > &source_files, std::optional< ProgressNode * > progress_node={}) const
 Hard links all given files to target directory.
 
std::map< std::filesystem::path, int > loadDeployedFiles (std::optional< ProgressNode * > progress_node={}, std::filesystem::path dest_path="") const
 Creates a map of currently deployed files to their source mods.
 
void saveDeployedFiles (const std::map< std::filesystem::path, int > &deployed_files, std::optional< ProgressNode * > progress_node={}) const
 Creates a file containing information about currently deployed files.
 
std::vector< std::string > getModFiles (int mod_id, bool include_directories=false) const
 Creates a vector containing every file contained in one mod. Files are represented as paths relative to the mods root directory.
 
bool modPathExists (int mod_id) const
 modPathExists Checks if the directory containing the given mod exists.
 
bool checkModPathExistsAndMaybeLogError (int mod_id) const
 Checks if the directory containing the given mod exists, if not logs an error.
 
void removeManagedDirFile (const std::filesystem::path &directory) const
 Removes a legacy file that is no longer needed and may cause issues.
 
- Protected Attributes inherited from Deployer
std::string type_ = "Simple Deployer"
 Type of this deployer, e.g. Simple Deployer.
 
std::filesystem::path source_path_
 Path to the directory containing all mods which are to be deployed.
 
std::filesystem::path dest_path_
 Path to the directory where all mods are deployed to.
 
const std::string backup_extension_ = ".lmmbak"
 The file extension appended to backed up files.
 
const std::string deployed_files_name_ = ".lmmfiles"
 The file name for a file in the target directory containing names of deployed files.
 
const std::string managed_dir_file_name_ = ".lmm_managed_dir"
 Name of the file indicating that the directory is managed by a deployer.
 
std::string name_
 The name of this deployer.
 
int current_profile_ = 0
 The currently active profile.
 
std::vector< std::vector< std::tuple< int, bool > > > loadorders_
 One load order per profile consisting of tuples of mod ids and their enabled status.
 
std::vector< std::vector< std::vector< int > > > conflict_groups_
 For every profile: Groups of mods which conflict with each other. The last group contains mods with no conflicts.
 
DeployMode deploy_mode_ = hard_link
 Determines how files should be deployed to the target directory.
 
bool is_autonomous_ = false
 Autonomous deployers manage their own mods and do not rely on ModdedApplication.
 
bool auto_update_conflict_groups_ = false
 If true: Automatically update conflict groups when necessary.
 
std::function< void(Log::LogLevel, const std::string &)> log_
 Callback for logging.
 

Detailed Description

Moves all files not managed by another deployer out of the target directory and links them back in.

Constructor & Destructor Documentation

◆ ReverseDeployer()

ReverseDeployer::ReverseDeployer ( const std::filesystem::path & source_path,
const std::filesystem::path & dest_path,
const std::string & name,
DeployMode deploy_mode = hard_link,
bool separate_profile_dirs = false,
bool update_ignore_list = false )

Constructor.

Parameters
source_pathPath to directory containing mods installed using the Installer class.
dest_pathPath to target directory for mod deployment.
nameA custom name for this instance.
deploy_modeDetermines how files are deployed to the target directory.
separate_profile_dirsIf true: Store files on a per profile basis. Else: All profiles use the same files.
update_ignore_listIf true: Add all files in dest_path not managed by another deployer to the ignore list.

Member Function Documentation

◆ addMod()

bool ReverseDeployer::addMod ( int mod_id,
bool enabled = true,
bool update_conflicts = true )
overridevirtual

Does nothing since this deployer manages its own mods.

Parameters
mod_idIgnored.
enabledIgnored.
update_conflictsIgnored.
Returns
False.

Reimplemented from Deployer.

◆ addModToIgnoreList()

void ReverseDeployer::addModToIgnoreList ( int mod_id)

Adds the file matching the given position in the current loadorder to the ignore list.

Parameters
mod_idPosition in the current loadorder.

◆ addProfile()

void ReverseDeployer::addProfile ( int source = -1)
overridevirtual

Adds a new profile and optionally copies it's load order from an existing profile. Profiles are stored in the deactivated list file.

Parameters
sourceThe profile to be copied. A value of -1 indicates no copy.

Reimplemented from Deployer.

◆ changeLoadorder()

void ReverseDeployer::changeLoadorder ( int from_index,
int to_index )
overridevirtual

Moves a mod from one position in the load order to another. Saves changes to disk.

Parameters
from_indexIndex of mod to be moved.
to_indexDestination index.

Reimplemented from Deployer.

◆ cleanup()

void ReverseDeployer::cleanup ( )
overridevirtual

Moves all files back to their original location.

Reimplemented from Deployer.

◆ deleteFile()

void ReverseDeployer::deleteFile ( const std::filesystem::path & path,
int profile )
private

Deletes the given file from disk and the given profile. If separate directories are NOT used: Deletes the file from all profiles. Does NOT write manged files or update the current loadorder.

Parameters
pathRelative path to the file which is to be delete.
profileProfile from which to delete the file.

◆ deploy() [1/2]

std::map< int, unsigned long > ReverseDeployer::deploy ( const std::vector< int > & loadorder,
std::optional< ProgressNode * > progress_node = {} )
overridevirtual

Updates all managed files and links / unlinks files depending on whether or not they are disabled.

Parameters
loadorderIgnored.
progress_nodeUsed to inform about the current progress of deployment.
Returns
Since this is an autonomous deployer, the returned map is always empty.

Reimplemented from Deployer.

◆ deploy() [2/2]

std::map< int, unsigned long > ReverseDeployer::deploy ( std::optional< ProgressNode * > progress_node = {})
overridevirtual

Updates all managed files and links / unlinks files depending on whether or not they are disabled.

Parameters
progress_nodeUsed to inform about the current progress of deployment.
Returns
Since this is an autonomous deployer, the returned map is always empty.

Reimplemented from Deployer.

◆ enableSeparateDirs()

void ReverseDeployer::enableSeparateDirs ( bool enabled)

Enables/ disables separate managed files directories for every profile.

When switched to enabled: Moves the current files to the directory of the active profile. Creates empty directories for every inactive profile. When switched to disabled: Uses files from the currently active profile and deletes files for all other profiles.

Parameters
enabledThe new status.

◆ getAutoTagMap()

std::map< std::string, int > ReverseDeployer::getAutoTagMap ( )
overridevirtual

Returns all available auto tag names.

Returns
The tag names.

Reimplemented from Deployer.

◆ getAutoTags()

std::vector< std::vector< std::string > > ReverseDeployer::getAutoTags ( )
overridevirtual

Getter for mod tags.

Returns
For every mod: A vector of auto tags added to that mod.

Reimplemented from Deployer.

◆ getConflictGroups()

std::vector< std::vector< int > > ReverseDeployer::getConflictGroups ( ) const
overridevirtual

Conflict groups are not supported by this type.

Returns
All plugins in the non conflicting group.

Reimplemented from Deployer.

◆ getDeployPriority()

int ReverseDeployer::getDeployPriority ( ) const
overridevirtual

Returns the order in which the deploy function of different deployers should be called.

Returns
The priority.

Reimplemented from Deployer.

◆ getExternallyModifiedFiles()

std::vector< std::pair< sfs::path, int > > ReverseDeployer::getExternallyModifiedFiles ( std::optional< ProgressNode * > progress_node = {}) const
overridevirtual

Iterates over all deployed files in the source and target directory and checks if they have been deleted externally.

Parameters
progress_nodeUsed to inform about progress.
Returns
A vector containing pairs of paths to deleted files and the corresponding mod id.

Reimplemented from Deployer.

◆ getFileConflicts()

std::vector< ConflictInfo > ReverseDeployer::getFileConflicts ( int mod_id,
bool show_disabled = false,
std::optional< ProgressNode * > progress_node = {} ) const
overridevirtual

Not supported.

Parameters
mod_idIgnored.
show_disabledIgnored.
progress_nodeSet to 100%.
Returns
An empty vector.

Reimplemented from Deployer.

◆ getIgnoredFiles()

std::vector< std::string > ReverseDeployer::getIgnoredFiles ( ) const

Returns a vector containing the ignored files.

Returns
The vector.

◆ getLoadorder()

std::vector< std::tuple< int, bool > > ReverseDeployer::getLoadorder ( ) const
overridevirtual

Getter for the current plugin load order.

Returns
The load order.

Reimplemented from Deployer.

◆ getModConflicts()

std::unordered_set< int > ReverseDeployer::getModConflicts ( int mod_id,
std::optional< ProgressNode * > progress_node = {} )
overridevirtual

Checks for conflicts with other mods. Two mods are conflicting if they share at least one record.

Parameters
mod_idThe mod to be checked.
progress_nodeUsed to inform about the current progress.
Returns
A set of mod ids which conflict with the given mod.

Reimplemented from Deployer.

◆ getModNames()

std::vector< std::string > ReverseDeployer::getModNames ( ) const
overridevirtual

Returns the vector of managed files.

Returns
The vector.

Reimplemented from Deployer.

◆ getModStatus()

std::optional< bool > ReverseDeployer::getModStatus ( int mod_id)

Searches the load order for the given mod id and returns the corresponding mods activation status, if found.

Parameters
mod_idMod to be found.
Returns
The activation status, if found.

◆ getNumIgnoredFiles()

int ReverseDeployer::getNumIgnoredFiles ( ) const

Returns the number of files in the ignore list.

Returns
The number of files.

◆ getNumMods()

int ReverseDeployer::getNumMods ( ) const
overridevirtual

Returns the number of managed files.

Returns
The number of plugins.

Reimplemented from Deployer.

◆ getNumProfiles()

int ReverseDeployer::getNumProfiles ( ) const

Returns the number of profiles.

Returns
The number of profiles.

◆ getSourcePath()

sfs::path ReverseDeployer::getSourcePath ( const std::filesystem::path & path,
int profile ) const
private

Returns the full path pointing to the given file in source_path_.

Parameters
pathRelative path to to convert.
profileThe profile for which to determine the path.
Returns
The full path.

◆ getValidModActions()

std::vector< std::vector< int > > ReverseDeployer::getValidModActions ( ) const
overridevirtual

Returns a vector containing valid mod actions.

Returns
For every mod: IDs of every valid mod_action which is valid for that mod.

Reimplemented from Deployer.

◆ hasMod()

bool ReverseDeployer::hasMod ( int mod_id) const
overridevirtual

Since this deployer uses its own internal mod ids, this function always returns false.

Parameters
mod_idIgnores
Returns
False.

Reimplemented from Deployer.

◆ keepOrRevertFileModifications()

void ReverseDeployer::keepOrRevertFileModifications ( const FileChangeChoices & changes_to_keep)
overridevirtual

For all given files: If change is to be kept: Delete the file, else: Restore the file.

Parameters
changes_to_keepContains vectors of relative file paths and decision of whether or not to keep the change for that file.

Reimplemented from Deployer.

◆ removeMod()

bool ReverseDeployer::removeMod ( int mod_id)
overridevirtual

Not supported by this type.

Parameters
mod_idIgnored.
Returns
False.

Reimplemented from Deployer.

◆ removeProfile()

void ReverseDeployer::removeProfile ( int profile)
overridevirtual

Removes a profile.

Parameters
profileThe profile to be removed.

Reimplemented from Deployer.

◆ setConflictGroups()

void ReverseDeployer::setConflictGroups ( const std::vector< std::vector< int > > & newConflict_groups)
overridevirtual

Not supported by this type.

Parameters
newConflict_groupsIgnored.

Reimplemented from Deployer.

◆ setModStatus()

void ReverseDeployer::setModStatus ( int mod_id,
bool status )
overridevirtual

Enables or disables the given mod in the load order. Saves changes to disk.

Parameters
mod_idMod to be edited.
statusThe new status.

Reimplemented from Deployer.

◆ setProfile()

void ReverseDeployer::setProfile ( int profile)
overridevirtual

Sets the current profile to the given profile. Updates the current loadorder.

Parameters
profileThe new profile.

Reimplemented from Deployer.

◆ sortModsByConflicts()

void ReverseDeployer::sortModsByConflicts ( std::optional< ProgressNode * > progress_node = {})
overridevirtual

Sorting is not supported.

Parameters
progress_nodeUsed to inform about the current progress.

Reimplemented from Deployer.

◆ supportsFileBrowsing()

bool ReverseDeployer::supportsFileBrowsing ( ) const
overridevirtual

Returns whether or not this deployer type supports browsing mod files.

Returns
True if supported.

Reimplemented from Deployer.

◆ supportsFileConflicts()

bool ReverseDeployer::supportsFileConflicts ( ) const
overridevirtual

Returns whether or not this deployer type supports showing file conflicts.

Returns
True if supported.

Reimplemented from Deployer.

◆ supportsModConflicts()

bool ReverseDeployer::supportsModConflicts ( ) const
overridevirtual

Returns whether or not this deployer type supports showing mod conflicts.

Returns
True if supported.

Reimplemented from Deployer.

◆ supportsReordering()

bool ReverseDeployer::supportsReordering ( ) const
overridevirtual

Returns whether or not this deployer type supports reordering mods.

Returns
True if supported.

Reimplemented from Deployer.

◆ supportsSorting()

bool ReverseDeployer::supportsSorting ( ) const
overridevirtual

Returns whether or not this deployer type supports sorting mods.

Returns
True if supported.

Reimplemented from Deployer.

◆ swapMod()

bool ReverseDeployer::swapMod ( int old_id,
int new_id )
overridevirtual

Does nothing since this deployer manages its own mods.

Parameters
old_idIgnored.
new_idIgnored
Returns
False.

Reimplemented from Deployer.

◆ unDeploy()

void ReverseDeployer::unDeploy ( std::optional< ProgressNode * > progress_node = {})
overridevirtual

Unlinks all managed files.

Parameters
progress_nodeUsed to inform about the current progress.

Reimplemented from Deployer.

◆ updateDeployedFilesForMod()

void ReverseDeployer::updateDeployedFilesForMod ( int mod_id,
std::optional< ProgressNode * > progress_node = {} ) const
overridevirtual

This is not supported for this deployer type.

Parameters
mod_idIgnored.
progress_nodeIgnored.

Reimplemented from Deployer.

◆ updateFilesInDir()

int ReverseDeployer::updateFilesInDir ( const std::filesystem::path & target_dir,
const std::unordered_set< std::filesystem::path > & deployed_files,
std::filesystem::path current_deployer_path,
bool update_ignored_files = false,
std::optional< ProgressNode * > progress_node = {} )
private

Recursively adds all files not ignored or handled by other deployers in dir to profile_files_ for the current profile.

Parameters
target_dirDirectory in which to search for files.
deployed_filesContains relative paths to all files deployed by another deployer.
current_deployer_pathTarget directory of another deployer managing this directory.
update_ignored_filesIf true: Update the list of ignored files instead.
progress_nodeUsed to inform about progress.

◆ updateIgnoredFiles()

void ReverseDeployer::updateIgnoredFiles ( bool write = false)

Adds all files currently in the target directory and not managed by another deployer to the list of ignored files.

Parameters
writeIf true: Write new list to disk.

◆ updateManagedFiles()

void ReverseDeployer::updateManagedFiles ( bool write = false,
std::optional< ProgressNode * > progress_node = {} )

Scans the target directory for files not managed by other deployers.

Parameters
writeIf true: Write managed files to file.
progress_nodeUsed to inform about progress.

◆ usesSeparateDirs()

bool ReverseDeployer::usesSeparateDirs ( ) const

Returns whether or not each profile uses a separate directory to store files.

Returns
True when separate directories are used.

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