feat: implement file watching functionality in the filesystem module
- Added methods for file watching, including `watch`, `unwatch`, `unwatchAll`, `getWatchCount`, `pollWatch`, `getLastWatchPath`, and `getLastWatchRealPath`. - Enhanced the `Filesystem` class to support monitoring file changes, allowing for real-time updates. - Updated the `physfs` implementation to handle file watch targets and events. - Improved documentation and added unit tests to validate the new file watching features. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
477ffb630e
commit
73c779f87f
55 files changed
+5143
-106
No files matched your search
@@ -0,0 +1,33 @@
|
||||
#include "ui/Component.h"
|
||||
|
||||
#include "ui/UISystem.h"
|
||||
|
||||
namespace eve::ui {
|
||||
|
||||
void Component::attach(UIHost *host) {
|
||||
host_ = host;
|
||||
dirty_ = true;
|
||||
}
|
||||
|
||||
void Component::mountAs(const std::string &hostName) {
|
||||
UIHost *h = UISystem::findHost(hostName);
|
||||
if (!h) h = UIHost::createHost(hostName);
|
||||
attach(h);
|
||||
rebuild(true);
|
||||
}
|
||||
|
||||
void Component::rebuild(bool forceFull) {
|
||||
if (!host_) return;
|
||||
WidgetDesc tree = build();
|
||||
if (forceFull) host_->setTree(std::move(tree));
|
||||
else host_->setTreeReconcile(std::move(tree));
|
||||
dirty_ = false;
|
||||
}
|
||||
|
||||
bool Component::updateIfDirty() {
|
||||
if (!dirty_ || !host_) return false;
|
||||
rebuild(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace eve::ui
|
||||
Reference in new issue
Block a user