forked from facebook/watchman
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Apply our C++ conventions to opendir. Now it's DirHandle, and both UnixDirHandle.cpp and WinDirHandle.cpp are included in the build on every platform. Reviewed By: zhengchaol Differential Revision: D31348996 fbshipit-source-id: e980319ba0fa9d39e996a71ec14009ef97324c63
- Loading branch information
1 parent
cffe7ba
commit 24c4764
Showing
21 changed files
with
112 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <memory> | ||
#include "watchman/FileInformation.h" | ||
|
||
namespace watchman { | ||
|
||
struct DirEntry { | ||
bool has_stat; | ||
char* d_name; | ||
FileInformation stat; | ||
}; | ||
|
||
class DirHandle { | ||
public: | ||
virtual ~DirHandle() = default; | ||
virtual const DirEntry* readDir() = 0; | ||
#ifndef _WIN32 | ||
virtual int getFd() const = 0; | ||
#endif | ||
}; | ||
|
||
/** | ||
* Returns a dir handle to path. | ||
* Does not follow symlinks if strict == true. | ||
* Throws std::system_error if the dir could not be opened. | ||
*/ | ||
std::unique_ptr<DirHandle> openDir(const char* path, bool strict = true); | ||
|
||
} // namespace watchman |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.