Represent a folder entry.
More...
#include <NREB_Folder.hpp>
|
| Folder (std::string const &n, Entry *p=nullptr) |
|
| ~Folder () |
|
void | analyse () |
|
void | createMakefile (FileList &files, FolderList &folders, std::string const &src="src") const |
|
void | createProjectMakefile (FileList &files, FolderList &folders, std::string const &src="src") const |
|
void | createArchiverScript (FileList &files) const |
|
bool | hasFileChild () const |
|
bool | hasFolderChild () const |
|
bool | hasDeepSources () const |
|
bool | isFile () const override |
|
bool | isFolder () const override |
|
bool | notOnlyHeaders () const |
|
FileList | getSourceChild () const |
|
FileList | getHeaderChild () const |
|
FolderList | getFolderChild () const |
|
std::string | getBackwardPath () const |
|
std::string | getObjectPath () const |
|
std::string | getUpperName () const |
|
bool | hasCppSource () const |
|
bool | hasCppHeader () const |
|
bool | hasCSource () const |
|
bool | hasCHeader () const |
|
void | insertFileChilds (std::ofstream &file, FileList &files) const |
|
void | insertFolderChilds (std::ofstream &file, FolderList &folders) const |
|
void | insertTarget (std::ofstream &file, bool hasFolder, bool hasFile) const |
|
void | insertFolderCalls (std::ofstream &file) const |
|
void | insertFileCall (std::ofstream &file) const |
|
bool | isExcluded (std::string const &path) |
|
| Entry (std::string const &n, Entry *p=nullptr) |
|
virtual | ~Entry ()=default |
|
std::string | getPath () const |
|
std::string const & | getName () const |
|
const Entry * | getParent () const |
|
|
static const std::string | MARKER_HEADER = ".hpp" |
|
static const std::string | MARKER_COMPILER = "CXX" |
|
static const std::string | MARKER_LINKER = "LD" |
|
static const std::string | MARKER_CFLAGS = "CFLAGS" |
|
static const std::string | MARKER_LDFLAGS = "LDFLAGS" |
|
static const std::string | MARKER_INC = "INC" |
|
static const std::string | MARKER_BIN = "BIN" |
|
static const std::string | MARKER_LIB = "LIB" |
|
static const std::string | MARKER_LIBDIR = "LIBDIR" |
|
static const std::string | MARKER_CHILDS = "childs" |
|
static const std::string | MARKER_OUT = "out" |
|
static const std::string | MARKER_TARGET = "all" |
|
static const std::string | MARKER_OBJ = "OBJ" |
|
static const std::string | MARKER_SOURCE = ".cpp" |
|
static const std::string | MARKER_SOURCE_C = ".c" |
|
static const std::string | MARKER_HEADER_C = ".h" |
|
static const std::string | MARKER_O = ".o" |
|
static const std::string | MARKER_OBJDIR = "OBJDIR" |
|
static const std::string | START_CALL = "$(" |
|
static const std::string | END_CALL = ")" |
|
static const std::string | CALL_COMPILER = START_CALL + MARKER_COMPILER + END_CALL |
|
static const std::string | CALL_CFLAGS = START_CALL + MARKER_CFLAGS + END_CALL |
|
static const std::string | CALL_INC = START_CALL + MARKER_INC + END_CALL |
|
static const std::string | CALL_OBJDIR = START_CALL + MARKER_OBJDIR + END_CALL |
|
static const std::string | CALL_OBJ = START_CALL + MARKER_OBJ + END_CALL |
|
static const std::string | MAKEFILE = "Makefile" |
|
static const std::string | ARCHIVER = "archive.sh" |
|
Represent a folder entry.
NREB::IO::Folder::Folder |
( |
std::string const & |
n, |
|
|
Entry * |
p = nullptr |
|
) |
| |
Construct an entry
- Parameters
-
n | the entry's name |
p | the entry's parent |
NREB::IO::Folder::~Folder |
( |
| ) |
|
void NREB::IO::Folder::analyse |
( |
| ) |
|
void NREB::IO::Folder::createArchiverScript |
( |
FileList & |
files | ) |
const |
Create a bash script to create object archive
- Parameters
-
files | list containing all explorated files |
void NREB::IO::Folder::createMakefile |
( |
FileList & |
files, |
|
|
FolderList & |
folders, |
|
|
std::string const & |
src = "src" |
|
) |
| const |
Create the entry corresponding makefile
- Parameters
-
files | list containing all explorated files |
folders | list containing all explorated folders |
src | the source directory |
void NREB::IO::Folder::createProjectMakefile |
( |
FileList & |
files, |
|
|
FolderList & |
folders, |
|
|
std::string const & |
src = "src" |
|
) |
| const |
Create the project main makefile
- Parameters
-
files | list containing all explorated files |
folders | list containing all explorated folders |
src | the source directory |
std::string NREB::IO::Folder::getBackwardPath |
( |
| ) |
const |
- Returns
- the path to return to src
FolderList NREB::IO::Folder::getFolderChild |
( |
| ) |
const |
Get all folder child in a vector
- Returns
- the child's vector
FileList NREB::IO::Folder::getHeaderChild |
( |
| ) |
const |
Get all header file child in a vector
- Returns
- the child's vector
std::string NREB::IO::Folder::getObjectPath |
( |
| ) |
const |
FileList NREB::IO::Folder::getSourceChild |
( |
| ) |
const |
Get all source file child in a vector
- Returns
- the child's vector
std::string NREB::IO::Folder::getUpperName |
( |
| ) |
const |
- Returns
- the entry name in upper case
bool NREB::IO::Folder::hasCHeader |
( |
| ) |
const |
- Returns
- if the folder contains c header
bool NREB::IO::Folder::hasCppHeader |
( |
| ) |
const |
- Returns
- if the folder contains cpp header
bool NREB::IO::Folder::hasCppSource |
( |
| ) |
const |
- Returns
- if the folder contains cpp sources
bool NREB::IO::Folder::hasCSource |
( |
| ) |
const |
- Returns
- if the folder contains c sources
bool NREB::IO::Folder::hasDeepSources |
( |
| ) |
const |
- Returns
- if the entry has deep sources
bool NREB::IO::Folder::hasFileChild |
( |
| ) |
const |
- Returns
- if the entry has file childs
bool NREB::IO::Folder::hasFolderChild |
( |
| ) |
const |
- Returns
- if the entry has folder childs
void NREB::IO::Folder::insertFileCall |
( |
std::ofstream & |
file | ) |
const |
Insert file compilation call
- Parameters
-
void NREB::IO::Folder::insertFileChilds |
( |
std::ofstream & |
file, |
|
|
FileList & |
files |
|
) |
| const |
Insert header to declare file compilation
- Parameters
-
file | the file output |
files | list containing all explorated files |
void NREB::IO::Folder::insertFolderCalls |
( |
std::ofstream & |
file | ) |
const |
Insert folder compilation call
- Parameters
-
void NREB::IO::Folder::insertFolderChilds |
( |
std::ofstream & |
file, |
|
|
FolderList & |
folders |
|
) |
| const |
Insert folder declaration
- Parameters
-
file | the file output |
folders | list containing all explorated file |
void NREB::IO::Folder::insertTarget |
( |
std::ofstream & |
file, |
|
|
bool |
hasFolder, |
|
|
bool |
hasFile |
|
) |
| const |
Insert compilation target
- Parameters
-
file | the file output |
hasFolder | tell if the entry has folder childs |
hasFile | tell if the entry has file childs |
bool NREB::IO::Folder::isExcluded |
( |
std::string const & |
path | ) |
|
Check if a path is excluded
- Parameters
-
- Returns
- the test result
bool NREB::IO::Folder::isFile |
( |
| ) |
const |
|
overridevirtual |
bool NREB::IO::Folder::isFolder |
( |
| ) |
const |
|
overridevirtual |
bool NREB::IO::Folder::notOnlyHeaders |
( |
| ) |
const |
- Returns
- if the folder is not only composed of headers
The documentation for this class was generated from the following files:
- /mnt/c/Users/abell/Documents/GitHub/NRE-Builder/src/IO/Folder/NREB_Folder.hpp
- /mnt/c/Users/abell/Documents/GitHub/NRE-Builder/src/IO/Folder/NREB_Folder.cpp