File_UNIX.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. //
  2. // File_UNIX.h
  3. //
  4. // $Id: //poco/1.4/Foundation/include/Poco/File_UNIX.h#1 $
  5. //
  6. // Library: Foundation
  7. // Package: Filesystem
  8. // Module: File
  9. //
  10. // Definition of the FileImpl class for Unix.
  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_File_UNIX_INCLUDED
  18. #define Foundation_File_UNIX_INCLUDED
  19. #include "Poco/Foundation.h"
  20. namespace Poco {
  21. class FileImpl
  22. {
  23. protected:
  24. typedef UInt64 FileSizeImpl;
  25. FileImpl();
  26. FileImpl(const std::string& path);
  27. virtual ~FileImpl();
  28. void swapImpl(FileImpl& file);
  29. void setPathImpl(const std::string& path);
  30. const std::string& getPathImpl() const;
  31. bool existsImpl() const;
  32. bool canReadImpl() const;
  33. bool canWriteImpl() const;
  34. bool canExecuteImpl() const;
  35. bool isFileImpl() const;
  36. bool isDirectoryImpl() const;
  37. bool isLinkImpl() const;
  38. bool isDeviceImpl() const;
  39. bool isHiddenImpl() const;
  40. Timestamp createdImpl() const;
  41. Timestamp getLastModifiedImpl() const;
  42. void setLastModifiedImpl(const Timestamp& ts);
  43. FileSizeImpl getSizeImpl() const;
  44. void setSizeImpl(FileSizeImpl size);
  45. void setWriteableImpl(bool flag = true);
  46. void setExecutableImpl(bool flag = true);
  47. void copyToImpl(const std::string& path) const;
  48. void renameToImpl(const std::string& path);
  49. void removeImpl();
  50. bool createFileImpl();
  51. bool createDirectoryImpl();
  52. static void handleLastErrorImpl(const std::string& path);
  53. private:
  54. std::string _path;
  55. friend class DirectoryIteratorImpl;
  56. friend class LinuxDirectoryWatcherStrategy;
  57. friend class BSDDirectoryWatcherStrategy;
  58. };
  59. //
  60. // inlines
  61. //
  62. inline const std::string& FileImpl::getPathImpl() const
  63. {
  64. return _path;
  65. }
  66. } // namespace Poco
  67. #endif // Foundation_File_UNIX_INCLUDED