# The fact that you are presently reading this means that you have had
# knowledge of the CeCILL-B license and that you accept its terms.
# ------------------------------------------------------------------------
-*/
+ */
/*
* modelCDMIProjectTreeNode.cpp
unsigned char yType = y->GetType();
while ((i < xName.length()) && (i < yName.length()))
- {
- if (tolower (xName[i]) < tolower (yName[i]))
- {
- noWinner = false;
- returnValue = true;
- break;
- }
- else if (tolower (xName[i]) > tolower (yName[i]))
{
- noWinner = false;
- returnValue = false;
- break;
+ if (tolower (xName[i]) < tolower (yName[i]))
+ {
+ noWinner = false;
+ returnValue = true;
+ break;
+ }
+ else if (tolower (xName[i]) > tolower (yName[i]))
+ {
+ noWinner = false;
+ returnValue = false;
+ break;
+ }
+ i++;
}
- i++;
- }
if(noWinner)
- {
- if (xName.length() < yName.length())
- returnValue = true;
- else
- returnValue = false;
- }
+ {
+ if (xName.length() < yName.length())
+ returnValue = true;
+ else
+ returnValue = false;
+ }
if(xType != yType)
- {
- if(xType == wxDIR_DIRS)
- returnValue = true;
- else
- returnValue = false;
- }
+ {
+ if(xType == wxDIR_DIRS)
+ returnValue = true;
+ else
+ returnValue = false;
+ }
return returnValue;
}
-const wxTreeItemId& modelCDMIProjectTreeNode::GetId() const
+const wxCDMTreeItemId& modelCDMIProjectTreeNode::GetId() const
{
return this->id;
}
return this->level;
}
+modelCDMIProjectTreeNode* modelCDMIProjectTreeNode::GetParent() const
+{
+ return this->parent;
+}
+
+std::vector<modelCDMIProjectTreeNode*> modelCDMIProjectTreeNode::GetParents() const
+{
+ std::vector<modelCDMIProjectTreeNode*> family;
+ modelCDMIProjectTreeNode* someFamily = this->parent;
+ while(someFamily != NULL)
+ {
+ family.push_back(someFamily);
+ someFamily = someFamily->GetParent();
+ }
+ return family;
+
+}
+
const std::vector<modelCDMIProjectTreeNode*>& modelCDMIProjectTreeNode::GetChildren() const
{
return this->children;
}
-void modelCDMIProjectTreeNode::SetId(const wxTreeItemId& id)
+void modelCDMIProjectTreeNode::SetId(const wxCDMTreeItemId& id)
{
this->id = id;
}
const bool modelCDMIProjectTreeNode::OpenInFileExplorer(std::string*& result) const
{
if (!CDMUtilities::openFileExplorer(this->GetPath()))
- return true;
- else
- {
- result = new std::string("Couldn't open file.");
- return false;
- }
+ return true;
+ else
+ {
+ result = new std::string("Couldn't open file.");
+ return false;
+ }
}