File_WIN32U.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. //
  2. // File_WIN32U.h
  3. //
  4. // $Id: //poco/1.4/Foundation/include/Poco/File_WIN32U.h#1 $
  5. //
  6. // Library: Foundation
  7. // Package: Filesystem
  8. // Module: File
  9. //
  10. // Definition of the Unicode FileImpl class for WIN32.
  11. //
  12. // Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
  13. // and Contributors.
  14. //
  15. // SPDX-License-Identifier: BSL-1.0
  16. //
  17. #ifndef Foundation_File_WIN32U_INCLUDED
  18. #define Foundation_File_WIN32U_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. std::wstring _upath;
  57. friend class FileHandle;
  58. friend class DirectoryIteratorImpl;
  59. friend class WindowsDirectoryWatcherStrategy;
  60. };
  61. //
  62. // inlines
  63. //
  64. inline const std::string& FileImpl::getPathImpl() const
  65. {
  66. return _path;
  67. }
  68. } // namespace Poco
  69. #endif // Foundation_File_WIN32U_INCLUDED