+
+ //check all folders and files
+ wxDir dir(crea::std2wx((path).c_str()));
+ if (dir.IsOpened())
+ {
+ wxString fileName;
+
+ //folders
+ bool cont = dir.GetFirst(&fileName, wxEmptyString, wxDIR_DIRS);
+ while (cont)
+ {
+ std::string stdfileName = crea::wx2std(fileName);
+ //if src, check for black boxes
+ if(stdfileName == "src")
+ {
+ wxDir srcF(crea::std2wx((path + delimiters + "src").c_str()));
+ if (srcF.IsOpened())
+ {
+ wxString srcName;
+ bool innerCont = srcF.GetFirst(&srcName, wxT("*.h"), wxDIR_FILES);
+ while (innerCont)
+ {
+ if(crea::wx2std(srcName.substr(0,2)) == "bb")
+ {
+ modelCDMBlackBox* blackbox = new modelCDMBlackBox(crea::wx2std(srcName), path + delimiters + "src", this->level + 1);
+ this->blackBoxes.push_back(blackbox);
+ this->children.push_back(blackbox);
+ }
+ innerCont = srcF.GetNext(&srcName);
+ }
+ }
+ }
+ //if is an unknown folder, create folder
+ else
+ {
+ this->children.push_back(new modelCDMFolder(path + delimiters + stdfileName, this->level + 1));
+ }
+ cont = dir.GetNext(&fileName);
+ }
+
+ //files
+ cont = dir.GetFirst(&fileName, wxEmptyString, wxDIR_FILES);
+ while (cont)
+ {
+ std::string stdfileName = crea::wx2std(fileName);
+
+ //if CMakeLists, create CMakeLists
+ if(stdfileName == "CMakeLists.txt")
+ {
+ this->CMakeLists = new modelCDMCMakeListsFile(path + delimiters + stdfileName, this->level + 1);
+ this->children.push_back(this->CMakeLists);
+ }
+ else
+ {
+ this->children.push_back(new modelCDMFile(path + delimiters + stdfileName, this->level + 1));
+ }
+ //if is an unknown file, create file
+ cont = dir.GetNext(&fileName);
+ }
+ }
+ this->SortChildren();