poco/Foundation/testsuite/src/DirectoryWatcherTest.h
Roger Meier b0581433a7 LICENSE: add info about SPDX-License-Identifier usage and use it
fix: remove executable flag and change back to 100644 (was 100755)

Signed-off-by: Roger Meier <r.meier@siemens.com>
2014-05-14 08:38:09 +02:00

74 lines
1.5 KiB
C++

//
// DirectoryWatcherTest.h
//
// $Id: //poco/1.4/Foundation/testsuite/src/DirectoryWatcherTest.h#1 $
//
// Definition of the DirectoryWatcherTest class.
//
// Copyright (c) 2012, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DirectoryWatcherTest_INCLUDED
#define DirectoryWatcherTest_INCLUDED
#include "Poco/Foundation.h"
#ifndef POCO_NO_INOTIFY
#include "Poco/DirectoryWatcher.h"
#include "Poco/Path.h"
#include "CppUnit/TestCase.h"
class DirectoryWatcherTest: public CppUnit::TestCase
{
public:
DirectoryWatcherTest(const std::string& name);
~DirectoryWatcherTest();
void testAdded();
void testRemoved();
void testModified();
void testMoved();
void setUp();
void tearDown();
static CppUnit::Test* suite();
protected:
void onItemAdded(const Poco::DirectoryWatcher::DirectoryEvent& ev);
void onItemRemoved(const Poco::DirectoryWatcher::DirectoryEvent& ev);
void onItemModified(const Poco::DirectoryWatcher::DirectoryEvent& ev);
void onItemMovedFrom(const Poco::DirectoryWatcher::DirectoryEvent& ev);
void onItemMovedTo(const Poco::DirectoryWatcher::DirectoryEvent& ev);
void onError(const Poco::Exception& exc);
Poco::Path path() const;
private:
struct DirEvent
{
Poco::DirectoryWatcher::DirectoryEventType type;
std::string callback;
std::string path;
};
std::vector<DirEvent> _events;
bool _error;
};
#endif // POCO_NO_INOTIFY
#endif // DirectoryWatcherTest_INCLUDED