annotate templates/main.cpp @ 0:a4671277546c tip

created the repository for the thymian project
author ferencd
date Tue, 17 Aug 2021 11:19:54 +0200
parents
children
rev   line source
ferencd@0 1 #include "templater.h"
ferencd@0 2
ferencd@0 3 #include <algorithm>
ferencd@0 4 #include <iostream>
ferencd@0 5
ferencd@0 6 #define BOOST_FILESYSTEM_NO_DEPRECATED
ferencd@0 7 #define BOOST_FILESYSTEM_VERSION 3
ferencd@0 8
ferencd@0 9 #include <iostream>
ferencd@0 10 #include "boost/filesystem.hpp"
ferencd@0 11
ferencd@0 12 using namespace std;
ferencd@0 13 using namespace boost::filesystem;
ferencd@0 14
ferencd@0 15 int main(int argc, char *argv[])
ferencd@0 16 {
ferencd@0 17 // list all files in current directory.
ferencd@0 18 //You could put any file path in here, e.g. "/home/me/mwah" to list that directory
ferencd@0 19 path p (TEMPLATES_DIRECTORY);
ferencd@0 20
ferencd@0 21 directory_iterator end_itr;
ferencd@0 22
ferencd@0 23 // cycle through the directory
ferencd@0 24 for (directory_iterator itr(p); itr != end_itr; ++itr)
ferencd@0 25 {
ferencd@0 26 // If it's not a directory, list it. If you want to list directories too, just remove this check.
ferencd@0 27 if (is_regular_file(itr->path())) {
ferencd@0 28 // assign current file name to current_file and echo it out to the console.
ferencd@0 29 string current_file = itr->path().string();
ferencd@0 30 cout << current_file << endl;
ferencd@0 31 }
ferencd@0 32 }
ferencd@0 33 }