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
{
this->children.push_back(new modelCDMFile(this, pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1));
}
- //if is an unknown file, create file
+
cont = dir.GetNext(&fileName);
}
}
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);
+ }
}
}
boost::match_flag_type flags = boost::match_default;
while(boost::regex_search(start, end, what, expression, flags))
{
- std::cout << what[0].str() << std::endl;
+ //std::cout << what[0].str() << std::endl;
boost::regex expression1 = boost::regex("USE_\\w+");
std::string::const_iterator start1, end1;
start1 = what[0].first;
{
std::string dete = what1.str();
CDMUtilities::normalizeStr(dete);
- std::cout << dete << std::endl;
+ //std::cout << dete << std::endl;
if(correspondence.find(dete) != correspondence.end())
res[correspondence[dete]] = true;
}