while (cont)
{
std::string stdfileName = crea::wx2std(fileName);
+ std::size_t fileTypePos = stdfileName.find_last_of(".");
+ std::string fileType = stdfileName.substr(fileTypePos);
//if CMakeLists, create CMakeLists
if(stdfileName == "CMakeLists.txt")
this->CMakeLists = new modelCDMCMakeListsFile(this, pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
this->children.push_back(this->CMakeLists);
}
+ //if is a code file, create modelCDMCodeFile
+ else if(
+ fileType == ".c" ||
+ fileType == ".cxx" ||
+ fileType == ".h" ||
+ fileType == ".cpp" ||
+ fileType == ".txx" ||
+ fileType == ".cmake" )
+ {
+ this->children.push_back(new modelCDMCodeFile(this, pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1));
+ }
//if is an unknown file, create file
else
{
while (cont)
{
std::string stdfileName = crea::wx2std(fileName);
+ std::size_t fileTypePos = stdfileName.find_last_of(".");
+ std::string fileType = stdfileName.substr(fileTypePos);
//if CMakeLists, create CMakeLists
if(stdfileName == "CMakeLists.txt")
return false;
}
}
+ //if is a code file, create modelCDMCodeFile
//if is an unknown file, create file
else
{
if(!found)
{
- modelCDMFile* file = new modelCDMFile(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
- this->children.push_back(file);
+ if(
+ fileType == ".c" ||
+ fileType == ".cxx" ||
+ fileType == ".h" ||
+ fileType == ".cpp" ||
+ fileType == ".txx" ||
+ fileType == ".cmake" )
+ {
+ this->children.push_back(new modelCDMCodeFile(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1));
+ }
+ else
+ {
+ modelCDMFile* file = new modelCDMFile(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+ this->children.push_back(file);
+ }
}
}