Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/OSD_FileIterator.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Created on: 1992-03-18
0002 // Created by: Stephan GARNAUD
0003 // Copyright (c) 1992-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _OSD_FileIterator_HeaderFile
0018 #define _OSD_FileIterator_HeaderFile
0019 
0020 #include <OSD_File.hxx>
0021 #include <OSD_Error.hxx>
0022 #include <TCollection_AsciiString.hxx>
0023 
0024 class OSD_Path;
0025 
0026 //! Manages a breadth-only search for files in the specified Path.
0027 //! There is no specific order of results.
0028 class OSD_FileIterator
0029 {
0030 public:
0031   DEFINE_STANDARD_ALLOC
0032 
0033   //! Instantiates Object as empty Iterator;
0034   Standard_EXPORT OSD_FileIterator();
0035 
0036   //! Instantiates Object as Iterator;
0037   //! Wild-card "*" can be used in Mask the same way it
0038   //! is used by unix shell for file names
0039   Standard_EXPORT OSD_FileIterator(const OSD_Path& where, const TCollection_AsciiString& Mask);
0040 
0041   Standard_EXPORT void Destroy();
0042 
0043   ~OSD_FileIterator() { Destroy(); }
0044 
0045   //! Initializes the current File Iterator
0046   Standard_EXPORT void Initialize(const OSD_Path& where, const TCollection_AsciiString& Mask);
0047 
0048   //! Returns TRUE if there are other items using the 'Tree'
0049   //! method.
0050   Standard_EXPORT bool More();
0051 
0052   //! Sets the iterator to the next item.
0053   //! Returns the item value corresponding to the current
0054   //! position of the iterator.
0055   Standard_EXPORT void Next();
0056 
0057   //! Returns the next file found .
0058   Standard_EXPORT OSD_File Values();
0059 
0060   //! Returns TRUE if an error occurs
0061   Standard_EXPORT bool Failed() const;
0062 
0063   //! Resets error counter to zero
0064   Standard_EXPORT void Reset();
0065 
0066   //! Raises OSD_Error
0067   Standard_EXPORT void Perror();
0068 
0069   //! Returns error number if 'Failed' is TRUE.
0070   Standard_EXPORT int Error() const;
0071 
0072 private:
0073   OSD_File                TheIterator;
0074   bool                    myFlag;
0075   TCollection_AsciiString myMask;
0076   TCollection_AsciiString myPlace;
0077   OSD_Error               myError;
0078 
0079   // platform-specific fields
0080 #ifdef _WIN32
0081   void* myHandle;
0082   void* myData;
0083   bool  myFirstCall;
0084 #else
0085   void* myDescr;
0086   void* myEntry;
0087   int   myInit;
0088 #endif
0089 };
0090 
0091 #endif // _OSD_FileIterator_HeaderFile