mirror of
https://onedev.site.tesses.net/tesses-framework
synced 2026-02-08 07:45:46 +00:00
Change version 0.0.1
This commit is contained in:
24
apps/twatch.cpp
Normal file
24
apps/twatch.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#include <TessesFramework/TessesFramework.hpp>
|
||||
|
||||
using namespace Tesses::Framework;
|
||||
using namespace Tesses::Framework::Filesystem;
|
||||
using namespace Tesses::Framework::Filesystem::Literals;
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
TF_Init();
|
||||
if(argc<2)
|
||||
{
|
||||
std::cout << "USAGE " << argv[0] << " <file|dir>" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
auto watcher=FSWatcher::Create(LocalFS,VFSPath{argv[1]});
|
||||
watcher->events = FSWatcherEventType::All;
|
||||
watcher->event = [](FSWatcherEvent& evt)->void{
|
||||
std::cout << evt.ToString() << std::endl;
|
||||
};
|
||||
watcher->SetEnabled(true);
|
||||
TF_RunEventLoop();
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user