cellar/src/cellar.cpp

29 lines
720 B
C++
Raw Normal View History

2017-03-12 17:13:07 -07:00
#include <iostream>
#include <string>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/path.hpp>
namespace fs = boost::filesystem;
2017-03-12 15:43:11 -07:00
int main(int argc, char* argv[]) {
2017-03-12 17:13:07 -07:00
fs::path cwd(fs::current_path());
cwd = fs::system_complete(".");
fs::directory_iterator iter_end;
for (fs::directory_iterator iter_cwd(cwd); iter_cwd != iter_end; ++iter_cwd) {
try {
std::string item = iter_cwd->path().filename().native();
std::cout << item;
std::cout << " ";
}
catch (const std::exception& exc) {
std::cout << "fuck" << std::endl;
return 1;
}
}
std::cout << std::endl;
return 0;
2017-03-12 15:43:11 -07:00
}