2 * ControlCreaDevManagerMain.cpp
4 * Created on: 5/11/2012
8 #include "ControlCreaDevManagerMain.h"
13 ControlCreaDevManagerMain::ControlCreaDevManagerMain()
17 ControlCreaDevManagerMain::~ControlCreaDevManagerMain()
21 const modelCDMProjectsTree& ControlCreaDevManagerMain::GetActiveProjects() const
26 bool ControlCreaDevManagerMain::LoadActiveProjects()
28 // TODO LoadActiveProjects
29 std::cerr << "LoadActiveProjects unimplemented yet" << std::endl;
33 bool ControlCreaDevManagerMain::UpdateActiveProjects()
35 // TODO UpdateActiveProjects
36 std::cerr << "UpdateActiveProjects unimplemented yet" << std::endl;
40 const int ControlCreaDevManagerMain::OpenProject(const std::string& actualpath)
42 std::string path = actualpath;
43 std::cout << "selection path: "<< path << std::endl;
44 std::string path1 = path + "/Makefile";
45 FILE* pFile = fopen(path1.c_str(), "r");
46 if(pFile == NULL) // not the binary folder
48 std::cerr << path1 << ": file not found..." << std::endl;
49 path1 = path + "/CMakeLists.txt";
50 pFile = fopen(path1.c_str(), "r");
51 if(pFile == NULL) //not the source folder
53 std::cerr << path1 << ": file not found..." << std::endl;
56 std::cout << "sources folder found..." << std::endl;
60 std::cout << "binary folder found..." << std::endl;
63 std::ifstream readFile;
64 readFile.open(path1.c_str());
68 while(!found && readFile >> word)
70 //cout << word << endl;
71 if(word == "CMAKE_SOURCE_DIR")
75 getline(readFile, word, '\n');
84 std::cerr << "sources not found..." << std::endl;
88 pFile = fopen(path.c_str(), "r");
89 std::cout << "sources at " << path << " open = " << (pFile != NULL) << std::endl;
94 projectsTree.SetRoot(path);
95 projectsTree.populateNode(path);
99 bool ControlCreaDevManagerMain::CloseProject(const std::string& projectName)
102 std::cerr << "CloseProject unimplemented yet" << std::endl;