Add support for h file generation
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
#include <dirent.h>
|
||||
#include "Common.h"
|
||||
#include <cstring>
|
||||
#include <vector>
|
||||
|
||||
struct FileUtils
|
||||
{
|
||||
static void GetAllFiles(const std::string& folder, std::vector<std::string>& files)
|
||||
{
|
||||
DIR* dp;
|
||||
struct dirent *dirp;
|
||||
if((dp = opendir(folder.c_str())) == NULL){
|
||||
LOG_ERROR(errno);
|
||||
return;
|
||||
}
|
||||
while((dirp = readdir(dp)) != NULL)
|
||||
{
|
||||
if(dirp->d_type == DT_DIR)
|
||||
{
|
||||
if(strcmp(dirp->d_name,".") == 0)
|
||||
continue;
|
||||
if(strcmp(dirp->d_name,"..") == 0)
|
||||
continue;
|
||||
GetAllFiles(folder+dirp->d_name+"/", files);
|
||||
}
|
||||
else
|
||||
{
|
||||
files.push_back(folder+dirp->d_name);
|
||||
}
|
||||
}
|
||||
closedir(dp);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user