Unravel Engine C++ Reference
Loading...
Searching...
No Matches
fs::watcher::impl Class Reference

Classes

struct  observed_changes
 

Public Member Functions

 impl (const fs::path &path, const pattern_filter &filter, bool recursive, bool initial_list, clock_t::duration poll_interval, notify_callback list_callback)
 
void pause ()
 
void resume ()
 
void watch ()
 
void poll_entry (const fs::path &path, observed_changes &changes)
 

Static Public Member Functions

static auto get_original_path (const fs::path &old_path, const fs::path &renamed_path, const fs::path &new_path) -> fs::path
 
static auto check_if_same_extension (const fs::path &p1, const fs::path &p2) -> bool
 
static auto check_if_parent_dir_was_renamed (const std::vector< size_t > &renamed_dirs, const std::vector< watcher::entry > &entries, entry &e) -> bool
 
template<typename Container >
static auto check_if_renamed (entry &e, Container &container) -> bool
 
template<typename Container >
static void check_for_removed (std::vector< watcher::entry > &entries, Container &container)
 
template<typename Container >
static void process_modifications (Container &old_entries, observed_changes &changes)
 

Protected Attributes

fs::path root_
 Path to watch.
 
pattern_filter filter_
 Filter applied.
 
notify_callback callback_
 Callback for list of modifications.
 
std::map< std::string, watcher::entryentries_
 Cache watched files.
 
clock_t::duration poll_interval_ = 500ms
 
clock_t::time_point last_poll_ = clock_t::now()
 
bool recursive_ = false
 
std::atomic< bool > paused_ = {false}
 
observed_changes buffered_changes_
 

Friends

class watcher
 

Detailed Description

Definition at line 18 of file watcher.cpp.

Constructor & Destructor Documentation

◆ impl()

fs::watcher::impl::impl ( const fs::path & path,
const pattern_filter & filter,
bool recursive,
bool initial_list,
clock_t::duration poll_interval,
notify_callback list_callback )
inline

Definition at line 81 of file watcher.cpp.

Member Function Documentation

◆ check_for_removed()

template<typename Container >
static void fs::watcher::impl::check_for_removed ( std::vector< watcher::entry > & entries,
Container & container )
inlinestatic

Definition at line 272 of file watcher.cpp.

◆ check_if_parent_dir_was_renamed()

static auto fs::watcher::impl::check_if_parent_dir_was_renamed ( const std::vector< size_t > & renamed_dirs,
const std::vector< watcher::entry > & entries,
entry & e ) -> bool
inlinestatic

Definition at line 209 of file watcher.cpp.

◆ check_if_renamed()

template<typename Container >
static auto fs::watcher::impl::check_if_renamed ( entry & e,
Container & container ) -> bool
inlinestatic

Definition at line 230 of file watcher.cpp.

◆ check_if_same_extension()

static auto fs::watcher::impl::check_if_same_extension ( const fs::path & p1,
const fs::path & p2 ) -> bool
inlinestatic

Definition at line 192 of file watcher.cpp.

◆ get_original_path()

static auto fs::watcher::impl::get_original_path ( const fs::path & old_path,
const fs::path & renamed_path,
const fs::path & new_path ) -> fs::path
inlinestatic

Definition at line 185 of file watcher.cpp.

◆ pause()

void fs::watcher::impl::pause ( )
inline

Definition at line 121 of file watcher.cpp.

◆ poll_entry()

void fs::watcher::impl::poll_entry ( const fs::path & path,
observed_changes & changes )
inline

Definition at line 339 of file watcher.cpp.

◆ process_modifications()

template<typename Container >
static void fs::watcher::impl::process_modifications ( Container & old_entries,
observed_changes & changes )
inlinestatic

Definition at line 296 of file watcher.cpp.

◆ resume()

void fs::watcher::impl::resume ( )
inline

Definition at line 126 of file watcher.cpp.

◆ watch()

void fs::watcher::impl::watch ( )
inline

Definition at line 139 of file watcher.cpp.

Friends And Related Symbol Documentation

◆ watcher

friend class watcher
friend

Definition at line 386 of file watcher.cpp.

Member Data Documentation

◆ buffered_changes_

observed_changes fs::watcher::impl::buffered_changes_
protected

Definition at line 406 of file watcher.cpp.

◆ callback_

notify_callback fs::watcher::impl::callback_
protected

Callback for list of modifications.

Definition at line 394 of file watcher.cpp.

◆ entries_

std::map<std::string, watcher::entry> fs::watcher::impl::entries_
protected

Cache watched files.

Definition at line 396 of file watcher.cpp.

◆ filter_

pattern_filter fs::watcher::impl::filter_
protected

Filter applied.

Definition at line 392 of file watcher.cpp.

◆ last_poll_

clock_t::time_point fs::watcher::impl::last_poll_ = clock_t::now()
protected

Definition at line 400 of file watcher.cpp.

◆ paused_

std::atomic<bool> fs::watcher::impl::paused_ = {false}
protected

Definition at line 404 of file watcher.cpp.

◆ poll_interval_

clock_t::duration fs::watcher::impl::poll_interval_ = 500ms
protected

Definition at line 398 of file watcher.cpp.

◆ recursive_

bool fs::watcher::impl::recursive_ = false
protected

Definition at line 402 of file watcher.cpp.

◆ root_

fs::path fs::watcher::impl::root_
protected

Path to watch.

Definition at line 390 of file watcher.cpp.


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