1 // Copyright (C) 2013-2015 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "SimanIO_Document.hxx"
22 SimanIO_Document::SimanIO_Document()
26 void SimanIO_Document::SetName(const char* theName)
31 const char* SimanIO_Document::Name() const
33 return myName.c_str();
36 void SimanIO_Document::AddFile(const bool isResult, const char* theURL,
37 const AutomaticProcessing theProc, const FileState theState)
39 SimanIO_File aFile = {theURL, isResult, theProc, theState};
43 void SimanIO_Document::AddFile(const SimanIO_File& theFile)
45 myFiles.push_back(theFile);
48 const SimanIO_File& SimanIO_Document::File(const int theId) const
50 DocumentFiles::const_iterator aFIter = myFiles.begin();
51 for(; aFIter != myFiles.end(); aFIter++) {
52 if (aFIter->id == theId)
55 static SimanIO_File anEmpty;
59 //////////////////////////// Iterator methods /////////////////////////
60 SimanIO_Document::FilesIterator::FilesIterator(/*const*/ SimanIO_Document& theDocument)
62 myIter = theDocument.myFiles.begin();
63 myEnd = theDocument.myFiles.end();
66 void SimanIO_Document::FilesIterator::Next()
71 bool SimanIO_Document::FilesIterator::More()
73 return myIter != myEnd;
75 const bool SimanIO_Document::FilesIterator::IsResult()
77 return myIter->result;
80 const char* SimanIO_Document::FilesIterator::URL()
82 return myIter->url.c_str();
85 void SimanIO_Document::FilesIterator::SetURL(const char* theURL)
88 //myIter->url(theURL);
89 //std::string test = "abc";
93 const AutomaticProcessing SimanIO_Document::FilesIterator::GetProcessing()
98 const FileState SimanIO_Document::FilesIterator::GetState()
100 return myIter->state;
103 const int SimanIO_Document::FilesIterator::Id()