11
22#include < inotify-cpp/Inotify.h>
33
4+ #include < iostream>
5+ #include < optional>
46#include < string>
57#include < vector>
6- #include < iostream>
78
89#include < sys/epoll.h>
910#include < fcntl.h>
1011#include < unistd.h>
1112
12- namespace fs = boost ::filesystem;
13+ namespace fs = std ::filesystem;
1314
1415namespace inotify {
1516
@@ -97,14 +98,15 @@ Inotify::~Inotify()
9798 */
9899void Inotify::watchDirectoryRecursively (fs::path path)
99100{
100- std::vector<boost ::filesystem::path> paths;
101+ std::vector<std ::filesystem::path> paths;
101102
102103 if (fs::exists (path)) {
103104 paths.push_back (path);
104105
105106 if (fs::is_directory (path)) {
106- boost::system::error_code ec;
107- fs::recursive_directory_iterator it (path, fs::symlink_option::recurse, ec);
107+ std::error_code ec;
108+ fs::recursive_directory_iterator it (
109+ path, fs::directory_options::follow_directory_symlink, ec);
108110 fs::recursive_directory_iterator end;
109111
110112 for (; it != end; it.increment (ec)) {
@@ -234,7 +236,7 @@ void Inotify::setEventTimeout(
234236 * @return A new FileSystemEvent
235237 *
236238 */
237- boost ::optional<FileSystemEvent> Inotify::getNextEvent ()
239+ std ::optional<FileSystemEvent> Inotify::getNextEvent ()
238240{
239241 std::vector<FileSystemEvent> newEvents;
240242
@@ -245,7 +247,7 @@ boost::optional<FileSystemEvent> Inotify::getNextEvent()
245247 }
246248
247249 if (mStopped ) {
248- return boost::none ;
250+ return std:: nullopt ;
249251 }
250252
251253 auto event = mEventQueue .front ();
0 commit comments