clang  14.0.0git
Public Types | Public Member Functions | Public Attributes | List of all members
clang::DirectoryWatcher::Event Struct Reference

#include "clang/DirectoryWatcher/DirectoryWatcher.h"

Collaboration diagram for clang::DirectoryWatcher::Event:
Collaboration graph

Public Types

enum  EventKind { EventKind::Removed, EventKind::Modified, EventKind::WatchedDirRemoved, EventKind::WatcherGotInvalidated }

Public Member Functions

 Event (EventKind Kind, llvm::StringRef Filename)

Public Attributes

EventKind Kind
std::string Filename
 Filename that this event is related to or an empty string in case this event is related to the watched directory itself. More...

Detailed Description

Definition at line 66 of file DirectoryWatcher.h.

Member Enumeration Documentation

◆ EventKind


Content of a file was modified.


The watched directory got deleted.


The DirectoryWatcher that originated this event is no longer valid and its behavior is unspecified.

The prime case is kernel signalling to OS-specific implementation of DirectoryWatcher some resource limit being hit. Usually kernel starts dropping or squashing events together after that and so would DirectoryWatcher. This means that some events might still be passed to Receiver but this behavior is unspecified.

Another case is after the watched directory itself is deleted. WatcherGotInvalidated will be received at least once during DirectoryWatcher instance lifetime - when handling errors this is done on best effort basis, when an instance is being destroyed then this is guaranteed.

The only proper response to this kind of event is to destruct the originating DirectoryWatcher instance and create a new one.

Definition at line 67 of file DirectoryWatcher.h.

Constructor & Destructor Documentation

◆ Event()

clang::DirectoryWatcher::Event::Event ( EventKind  Kind,
llvm::StringRef  Filename 

Definition at line 98 of file DirectoryWatcher.h.

Member Data Documentation

◆ Filename

std::string clang::DirectoryWatcher::Event::Filename

Filename that this event is related to or an empty string in case this event is related to the watched directory itself.

Definition at line 96 of file DirectoryWatcher.h.

◆ Kind

EventKind clang::DirectoryWatcher::Event::Kind

Definition at line 93 of file DirectoryWatcher.h.

The documentation for this struct was generated from the following file: