std::string*& result,
const std::string& authors,
const std::string& authorsEmail,
- const std::string& version,
- const std::string& description
+ const std::string& description,
+ const std::string& version
)
{
- //TODO: implement method
- return NULL;
+ //fixing input parameters
+ std::vector<std::string> words;
+
+ CDMUtilities::splitter::split(words,name," ",CDMUtilities::splitter::no_empties);
+ std::string nameFixed = "";
+ for (int i = 0; i < words.size(); i++)
+ {
+ nameFixed += words[i];
+ }
+
+ words.clear();
+ CDMUtilities::splitter::split(words,authors," ",CDMUtilities::splitter::no_empties);
+ std::string authorFixed;
+ for (int i = 0; i < words.size(); i++)
+ {
+ authorFixed += words[i];
+ }
+
+ words.clear();
+ std::string descriptionFixed;
+ CDMUtilities::splitter::split(words,authorsEmail," ",CDMUtilities::splitter::no_empties);
+ for (int i = 0; i < words.size(); i++)
+ {
+ descriptionFixed += words[i];
+ }
+ words.clear();
+ CDMUtilities::splitter::split(words,description," ",CDMUtilities::splitter::no_empties);
+ for (int i = 0; i < words.size(); i++)
+ {
+ descriptionFixed += "_" + words[i];
+ }
+
+ //call project to create package : use bbCreatePackage <path> <name> [author] [description]
+ std::string creationCommand = "bbCreatePackage \"" + this->path + "\" " + nameFixed + " " + authorFixed + " " + descriptionFixed;
+ //TODO: bbCreatePackage script always returning 0. It should return 1 or greater if any error
+ if(system(creationCommand.c_str()))
+ {
+ result = new std::string("An error occurred while running '" + creationCommand + "'.");
+ return NULL;
+ }
+
+ //add library to model
+ //TODO: fix for windows
+ modelCDMPackage* package = new modelCDMPackage(this->path + "/bbtk_" + nameFixed + "_PKG", this->level + 1);
+ this->packages.push_back(package);
+ this->children.push_back(package);
+
+ //TODO: set package version
+
+ this->SortChildren();
+
+ result = new std::string(this->path + "/" + name);
+ return package;
}
modelCDMIProjectTreeNode* modelCDMProject::CreateLibrary(
const std::string& path
)
{
- //TODO: implement method
- return NULL;
+ if(this->appli != NULL)
+ {
+ return this->appli->CreateApplication(name, result);
+ }
+ result = new std::string("there is no appli folder in this project.");
+ return NULL;
}
modelCDMIProjectTreeNode* modelCDMProject::CreateBlackBox(
if(!checkedPackages[i])
{
this->packages.erase(this->packages.begin()+i);
- checkedPackages.erase(checkedPackages.begin()+i);
- i--;
+ checkedPackages.erase(checkedPackages.begin()+i);
+ i--;
}
}
for (int i = 0; i < checked.size(); i++)