+// Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
#include "DF_definitions.hxx"
#include "DF_Document.hxx"
#include "DF_Label.hxx"
#include "DF_ChildIterator.hxx"
-using namespace std;
-
//Class DF_Document is container for user's data stored as a tree of Labels
//with assigned Attributes
-DF_Document::DF_Document(const string& theDocumentType)
+DF_Document::DF_Document(const std::string& theDocumentType)
{
_id = -1;
_type = theDocumentType;
- _modified = true;
+ _modified = false;
}
DF_Document::~DF_Document()
}
//Returns a type of the Document
-string DF_Document::GetDocumentType()
+std::string DF_Document::GetDocumentType()
{
return _type;
}
{
if(_root.IsNull()) return;
- vector<DF_LabelNode*> vn;
+ std::vector<DF_LabelNode*> vn;
DF_ChildIterator CI(_root, true);
for(; CI.More(); CI.Next()) {
DF_LabelNode* node = CI.Value()._node;
if(node) vn.push_back(node);
}
- for(int i = 0, len = vn.size(); i<len; i++)
+ for(size_t i = 0, len = vn.size(); i<len; i++)
delete vn[i];
_root._node->Reset();
+ _root.Nullify();
}
//Returns true if this document is empty
//Restores a content of the Document from the std::string theData
-void DF_Document::Load(const std::string& theData)
+void DF_Document::Load(const std::string& /*theData*/)
{
//Not implemented
}
//Converts a content of the Document into the std::string
-string DF_Document::Save()
+std::string DF_Document::Save()
{
//Not implemented
return "";