Unravel Engine C++ Reference
|
#include <syncer.h>
Classes | |
struct | mapping |
Public Types | |
using | rename_pair_t = std::pair<fs::path, fs::path> |
using | on_entry_created_t = std::function<void(const std::string&, const fs::path&, const std::vector<fs::path>&, bool)> |
using | on_entry_modified_t = std::function<void(const std::string&, const fs::path&, const std::vector<fs::path>&, bool)> |
using | on_entry_removed_t = std::function<void(const std::string&, const fs::path&, const std::vector<fs::path>&)> |
using | on_entry_renamed_t = std::function<void(const std::string&, const rename_pair_t&, const std::vector<rename_pair_t>&)> |
using | mapping_t = std::unordered_map<std::string, mapping> |
Public Member Functions | |
syncer ()=default | |
~syncer () | |
void | set_mapping (const std::string &ref_ext, const std::vector< std::string > &synced_ext, on_entry_created_t on_entry_created, on_entry_modified_t on_entry_modified, on_entry_removed_t on_entry_removed, on_entry_renamed_t on_entry_renamed) |
Remaps a specific extension of the reference directory to extensions of the synced directory. You will get notified with entries of the synced directory with 'synced_ext' when an entry with the ref_ext in the reference directory gets changed. | |
void | set_directory_mapping (on_entry_created_t on_entry_created, on_entry_modified_t on_entry_modified, on_entry_removed_t on_entry_removed, on_entry_renamed_t on_entry_renamed) |
void | sync (const fs::path &reference_dir, const fs::path &synced_dir) |
Start syncing the synced_dir with reference to the reference_dir i.e changes that occur in the reference_dir will be reported on entries in the synced_dir. | |
void | unsync () |
Stops syncing. | |
using fs::syncer::mapping_t = std::unordered_map<std::string, mapping> |
using fs::syncer::on_entry_created_t = std::function<void(const std::string&, const fs::path&, const std::vector<fs::path>&, bool)> |
using fs::syncer::on_entry_modified_t = std::function<void(const std::string&, const fs::path&, const std::vector<fs::path>&, bool)> |
using fs::syncer::on_entry_removed_t = std::function<void(const std::string&, const fs::path&, const std::vector<fs::path>&)> |
using fs::syncer::on_entry_renamed_t = std::function<void(const std::string&, const rename_pair_t&, const std::vector<rename_pair_t>&)> |
using fs::syncer::rename_pair_t = std::pair<fs::path, fs::path> |
|
default |
fs::syncer::~syncer | ( | ) |
Definition at line 19 of file syncer.cpp.
void fs::syncer::set_directory_mapping | ( | syncer::on_entry_created_t | on_entry_created, |
syncer::on_entry_modified_t | on_entry_modified, | ||
syncer::on_entry_removed_t | on_entry_removed, | ||
syncer::on_entry_renamed_t | on_entry_renamed ) |
Definition at line 40 of file syncer.cpp.
void fs::syncer::set_mapping | ( | const std::string & | ref_ext, |
const std::vector< std::string > & | synced_ext, | ||
on_entry_created_t | on_entry_created = nullptr, | ||
on_entry_modified_t | on_entry_modified = nullptr, | ||
on_entry_removed_t | on_entry_removed = nullptr, | ||
on_entry_renamed_t | on_entry_renamed = nullptr ) |
Remaps a specific extension of the reference directory to extensions of the synced directory. You will get notified with entries of the synced directory with 'synced_ext' when an entry with the ref_ext in the reference directory gets changed.
Definition at line 24 of file syncer.cpp.
void fs::syncer::sync | ( | const fs::path & | reference_dir, |
const fs::path & | synced_dir ) |
Start syncing the synced_dir with reference to the reference_dir i.e changes that occur in the reference_dir will be reported on entries in the synced_dir.
Definition at line 90 of file syncer.cpp.
void fs::syncer::unsync | ( | ) |
Stops syncing.
Definition at line 53 of file syncer.cpp.