File tree 4 files changed +35
-10
lines changed
Filter options
4 files changed +35
-10
lines changed
Original file line number Diff line number Diff line change @@ -3,4 +3,4 @@ project(natcpp)
3
3
4
4
set (CMAKE_CXX_STANDARD 20)
5
5
6
- add_executable (natcpp main.cpp args/cli_args.cpp args/cli_args.h types.h utils/string_formatting/string_effects.cpp utils/string_formatting/string_effects.h utils/string_formatting/string_coloring.cpp utils/string_formatting/string_coloring.h)
6
+ add_executable (natcpp main.cpp args/cli_args.cpp args/cli_args.h types.h utils/string_formatting/string_effects.cpp utils/string_formatting/string_effects.h utils/string_formatting/string_coloring.cpp utils/string_formatting/string_coloring.h utils/fs/handle_files.cpp utils/fs/handle_files.h )
Original file line number Diff line number Diff line change
1
+ // #include <filesystem>
2
+ // #include <vector>
1
3
#include < iostream>
2
- #include < vector>
3
4
#include < string>
4
- #include < filesystem>
5
5
#include " args/cli_args.h"
6
6
#include " types.h"
7
7
#include " utils/string_formatting/string_effects.h"
8
8
#include " utils/string_formatting/string_coloring.h"
9
+ #include " utils/fs/handle_files.h"
9
10
namespace fs = std::filesystem;
10
11
11
- std::vector<fs::directory_entry> get_files (const std::string& dir_name) {
12
- std::vector<fs::directory_entry> res = {};
13
- for (const auto & f : fs::directory_iterator (dir_name))
14
- res.push_back (f);
15
- return res;
16
- }
17
-
18
12
int main (int argc, char * argv[]) {
19
13
auto args = parse_args ();
20
14
auto f = get_files (" ." );
Original file line number Diff line number Diff line change
1
+ //
2
+ // Created by Will Lane on 2/3/21.
3
+ //
4
+
5
+ #include " handle_files.h"
6
+ #include < filesystem>
7
+ #include < vector>
8
+ #include < string>
9
+ namespace fs = std::filesystem;
10
+
11
+ std::vector<fs::directory_entry> get_files (const std::string& dir_name) {
12
+ std::vector<fs::directory_entry> res = {};
13
+ for (const auto & f : fs::directory_iterator (dir_name))
14
+ res.push_back (f);
15
+ return res;
16
+ }
Original file line number Diff line number Diff line change
1
+ //
2
+ // Created by Will Lane on 2/3/21.
3
+ //
4
+
5
+ #ifndef NATCPP_HANDLE_FILES_H
6
+ #define NATCPP_HANDLE_FILES_H
7
+
8
+ #include < filesystem>
9
+ #include < vector>
10
+ #include < string>
11
+ namespace fs = std::filesystem;
12
+
13
+ std::vector<fs::directory_entry> get_files (const std::string&);
14
+
15
+ #endif // NATCPP_HANDLE_FILES_H
You can’t perform that action at this time.
0 commit comments