this->CMakeLists = NULL;
}
-modelCDMPackageSrc::modelCDMPackageSrc(const std::string& path, const int& level)
+modelCDMPackageSrc::modelCDMPackageSrc(const std::string& path, const std::string& name, const int& level)
{
//set attributes
this->children.clear();
this->level = level;
this->CMakeLists = NULL;
this->length = 0;
- this->name = "src";
+ this->name = name;
this->path = CDMUtilities::fixPath(path);
this->type = wxDIR_DIRS;
std::string stdfileName = crea::wx2std(fileName);
//if is an unknown folder, create folder
- this->children.push_back(new modelCDMFolder(path + "/" + stdfileName, this->level + 1));
+ this->children.push_back(new modelCDMFolder(path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1));
cont = dir.GetNext(&fileName);
}
if (cont)
{
std::string stdfileName = crea::wx2std(fileName);
- this->CMakeLists = new modelCDMCMakeListsFile(path + "/" + stdfileName, this->level + 1);
+ this->CMakeLists = new modelCDMCMakeListsFile(path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
this->children.push_back(this->CMakeLists);
}
if(stdfileName.substr(0,2) == "bb")
{
- file = new modelCDMFile(path + "/" + stdfileName, this->level + 1);
+ file = new modelCDMFile(path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
this->children.push_back(file);
- modelCDMBlackBox* blackBox = new modelCDMBlackBox(stdfileName, path, level + 1);
+ modelCDMBlackBox* blackBox = new modelCDMBlackBox(path, stdfileName.substr(2,stdfileName.size()-4), level + 1);
blackBox->SetHeaderFile(file);
- cont = dir.GetFirst(&fileName, crea::std2wx(stdfileName.substr(0,stdfileName.size()-2) + ".cxx"), wxDIR_FILES);
+ wxDir dir2(crea::std2wx(path));
+ cont = dir2.GetFirst(&fileName, crea::std2wx(stdfileName.substr(0,stdfileName.size()-2) + ".cxx"), wxDIR_FILES);
if (cont)
{
- file = new modelCDMFile(path + "/" + crea::wx2std(fileName), this->level + 1);
+ file = new modelCDMFile(path + CDMUtilities::SLASH + crea::wx2std(fileName), crea::wx2std(fileName), this->level + 1);
this->children.push_back(file);
blackBox->SetSourceFile(file);
}
return this->blackBoxes;
}
+modelCDMBlackBox* modelCDMPackageSrc::CreateBlackBox(
+ const std::string& name,
+ const std::string& package,
+ const std::string& type,
+ const std::string& format,
+ const std::string& authors,
+ const std::string& authorsEmail,
+ const std::string& categories,
+ const std::string& description)
+{
+ //TODO: implement method
+ return NULL;
+}
+
const bool modelCDMPackageSrc::Refresh(std::string*& result)
{
//set attributes
}
if(!found)
{
- modelCDMFolder* folder = new modelCDMFolder(this->path + "/" + stdfileName, this->level + 1);
+ modelCDMFolder* folder = new modelCDMFolder(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
this->children.push_back(folder);
}
cont = dir.GetNext(&fileName);
{
if (this->CMakeLists == NULL)
{
- this->CMakeLists = new modelCDMCMakeListsFile(this->path + "/" + stdfileName, this->level + 1);
+ this->CMakeLists = new modelCDMCMakeListsFile(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
this->children.push_back(this->CMakeLists);
}
else
if(!found)
{
- modelCDMFile* file = new modelCDMFile(this->path + "/" + stdfileName, this->level + 1);
+ modelCDMFile* file = new modelCDMFile(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
this->children.push_back(file);
}
}
if (!found)
{
- modelCDMBlackBox* blackBox = new modelCDMBlackBox(stdfileName, path + "/" + stdfileName, level + 1);
+ modelCDMBlackBox* blackBox = new modelCDMBlackBox(path, stdfileName.substr(2,stdfileName.size()-4), level + 1);
this->blackBoxes.push_back(blackBox);
}