Moves all files not managed by another deployer out of the target directory and links them back in.
More...
|
| 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< ConflictInfo > | getFileConflicts (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.
|
|
| 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.
|
|
|
enum | DeployMode { hard_link = 0
, sym_link = 1
, copy = 2
} |
| Describes how files should be deployed to the target directory. More...
|
|
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.
|
|
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.
|
|
Moves all files not managed by another deployer out of the target directory and links them back in.