const std::string& path() const;
/// Returns the path.
+#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8)
+ const std::wstring& wpath() const;
+ /// Returns the path.
+#endif
+
bool exists() const;
/// Returns true iff the file exists.
return getPathImpl();
}
+#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8)
+inline const std::wstring& File::wpath() const
+{
+ return getPathWImpl();
+}
+#endif
inline bool File::operator == (const File& file) const
{
void swapImpl(FileImpl& file);
void setPathImpl(const std::string& path);
const std::string& getPathImpl() const;
+ const std::wstring& getPathWImpl() const;
bool existsImpl() const;
bool canReadImpl() const;
bool canWriteImpl() const;
return _path;
}
+inline const std::wstring& FileImpl::getPathWImpl() const
+{
+ return _upath;
+}
} // namespace Poco
}
#if defined (POCO_WIN32_UTF8)
- std::wstring utf16name;
- UnicodeConverter::toUTF16(_name, utf16name);
- _fileHandle = CreateFileW(utf16name.c_str(), fileMode, shareMode, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ _fileHandle = CreateFileW(file.wpath().c_str(), fileMode, shareMode, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
#else
_fileHandle = CreateFileA(_name.c_str(), fileMode, shareMode, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
#endif