1 /* Copyright 2012-present Facebook, Inc.
2  * Licensed under the Apache License, Version 2.0 */
3 #pragma once
4 #include "FileInformation.h"
5 
6 struct watchman_dir_ent {
7   bool has_stat;
8   char *d_name;
9   watchman::FileInformation stat;
10 };
11 
12 class watchman_dir_handle {
13  public:
14   virtual ~watchman_dir_handle() = default;
15   virtual const watchman_dir_ent* readDir() = 0;
16 #ifndef _WIN32
17   virtual int getFd() const = 0;
18 #endif
19 };
20 
21 // Return a dir handle on path.
22 // Does not follow symlinks strict == true.
23 // Throws std::system_error if the dir could not be opened.
24 std::unique_ptr<watchman_dir_handle> w_dir_open(
25     const char* path,
26     bool strict = true);
27