DirectoryIterator_VMS.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. //
  2. // DirectoryIterator_VMS.h
  3. //
  4. // $Id: //poco/1.4/Foundation/include/Poco/DirectoryIterator_VMS.h#1 $
  5. //
  6. // Library: Foundation
  7. // Package: Filesystem
  8. // Module: DirectoryIterator
  9. //
  10. // Definition of the DirectoryIteratorImpl class for OpenVMS.
  11. //
  12. // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
  13. // and Contributors.
  14. //
  15. // SPDX-License-Identifier: BSL-1.0
  16. //
  17. #ifndef Foundation_DirectoryIterator_VMS_INCLUDED
  18. #define Foundation_DirectoryIterator_VMS_INCLUDED
  19. #include "Poco/Foundation.h"
  20. #include <rms.h>
  21. namespace Poco {
  22. class Foundation_API DirectoryIteratorImpl
  23. {
  24. public:
  25. DirectoryIteratorImpl(const std::string& path);
  26. ~DirectoryIteratorImpl();
  27. void duplicate();
  28. void release();
  29. const std::string& get() const;
  30. const std::string& next();
  31. private:
  32. struct FAB _fab;
  33. struct NAM _nam;
  34. std::string _search;
  35. char _spec[255];
  36. std::string _current;
  37. int _rc;
  38. };
  39. //
  40. // inlines
  41. //
  42. const std::string& DirectoryIteratorImpl::get() const
  43. {
  44. return _current;
  45. }
  46. inline void DirectoryIteratorImpl::duplicate()
  47. {
  48. ++_rc;
  49. }
  50. inline void DirectoryIteratorImpl::release()
  51. {
  52. if (--_rc == 0)
  53. delete this;
  54. }
  55. } // namespace Poco
  56. #endif // Foundation_DirectoryIterator_VMS_INCLUDED