File_WINCE.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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-2010, Applied Informatics Software Engineering GmbH.
  11. // and Contributors.
  12. //
  13. // SPDX-License-Identifier: BSL-1.0
  14. //
  15. #ifndef Foundation_File_WINCE_INCLUDED
  16. #define Foundation_File_WINCE_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 FileStreamBuf;
  63. friend class LogFileImpl;
  64. };
  65. //
  66. // inlines
  67. //
  68. inline const std::string& FileImpl::getPathImpl() const
  69. {
  70. return _path;
  71. }
  72. } // namespace Poco
  73. #endif // Foundation_File_WINCE_INCLUDED