Directory.hxx.in 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*=========================================================================
  2. Program: KWSys - Kitware System Library
  3. Module: $RCSfile$
  4. Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved.
  5. See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even
  7. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  8. PURPOSE. See the above copyright notices for more information.
  9. =========================================================================*/
  10. #ifndef @KWSYS_NAMESPACE@_Directory_hxx
  11. #define @KWSYS_NAMESPACE@_Directory_hxx
  12. #include <@KWSYS_NAMESPACE@/Configure.h>
  13. namespace @KWSYS_NAMESPACE@
  14. {
  15. class DirectoryInternals;
  16. /** \class Directory
  17. * \brief Portable directory/filename traversal.
  18. *
  19. * Directory provides a portable way of finding the names of the files
  20. * in a system directory.
  21. *
  22. * Directory currently works with Windows and Unix operating systems.
  23. */
  24. class @KWSYS_NAMESPACE@_EXPORT Directory
  25. {
  26. public:
  27. Directory();
  28. ~Directory();
  29. /**
  30. * Load the specified directory and load the names of the files
  31. * in that directory. 0 is returned if the directory can not be
  32. * opened, 1 if it is opened.
  33. */
  34. bool Load(const char*);
  35. /**
  36. * Return the number of files in the current directory.
  37. */
  38. unsigned long GetNumberOfFiles() const;
  39. /**
  40. * Return the number of files in the specified directory.
  41. * A higher performance static method.
  42. */
  43. static unsigned long GetNumberOfFilesInDirectory(const char*);
  44. /**
  45. * Return the file at the given index, the indexing is 0 based
  46. */
  47. const char* GetFile(unsigned long) const;
  48. /**
  49. * Return the path to Open'ed directory
  50. */
  51. const char* GetPath() const;
  52. /**
  53. * Clear the internal structure. Used internally at beginning of Load(...)
  54. * to clear the cache.
  55. */
  56. void Clear();
  57. private:
  58. // Private implementation details.
  59. DirectoryInternals* Internal;
  60. }; // End Class: Directory
  61. } // namespace @KWSYS_NAMESPACE@
  62. #endif