File_WIN32.h 1.8 KB

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