Directory.hxx.in 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 file at the given index, the indexing is 0 based
  41. */
  42. const char* GetFile(unsigned long) const;
  43. /**
  44. * Return the path to Open'ed directory
  45. */
  46. const char* GetPath() const;
  47. protected:
  48. /**
  49. * Clear the internal structure. Used internally at beginning of Load(...) to clear
  50. * the cache.
  51. */
  52. void Clear();
  53. private:
  54. // Private implementation details.
  55. DirectoryInternals* Internal;
  56. }; // End Class: Directory
  57. } // namespace @KWSYS_NAMESPACE@
  58. #endif