+modelCDMProject::modelCDMProject(
+ const std::string& path,
+ const std::string& buildPath
+)
+{
+ this->path = CDMUtilities::fixPath(path);
+ //open makelists file
+ std::string pathFixed(CDMUtilities::fixPath(path));
+
+ //TODO: set pathMakeLists for windows
+ std::string pathMakeLists = pathFixed + "/CMakeLists.txt";
+
+ std::ifstream confFile;
+ confFile.open((pathMakeLists).c_str());
+
+ std::string word;
+ while(confFile.is_open() && !confFile.eof())
+ {
+ //std::cout << "leyendo " << word << std::endl;
+ //get project name
+ std::getline(confFile,word,'(');
+ std::vector<std::string> wordBits;
+ CDMUtilities::splitter::split(wordBits,word," (\n",CDMUtilities::splitter::no_empties);
+
+ if(wordBits[wordBits.size()-1] == "PROJECT")
+ {
+ std::getline(confFile,word,')');
+ std::vector<std::string> nameBits;
+ CDMUtilities::splitter::split(nameBits, word, " ", CDMUtilities::splitter::no_empties);
+
+ this->name = "";
+ for (int i = 0; i < nameBits.size(); i++)
+ {
+ if(i != 0)
+ this->name += " ";
+ this->name += nameBits[i];
+ }
+
+ }
+
+
+ if(wordBits[wordBits.size()-1] == "SET")
+ {
+ //get project version
+ std::getline(confFile,word,')');
+ if(word.find("PROJECT_MAJOR_VERSION") != std::string::npos)
+ {
+ std::vector<std::string> versionBits;
+ CDMUtilities::splitter::split(versionBits, word, " ", CDMUtilities::splitter::no_empties);
+ version = versionBits[versionBits.size()-1];
+ }
+ if(word.find("PROJECT_MINOR_VERSION") != std::string::npos)
+ {
+ std::vector<std::string> versionBits;
+ CDMUtilities::splitter::split(versionBits, word, " ", CDMUtilities::splitter::no_empties);
+ version += "." + versionBits[versionBits.size()-1];
+ }
+ if(word.find("PROJECT_BUILD_VERSION") != std::string::npos)
+ {
+ std::vector<std::string> versionBits;
+ CDMUtilities::splitter::split(versionBits, word, " ", CDMUtilities::splitter::no_empties);
+ version += "." + versionBits[versionBits.size()-1];
+ }
+
+ //get project versionDate
+ if(word.find("PROJECT_VERSION_DATE") != std::string::npos)
+ {
+ std::vector<std::string> versionBits;
+ CDMUtilities::splitter::split(versionBits, word, " \"", CDMUtilities::splitter::no_empties);
+ versionDate = versionBits[versionBits.size()-1];
+ }
+ //get project buildPath
+
+ if (buildPath != "")
+ {
+ this->buildPath = buildPath;
+ }
+ else
+ {
+ this->buildPath = this->path + "Bin";
+ }
+ }
+ }
+ confFile.close();
+
+ this->type = wxDIR_DIRS;
+ this->level = 0;
+
+ //TODO: implement method
+ //if appli exist create Appli
+ this->appli = NULL;
+ //if lib exist create Lib
+ this->lib = NULL;
+ //if bbtk_* exist create Packages
+
+
+}
+
+modelCDMProject::~modelCDMProject()
+{
+ if(this->appli != NULL)
+ {
+ delete this->appli;
+ this->appli = NULL;
+ }
+ if(this->lib != NULL)
+ {
+ delete this->lib;
+ this->lib = NULL;
+ }
+ for (int i = 0; i < this->packages.size(); i++)
+ {
+ if(this->packages[i] != NULL)
+ {
+ delete this->packages[i];
+ this->packages[i] = NULL;
+ }
+ }
+}
+
+const std::string&
+modelCDMProject::GetName() const
+{
+ return this->name;
+}
+
+const std::string&
+modelCDMProject::GetVersion() const
+{
+ return this->version;
+}
+
+const std::string&
+modelCDMProject::GetVersionDate() const
+{
+ return this->versionDate;
+}
+
+const std::string&
+modelCDMProject::GetBuildPath() const
+{
+ return this->buildPath;
+}
+
+bool modelCDMProject::SetVersion(const std::string& version, std::string*& result)
+{
+ //TODO: implement method
+ return true;
+}
+
+bool modelCDMProject::SetBuildPath(const std::string& path, std::string*& result)
+{
+ //TODO: implement method
+ return true;
+}
+
+bool modelCDMProject::CreatePackage(
+ const std::string& name,
+ std::string*& result,
+ const std::string& authors,
+ const std::string& authorsEmail,
+ const std::string& version,
+ const std::string& description
+)
+{
+ //TODO: implement method
+ return true;
+}
+
+bool modelCDMProject::CreateLibrary(
+ const std::string& name,
+ std::string*& result,
+ const std::string& path
+)
+{
+ //TODO: implement method
+ return true;
+}
+
+bool modelCDMProject::CreateApplication(
+ const std::string& name,
+ std::string*& result,
+ const std::string& path
+)
+{
+ //TODO: implement method
+ return true;
+}
+
+bool modelCDMProject::CreateBlackBox(
+ const std::string& name,
+ const std::string& package,
+ const std::string& authors,
+ const std::string& authorsEmail,
+ const std::string& categories,
+ const std::string& description
+)
+{
+ //TODO: implement method
+ return true;
+}
+
+bool modelCDMProject::OpenCMakeListsFile(std::string*& result)
+{
+ //TODO: implement method
+ return true;
+}
+
+const bool modelCDMProject::Refresh(std::string*& result)
+{
+ //TODO: implement method
+ return true;
+}
+
+bool modelCDMProject::ConfigureBuild(std::string*& result)
+{
+ //TODO: implement method
+ return true;
+}
+
+bool modelCDMProject::Build(std::string*& result)
+{
+ //TODO: implement method
+ return true;
+}
+
+bool modelCDMProject::Connect(std::string*& result)
+{
+ //TODO: implement method
+ return true;
+}