File_WIN32U.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. //
  2. // File_WIN32U.h
  3. //
  4. // Library: Foundation
  5. // Package: Filesystem
  6. // Module: File
  7. //
  8. // Definition of the Unicode FileImpl class for WIN32.
  9. //
  10. // Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
  11. // and Contributors.
  12. //
  13. // SPDX-License-Identifier: BSL-1.0
  14. //
  15. #ifndef Foundation_File_WIN32U_INCLUDED
  16. #define Foundation_File_WIN32U_INCLUDED
  17. #include "Poco/Foundation.h"
  18. #include "Poco/Timestamp.h"
  19. namespace Poco {
  20. class Foundation_API FileImpl
  21. {
  22. protected:
  23. typedef UInt64 FileSizeImpl;
  24. FileImpl();
  25. FileImpl(const std::string& path);
  26. virtual ~FileImpl();
  27. void swapImpl(FileImpl& file);
  28. void setPathImpl(const std::string& path);
  29. const std::string& getPathImpl() const;
  30. bool existsImpl() const;
  31. bool canReadImpl() const;
  32. bool canWriteImpl() const;
  33. bool canExecuteImpl() const;
  34. bool isFileImpl() const;
  35. bool isDirectoryImpl() const;
  36. bool isLinkImpl() const;
  37. bool isDeviceImpl() const;
  38. bool isHiddenImpl() const;
  39. Timestamp createdImpl() const;
  40. Timestamp getLastModifiedImpl() const;
  41. void setLastModifiedImpl(const Timestamp& ts);
  42. FileSizeImpl getSizeImpl() const;
  43. void setSizeImpl(FileSizeImpl size);
  44. void setWriteableImpl(bool flag = true);
  45. void setExecutableImpl(bool flag = true);
  46. void copyToImpl(const std::string& path) const;
  47. void renameToImpl(const std::string& path);
  48. void linkToImpl(const std::string& path, int type) const;
  49. void removeImpl();
  50. bool createFileImpl();
  51. bool createDirectoryImpl();
  52. FileSizeImpl totalSpaceImpl() const;
  53. FileSizeImpl usableSpaceImpl() const;
  54. FileSizeImpl freeSpaceImpl() const;
  55. static void handleLastErrorImpl(const std::string& path);
  56. static void convertPath(const std::string& utf8Path, std::wstring& utf16Path);
  57. private:
  58. std::string _path;
  59. std::wstring _upath;
  60. friend class FileHandle;
  61. friend class DirectoryIteratorImpl;
  62. friend class WindowsDirectoryWatcherStrategy;
  63. friend class FileStreamBuf;
  64. friend class LogFileImpl;
  65. };
  66. //
  67. // inlines
  68. //
  69. inline const std::string& FileImpl::getPathImpl() const
  70. {
  71. return _path;
  72. }
  73. } // namespace Poco
  74. #endif // Foundation_File_WIN32U_INCLUDED