mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-28 11:31:53 +01:00
Merge pull request #2881 from Ludorg/poco-1.10.0
Add an option to force the use of PollingDirectoryWatcherStrategy
This commit is contained in:
@@ -96,6 +96,9 @@
|
|||||||
// on platforms with no inotify.
|
// on platforms with no inotify.
|
||||||
// #define POCO_NO_INOTIFY
|
// #define POCO_NO_INOTIFY
|
||||||
|
|
||||||
|
// Define to force the use of PollingDirectoryWatcher
|
||||||
|
// #define POCO_DW_FORCE_POLLING
|
||||||
|
|
||||||
|
|
||||||
// Following are options to remove certain features
|
// Following are options to remove certain features
|
||||||
// to reduce library/executable size for smaller
|
// to reduce library/executable size for smaller
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#if POCO_OS == POCO_OS_WINDOWS_NT
|
#if (POCO_OS == POCO_OS_WINDOWS_NT) && !defined(POCO_DW_FORCE_POLLING)
|
||||||
|
|
||||||
|
|
||||||
class WindowsDirectoryWatcherStrategy: public DirectoryWatcherStrategy
|
class WindowsDirectoryWatcherStrategy: public DirectoryWatcherStrategy
|
||||||
@@ -248,7 +248,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#elif POCO_OS == POCO_OS_LINUX || POCO_OS == POCO_OS_ANDROID
|
#elif (POCO_OS == POCO_OS_LINUX || POCO_OS == POCO_OS_ANDROID) && !defined(POCO_DW_FORCE_POLLING)
|
||||||
|
|
||||||
|
|
||||||
class LinuxDirectoryWatcherStrategy: public DirectoryWatcherStrategy
|
class LinuxDirectoryWatcherStrategy: public DirectoryWatcherStrategy
|
||||||
@@ -376,7 +376,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#elif POCO_OS == POCO_OS_MAC_OS_X || POCO_OS == POCO_OS_FREE_BSD
|
#elif (POCO_OS == POCO_OS_MAC_OS_X || POCO_OS == POCO_OS_FREE_BSD) && !defined(POCO_DW_FORCE_POLLING)
|
||||||
|
|
||||||
|
|
||||||
class BSDDirectoryWatcherStrategy: public DirectoryWatcherStrategy
|
class BSDDirectoryWatcherStrategy: public DirectoryWatcherStrategy
|
||||||
@@ -566,11 +566,11 @@ void DirectoryWatcher::init()
|
|||||||
if (!_directory.isDirectory())
|
if (!_directory.isDirectory())
|
||||||
throw Poco::InvalidArgumentException("not a directory", _directory.path());
|
throw Poco::InvalidArgumentException("not a directory", _directory.path());
|
||||||
|
|
||||||
#if POCO_OS == POCO_OS_WINDOWS_NT
|
#if (POCO_OS == POCO_OS_WINDOWS_NT) && !defined(POCO_DW_FORCE_POLLING)
|
||||||
_pStrategy = new WindowsDirectoryWatcherStrategy(*this);
|
_pStrategy = new WindowsDirectoryWatcherStrategy(*this);
|
||||||
#elif POCO_OS == POCO_OS_LINUX || POCO_OS == POCO_OS_ANDROID
|
#elif (POCO_OS == POCO_OS_LINUX || POCO_OS == POCO_OS_ANDROID) && !defined(POCO_DW_FORCE_POLLING)
|
||||||
_pStrategy = new LinuxDirectoryWatcherStrategy(*this);
|
_pStrategy = new LinuxDirectoryWatcherStrategy(*this);
|
||||||
#elif POCO_OS == POCO_OS_MAC_OS_X || POCO_OS == POCO_OS_FREE_BSD
|
#elif (POCO_OS == POCO_OS_MAC_OS_X || POCO_OS == POCO_OS_FREE_BSD) && !defined(POCO_DW_FORCE_POLLING)
|
||||||
_pStrategy = new BSDDirectoryWatcherStrategy(*this);
|
_pStrategy = new BSDDirectoryWatcherStrategy(*this);
|
||||||
#else
|
#else
|
||||||
_pStrategy = new PollingDirectoryWatcherStrategy(*this);
|
_pStrategy = new PollingDirectoryWatcherStrategy(*this);
|
||||||
|
|||||||
Reference in New Issue
Block a user