-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement FolderFileWatcher #2336
Conversation
@check-spelling-bot ReportUnrecognized words, please review:
Previously acknowledged words that are now absentactivatable amd Archs dsc efgh enr FWW Globals hackathon lww mytool OSVERSION Packagedx parametermap pathpaths symlink Uninitialize WDAG whatif wsbTo accept these unrecognized words as correct (and remove the previously acknowledged and now absent words), run the following commands... in a clone of the git@github.com:msftrubengu/winget-cli.git repository
|
src/AppInstallerCommonCore/pch.h
Outdated
#include <vector> | ||
#include <unordered_set> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include <vector> | |
#include <unordered_set> | |
#include <unordered_set> | |
#include <vector> |
T U V #Resolved
namespace AppInstaller::Utility | ||
{ | ||
// Watch for new/renamed files recursively in a given directory. | ||
struct FolderFileWatcher |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't a FolderFileWatcher
just a FolderFileExtensionWatcher
with a null_opt
optional extension to look for? #Resolved
FolderFileWatcher(FolderFileWatcher&&) = delete; | ||
FolderFileWatcher& operator=(FolderFileWatcher&&) = delete; | ||
|
||
void start(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
void start(); | |
void Start(); |
Uppercase function names. #Resolved
{ | ||
if (m_changeReader) | ||
{ | ||
this->stop(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems unnecessary so long as Stop
is implemented as delete m_changeReader
which will happen at the end of the function anyway. #Resolved
private: | ||
std::filesystem::path m_path; | ||
std::string m_ext; | ||
std::unordered_set<std::string> m_files; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::unordered_set<std::string> m_files; | |
std::unordered_set<std::filesystem::path> m_files; |
Why not this? #Resolved
// The file was renamed and this is the new name. | ||
case wil::FolderChangeEvent::RenameNewName: | ||
{ | ||
std::filesystem::path path = m_path / std::filesystem::path(filePath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would think it fine to store just the relative path if that is what we are given. The user of this can recombine the two if they want. #Resolved
@check-spelling-bot ReportUnrecognized words, please review:
Previously acknowledged words that are now absentactivatable amd Archs dsc efgh enr FWW Globals hackathon lww mytool OSVERSION Packagedx parametermap pathpaths symlink Uninitialize WDAG whatif wsbTo accept these unrecognized words as correct (and remove the previously acknowledged and now absent words), run the following commands... in a clone of the git@github.com:msftrubengu/winget-cli.git repository
|
Implement wrapper around wil::unique_folder_change_reader to track new files created under a directory.
Also Visual Studio 2022 removing some extra spaces in vcproj files
Microsoft Reviewers: Open in CodeFlow