NREB_Folder.hpp
Go to the documentation of this file.
1 
10  #include <vector>
11  #include <fstream>
12  #include <sstream>
13 
14  #include "../NREB_Entry.hpp"
15  #include "../File/NREB_File.hpp"
16  #include "../../Config/NREB_Config.hpp"
17 
18  #pragma once
19 
24  namespace NREB {
29  namespace IO {
30 
35  class Folder : public Entry {
36  private : // Fields
37  EntryList childs;
39  public: // Methods
40  //## Constructor ##//
46  Folder(std::string const& n, Entry* p = nullptr);
47 
48  //## Deconstructor ##//
52  ~Folder();
53 
54  //## Methods ##//
58  void analyse();
65  void createMakefile(FileList& files, FolderList& folders, std::string const& src = "src") const;
72  void createProjectMakefile(FileList& files, FolderList& folders, std::string const& src = "src") const;
77  void createArchiverScript(FileList& files) const;
81  bool hasFileChild() const;
85  bool hasFolderChild() const;
89  bool hasDeepSources() const;
93  bool isFile() const override;
97  bool isFolder() const override;
101  bool notOnlyHeaders() const;
106  FileList getSourceChild() const;
111  FileList getHeaderChild() const;
116  FolderList getFolderChild() const;
120  std::string getBackwardPath() const;
124  std::string getObjectPath() const;
128  std::string getUpperName() const;
132  bool hasCppSource() const;
136  bool hasCppHeader() const;
140  bool hasCSource() const;
144  bool hasCHeader() const;
150  void insertFileChilds(std::ofstream& file, FileList& files) const;
156  void insertFolderChilds(std::ofstream& file, FolderList& folders) const;
163  void insertTarget(std::ofstream& file, bool hasFolder, bool hasFile) const;
168  void insertFolderCalls(std::ofstream& file) const;
173  void insertFileCall(std::ofstream& file) const;
179  bool isExcluded(std::string const& path);
180  };
181  }
182  }
void createMakefile(FileList &files, FolderList &folders, std::string const &src="src") const
Definition: NREB_Folder.cpp:35
bool isFile() const override
Definition: NREB_Folder.cpp:166
bool hasCHeader() const
Definition: NREB_Folder.cpp:263
void insertTarget(std::ofstream &file, bool hasFolder, bool hasFile) const
Definition: NREB_Folder.cpp:293
bool hasFileChild() const
Definition: NREB_Folder.cpp:134
void insertFolderCalls(std::ofstream &file) const
Definition: NREB_Folder.cpp:304
bool hasCppHeader() const
Definition: NREB_Folder.cpp:243
Builder&#39;s IO module.
bool notOnlyHeaders() const
Definition: NREB_Folder.cpp:174
FileList getSourceChild() const
Definition: NREB_Folder.cpp:186
void insertFileChilds(std::ofstream &file, FileList &files) const
Definition: NREB_Folder.cpp:273
void insertFolderChilds(std::ofstream &file, FolderList &folders) const
Definition: NREB_Folder.cpp:283
FolderList getFolderChild() const
Definition: NREB_Folder.cpp:206
Represent a folder entry.
Definition: NREB_Folder.hpp:35
Represent a system entry.
Definition: NREB_Entry.hpp:32
void createArchiverScript(FileList &files) const
Definition: NREB_Folder.cpp:111
FileList getHeaderChild() const
Definition: NREB_Folder.cpp:196
Folder(std::string const &n, Entry *p=nullptr)
Definition: NREB_Folder.cpp:17
The NRE-Builder global namespace.
Definition: NREB_Config.cpp:12
std::string getObjectPath() const
Definition: NREB_Folder.cpp:223
~Folder()
Definition: NREB_Folder.cpp:29
std::string getUpperName() const
Definition: NREB_Folder.cpp:227
bool hasFolderChild() const
Definition: NREB_Folder.cpp:144
void insertFileCall(std::ofstream &file) const
Definition: NREB_Folder.cpp:314
bool isExcluded(std::string const &path)
Definition: NREB_Folder.cpp:331
bool isFolder() const override
Definition: NREB_Folder.cpp:170
bool hasCSource() const
Definition: NREB_Folder.cpp:253
bool hasCppSource() const
Definition: NREB_Folder.cpp:233
bool hasDeepSources() const
Definition: NREB_Folder.cpp:154
std::string getBackwardPath() const
Definition: NREB_Folder.cpp:216
void createProjectMakefile(FileList &files, FolderList &folders, std::string const &src="src") const
Definition: NREB_Folder.cpp:59