You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#include <FileWatch.hpp>
#include <iostream>
int main(int argc, char** args) {
//FileWatch API, see here:
//https://github.com/ThomasMonkman/filewatch
std::string FileName ="E:\\233.txt";
filewatch::FileWatch<std::string>(
FileName ,
[](const std::string& path, const filewatch::Event change_type) {
switch(change_type) {
case filewatch::Event::added:
std::cout << "The file was added to the directory." << '\n';
break;
case filewatch::Event::removed:
std::cout << "The file was removed from the directory." << '\n';
break;
case filewatch::Event::modified:
std::cout << "The file was modified. This can be a change in the time stamp or attributes." << '\n';
break;
case filewatch::Event::renamed_old:
std::cout << "The file was renamed and this is the old name." << '\n';
break;
case filewatch::Event::renamed_new:
std::cout << "The file was renamed and this is the new name." << '\n';
break;
}
}
);
std::cin.get();
}
This is the code I put in Visual Studio 2017.
But it says cannot cast from initializer list to std::basic_string<char,std::char_traits,std::allocator> (which is the class of std::string) on line 366.
The text was updated successfully, but these errors were encountered:
This is the code I put in Visual Studio 2017.
But it says cannot cast from initializer list to std::basic_string<char,std::char_traits,std::allocator> (which is the class of std::string) on line 366.
The text was updated successfully, but these errors were encountered: