#include <string>
#include <cstring>
-using namespace std;
-
ModelCreaDevManagerTree::ModelCreaDevManagerTree()
{
}
bool returnValue;
bool noWinner = true;
unsigned int i = 0;
- string xName = x.GetName();
- string yName = y.GetName();
+ std::string xName = x.GetName();
+ std::string yName = y.GetName();
unsigned char xType = x.GetType();
unsigned char yType = y.GetType();
return returnValue;
}
-void ModelCreaDevManagerTree::addRoot(string path)
+void ModelCreaDevManagerTree::addRoot(std::string path)
{
- stringstream p(path);
- vector<string> breadcrumbs;
- string name;
+ std::stringstream p(path);
+ std::vector<std::string> breadcrumbs;
+ std::string name;
while(!p.eof())
{
name = breadcrumbs[breadcrumbs.size()-1];
this->projectRoots.push_back(ModelCreaDevManagerTreeNode(path,name,DT_DIR,0));
- cout << "project root added: " << name << " in " << path << endl;
+ std::cout << "project root added: " << name << " in " << path << std::endl;
}
void ModelCreaDevManagerTree::populateNode(ModelCreaDevManagerTreeNode& node)
{
- //cout << "populating " << node.GetName() << " path " << node.GetPath() << "..." << endl;
- vector <ModelCreaDevManagerTreeNode>* nodes = new vector <ModelCreaDevManagerTreeNode>;
+ //std::cout << "populating " << node.GetName() << " path " << node.GetPath() << "..." << std::endl;
+ std::vector <ModelCreaDevManagerTreeNode>* nodes = new std::vector <ModelCreaDevManagerTreeNode>;
DIR *dp;
struct dirent *ep;
- string path = node.GetPath()+node.GetName()+"/";
+ std::string path = node.GetPath()+node.GetName()+"/";
dp = opendir(path.c_str());
if (dp != NULL)
{
while ((ep = readdir (dp)) != NULL)
{
- //cout << ep->d_name << endl;
+ //std::cout << ep->d_name << std::endl;
if(strcmp(ep->d_name, ".") != 0 && strcmp(ep->d_name, "..") != 0 )
{
ModelCreaDevManagerTreeNode innerNode = ModelCreaDevManagerTreeNode(path, ep->d_name, ep->d_type, node.GetLevel()+1);
}
else
{
- cerr << "Couldn't open the directory" << endl;
+ std::cerr << "Couldn't open the directory" << std::endl;
}
}
-void ModelCreaDevManagerTree::populateNode(string path)
+void ModelCreaDevManagerTree::populateNode(std::string path)
{
if(path[path.size()-1] != '/')
path+="/";
- cout << "searching " << path << endl;
+ std::cout << "searching " << path << std::endl;
for (int i = 0; i < this->projectRoots.size(); i++)
{
- //cout << (this->projectRoots[i].GetPath() + this->projectRoots[i].GetName() + "/") << "..." << endl;
+ //std::cout << (this->projectRoots[i].GetPath() + this->projectRoots[i].GetName() + "/") << "..." << std::endl;
if(this->projectRoots[i].GetPath()+this->projectRoots[i].GetName()+"/" == path)
{
- cout << "Populating Project: " << path << "..." << endl;
+ std::cout << "Populating Project: " << path << "..." << std::endl;
this->populateNode(this->projectRoots[i]);
break;
}