#include "modelCDMLib.h"
+#include "CDMUtilities.h"
#include "creaWx.h"
#include "wx/dir.h"
this->name = "lib";
this->level = level;
this->path = path;
+
+
+
+ this->path = CDMUtilities::fixPath(path);
+ //open makelists file
+ std::string pathFixed(CDMUtilities::fixPath(path));
+
+ this->libraries.clear();
+ wxDir dir(crea::std2wx((pathFixed).c_str()));
+ if (dir.IsOpened())
+ {
+ wxString fileName;
+ bool cont = dir.GetFirst(&fileName, wxEmptyString, wxDIR_DIRS);
+ while (cont)
+ {
+ std::string stdfileName = crea::wx2std(fileName);
+
+ modelCDMLibrary* library = new modelCDMLibrary(pathFixed + "/" + stdfileName, this->level + 1);
+ this->libraries.push_back(library);
+ this->children.push_back(library);
+
+ cont = dir.GetNext(&fileName);
+ }
+
+ }
+ this->SortChildren();
}
modelCDMLib::~modelCDMLib()
{
+ for (int i = 0; i < this->libraries.size(); i++)
+ {
+ if(this->libraries[i] != NULL)
+ {
+ delete this->libraries[i];
+ this->libraries[i] = NULL;
+ }
+ }
}
bool modelCDMLib::CreateLibrary(