45 #include "qplatformdefs.h" 47 #include "private/qfsfileengine_p.h" 48 #include <private/qsystemlibrary_p.h> 53 #include "private/qmutexpool_p.h" 58 #if !defined(Q_OS_WINCE) 59 # include <sys/types.h> 61 # include <winioctl.h> 71 #define SECURITY_WIN32 74 #ifndef SPI_GETPLATFORMTYPE 75 #define SPI_GETPLATFORMTYPE 257 79 #define PATH_MAX FILENAME_MAX 82 #ifndef _INTPTR_T_DEFINED 92 #define _INTPTR_T_DEFINED 95 #ifndef INVALID_FILE_ATTRIBUTES 96 # define INVALID_FILE_ATTRIBUTES (DWORD (-1)) 99 #if !defined(Q_OS_WINCE) 100 # if !defined(REPARSE_DATA_BUFFER_HEADER_SIZE) 101 typedef struct _REPARSE_DATA_BUFFER {
103 USHORT ReparseDataLength;
107 USHORT SubstituteNameOffset;
108 USHORT SubstituteNameLength;
109 USHORT PrintNameOffset;
110 USHORT PrintNameLength;
113 } SymbolicLinkReparseBuffer;
115 USHORT SubstituteNameOffset;
116 USHORT SubstituteNameLength;
117 USHORT PrintNameOffset;
118 USHORT PrintNameLength;
120 } MountPointReparseBuffer;
123 } GenericReparseBuffer;
125 } REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER;
126 # define REPARSE_DATA_BUFFER_HEADER_SIZE FIELD_OFFSET(REPARSE_DATA_BUFFER, GenericReparseBuffer) 127 # endif // !defined(REPARSE_DATA_BUFFER_HEADER_SIZE) 129 # ifndef MAXIMUM_REPARSE_DATA_BUFFER_SIZE 130 # define MAXIMUM_REPARSE_DATA_BUFFER_SIZE 16384 132 # ifndef IO_REPARSE_TAG_SYMLINK 133 # define IO_REPARSE_TAG_SYMLINK (0xA000000CL) 135 # ifndef FSCTL_GET_REPARSE_POINT 136 # define FSCTL_GET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 42, METHOD_BUFFERED, FILE_ANY_ACCESS) 138 #endif // !defined(Q_OS_WINCE) 144 #if defined(Q_OS_WINCE) 148 #define QT_NO_LIBRARY 1 151 #if !defined(QT_NO_LIBRARY) 153 typedef DWORD (WINAPI *PtrGetNamedSecurityInfoW)(LPWSTR, SE_OBJECT_TYPE, SECURITY_INFORMATION, PSID*, PSID*, PACL*, PACL*, PSECURITY_DESCRIPTOR*);
154 static PtrGetNamedSecurityInfoW ptrGetNamedSecurityInfoW = 0;
155 typedef BOOL (WINAPI *PtrLookupAccountSidW)(LPCWSTR, PSID, LPWSTR, LPDWORD, LPWSTR, LPDWORD, PSID_NAME_USE);
156 static PtrLookupAccountSidW ptrLookupAccountSidW = 0;
157 typedef VOID (WINAPI *PtrBuildTrusteeWithSidW)(PTRUSTEE_W, PSID);
158 static PtrBuildTrusteeWithSidW ptrBuildTrusteeWithSidW = 0;
159 typedef DWORD (WINAPI *PtrGetEffectiveRightsFromAclW)(PACL, PTRUSTEE_W, OUT PACCESS_MASK);
160 static PtrGetEffectiveRightsFromAclW ptrGetEffectiveRightsFromAclW = 0;
161 typedef BOOL (WINAPI *PtrGetUserProfileDirectoryW)(
HANDLE, LPWSTR, LPDWORD);
162 static PtrGetUserProfileDirectoryW ptrGetUserProfileDirectoryW = 0;
163 typedef BOOL (WINAPI *PtrGetVolumePathNamesForVolumeNameW)(LPCWSTR,LPWSTR,DWORD,PDWORD);
164 static PtrGetVolumePathNamesForVolumeNameW ptrGetVolumePathNamesForVolumeNameW = 0;
167 static TRUSTEE_W currentUserTrusteeW;
168 static TRUSTEE_W worldTrusteeW;
169 static PSID currentUserSID = 0;
170 static PSID worldSID = 0;
181 SidCleanup::~SidCleanup()
183 qFree(currentUserSID);
197 static bool triedResolve =
false;
213 #if !defined(Q_OS_WINCE) 215 if (advapi32.
load()) {
216 ptrGetNamedSecurityInfoW = (PtrGetNamedSecurityInfoW)advapi32.
resolve(
"GetNamedSecurityInfoW");
217 ptrLookupAccountSidW = (PtrLookupAccountSidW)advapi32.
resolve(
"LookupAccountSidW");
218 ptrBuildTrusteeWithSidW = (PtrBuildTrusteeWithSidW)advapi32.
resolve(
"BuildTrusteeWithSidW");
219 ptrGetEffectiveRightsFromAclW = (PtrGetEffectiveRightsFromAclW)advapi32.
resolve(
"GetEffectiveRightsFromAclW");
221 if (ptrBuildTrusteeWithSidW) {
223 HANDLE hnd = ::GetCurrentProcess();
226 if (::OpenProcessToken(hnd, TOKEN_QUERY, &token)) {
232 ::GetTokenInformation(token, TokenUser, 0, 0, &retsize);
234 void *tokenBuffer =
qMalloc(retsize);
235 if (::GetTokenInformation(token, TokenUser, tokenBuffer, retsize, &retsize)) {
236 PSID tokenSid =
reinterpret_cast<PTOKEN_USER
>(tokenBuffer)->
User.Sid;
237 DWORD sidLen = ::GetLengthSid(tokenSid);
238 currentUserSID =
reinterpret_cast<PSID
>(
qMalloc(sidLen));
239 if (::CopySid(sidLen, currentUserSID, tokenSid))
240 ptrBuildTrusteeWithSidW(¤tUserTrusteeW, currentUserSID);
244 ::CloseHandle(token);
247 typedef BOOL (WINAPI *PtrAllocateAndInitializeSid)(PSID_IDENTIFIER_AUTHORITY,
BYTE, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, PSID*);
248 PtrAllocateAndInitializeSid ptrAllocateAndInitializeSid = (PtrAllocateAndInitializeSid)advapi32.
resolve(
"AllocateAndInitializeSid");
249 if (ptrAllocateAndInitializeSid) {
251 SID_IDENTIFIER_AUTHORITY worldAuth = { SECURITY_WORLD_SID_AUTHORITY };
252 if (ptrAllocateAndInitializeSid(&worldAuth, 1, SECURITY_WORLD_RID, 0, 0, 0, 0, 0, 0, 0, &worldSID))
253 ptrBuildTrusteeWithSidW(&worldTrusteeW, worldSID);
259 ptrGetUserProfileDirectoryW = (PtrGetUserProfileDirectoryW)userenv.
resolve(
"GetUserProfileDirectoryW");
263 ptrGetVolumePathNamesForVolumeNameW = (PtrGetVolumePathNamesForVolumeNameW)kernel32.
resolve(
"GetVolumePathNamesForVolumeNameW");
268 #endif // QT_NO_LIBRARY 270 typedef DWORD (WINAPI *
PtrNetShareEnum)(LPWSTR, DWORD, LPBYTE*, DWORD, LPDWORD, LPDWORD, LPDWORD);
283 static bool triedResolve =
false;
292 #if !defined(Q_OS_WINCE) 294 if (netapi32.
load()) {
307 #if !defined(Q_OS_WINCE) 310 FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
313 FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT,
315 if (handle != INVALID_HANDLE_VALUE) {
316 DWORD bufsize = MAXIMUM_REPARSE_DATA_BUFFER_SIZE;
317 REPARSE_DATA_BUFFER *rdb = (REPARSE_DATA_BUFFER*)
qMalloc(bufsize);
319 if (::DeviceIoControl(handle, FSCTL_GET_REPARSE_POINT, 0, 0, rdb, bufsize, &retsize, 0)) {
320 if (rdb->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT) {
321 int length = rdb->MountPointReparseBuffer.SubstituteNameLength /
sizeof(wchar_t);
322 int offset = rdb->MountPointReparseBuffer.SubstituteNameOffset /
sizeof(wchar_t);
323 const wchar_t* PathBuffer = &rdb->MountPointReparseBuffer.PathBuffer[offset];
326 int length = rdb->SymbolicLinkReparseBuffer.SubstituteNameLength /
sizeof(wchar_t);
327 int offset = rdb->SymbolicLinkReparseBuffer.SubstituteNameOffset /
sizeof(wchar_t);
328 const wchar_t* PathBuffer = &rdb->SymbolicLinkReparseBuffer.PathBuffer[offset];
333 result = result.
mid(4);
338 #if !defined(QT_NO_LIBRARY) 340 if (ptrGetVolumePathNamesForVolumeNameW) {
342 if(matchVolName.
indexIn(result) == 0) {
344 wchar_t buffer[MAX_PATH];
346 if(ptrGetVolumePathNamesForVolumeNameW((
wchar_t*)volumeName.
utf16(), buffer, MAX_PATH, &len) != 0)
360 #if !defined(Q_OS_WINCE) 361 #if !defined(QT_NO_LIBRARY) && !defined(Q_CC_MWERKS) 364 bool neededCoInit =
false;
367 wchar_t szGotPath[MAX_PATH];
370 HRESULT hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (LPVOID *)&psl);
372 if (hres == CO_E_NOTINITIALIZED) {
375 hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
376 IID_IShellLink, (LPVOID *)&psl);
378 if (SUCCEEDED(hres)) {
380 hres = psl->QueryInterface(IID_IPersistFile, (LPVOID *)&ppf);
381 if (SUCCEEDED(hres)) {
385 if (SUCCEEDED(hres)) {
386 if (psl->GetPath(szGotPath, MAX_PATH, &wfd, SLGP_UNCPRIORITY) == NOERROR)
400 #endif // QT_NO_LIBRARY 402 wchar_t target[MAX_PATH];
419 if (parts.
count() >= 3) {
435 HANDLE hFind = ::FindFirstFile((
wchar_t*)path.
utf16(), &findData);
436 if (hFind != INVALID_HANDLE_VALUE) {
450 DWORD er = 0, tr = 0, resume = 0, i;
452 res =
ptrNetShareEnum((
wchar_t*)server.
utf16(), 1, (LPBYTE *)&BufPtr, DWORD(-1), &er, &tr, &resume);
453 if (res == ERROR_SUCCESS || res == ERROR_MORE_DATA) {
455 for (i = 1; i <= er; ++i) {
462 }
while (res == ERROR_MORE_DATA);
463 return res == ERROR_SUCCESS;
514 #if !defined(Q_OS_WINCE) 518 if (retLen > (DWORD)buf.
size()) {
546 #if !defined(Q_OS_WINCE) 578 #if !defined(QT_NO_LIBRARY) 582 if (ptrGetNamedSecurityInfoW && ptrLookupAccountSidW) {
584 PSECURITY_DESCRIPTOR pSD;
588 0, 0, &pSD) == ERROR_SUCCESS) {
593 SID_NAME_USE use = SidTypeUnknown;
595 if (!ptrLookupAccountSidW(NULL, pOwner, (LPWSTR)owner.
data(), &lowner,
596 (LPWSTR)domain.
data(), &ldomain, (SID_NAME_USE*)&use)) {
597 if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
598 if (lowner > (DWORD)owner.
size())
600 if (ldomain > (DWORD)domain.
size())
603 if (!ptrLookupAccountSidW(NULL, pOwner, (LPWSTR)owner.
data(), &lowner,
604 (LPWSTR)domain.
data(), &ldomain, (SID_NAME_USE*)&use)) {
626 QFileSystemMetaData::MetaDataFlags what)
628 #if !defined(QT_NO_LIBRARY) 631 if(ptrGetNamedSecurityInfoW && ptrBuildTrusteeWithSidW && ptrGetEffectiveRightsFromAclW) {
632 enum { ReadMask = 0x00000001, WriteMask = 0x00000002, ExecMask = 0x00000020 };
638 PSECURITY_DESCRIPTOR pSD;
639 DWORD res = ptrGetNamedSecurityInfoW((
wchar_t*)fname.
utf16(), SE_FILE_OBJECT,
640 OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION,
641 &pOwner, &pGroup, &pDacl, 0, &pSD);
642 if(res == ERROR_SUCCESS) {
643 ACCESS_MASK access_mask;
647 if(ptrGetEffectiveRightsFromAclW(pDacl, ¤tUserTrusteeW, &access_mask) != ERROR_SUCCESS)
648 access_mask = (ACCESS_MASK)-1;
649 if(access_mask & ReadMask)
651 if(access_mask & WriteMask)
653 if(access_mask & ExecMask)
658 ptrBuildTrusteeWithSidW(&trustee, pOwner);
659 if(ptrGetEffectiveRightsFromAclW(pDacl, &trustee, &access_mask) != ERROR_SUCCESS)
660 access_mask = (ACCESS_MASK)-1;
661 if(access_mask & ReadMask)
663 if(access_mask & WriteMask)
665 if(access_mask & ExecMask)
670 ptrBuildTrusteeWithSidW(&trustee, pGroup);
671 if(ptrGetEffectiveRightsFromAclW(pDacl, &trustee, &access_mask) != ERROR_SUCCESS)
672 access_mask = (ACCESS_MASK)-1;
673 if(access_mask & ReadMask)
675 if(access_mask & WriteMask)
677 if(access_mask & ExecMask)
682 if(ptrGetEffectiveRightsFromAclW(pDacl, &worldTrusteeW, &access_mask) != ERROR_SUCCESS)
683 access_mask = (ACCESS_MASK)-1;
684 if(access_mask & ReadMask)
686 if(access_mask & WriteMask)
688 if(access_mask & ExecMask)
738 bool entryExists =
false;
739 DWORD fileAttrib = 0;
740 #if !defined(Q_OS_WINCE) 743 DWORD drivesBitmask = ::GetLogicalDrives();
745 if (drivesBitmask & drivebit) {
746 fileAttrib = FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_SYSTEM;
761 if (s == path.
size() - 1) {
778 fileAttrib = FILE_ATTRIBUTE_DIRECTORY;
781 #if !defined(Q_OS_WINCE) 791 bool filledData =
false;
793 int errorCode = GetLastError();
794 if (errorCode == ERROR_ACCESS_DENIED || errorCode == ERROR_SHARING_VIOLATION) {
795 WIN32_FIND_DATA findData;
805 #if !defined(Q_OS_WINCE) 808 QFileSystemMetaData::MetaDataFlags what)
811 if (fHandle != INVALID_HANDLE_VALUE) {
812 return fillMetaData(fHandle, data, what);
820 QFileSystemMetaData::MetaDataFlags what)
823 clearWinStatData(data);
824 BY_HANDLE_FILE_INFORMATION fileInfo;
826 if (GetFileInformationByHandle(fHandle , &fileInfo)) {
837 QFileSystemMetaData::MetaDataFlags what)
856 clearWinStatData(data);
862 clearWinStatData(data);
863 WIN32_FIND_DATA findData;
866 bool ok = ::GetFileAttributesEx((
wchar_t*)fname.
nativeFilePath().
utf16(), GetFileExInfoStandard,
867 reinterpret_cast<WIN32_FILE_ATTRIBUTE_DATA *
>(&findData));
878 fillPermissions(fname, data, what);
883 WIN32_FIND_DATA findData;
894 #if defined(Q_OS_WINCE) 900 static int platformId = 0;
901 if (platformId == 0) {
902 wchar_t platformString[64];
903 if (SystemParametersInfo(
SPI_GETPLATFORMTYPE,
sizeof(platformString)/
sizeof(*platformString),platformString,0)) {
904 if (0 == wcscmp(platformString, L
"PocketPC") || 0 == wcscmp(platformString, L
"Smartphone"))
929 int errorCode = GetLastError();
930 if (errorCode == ERROR_ACCESS_DENIED || errorCode == ERROR_SHARING_VIOLATION) {
931 WIN32_FIND_DATA findData;
933 fileAttrib = findData.dwFileAttributes;
943 return fileAttrib & FILE_ATTRIBUTE_DIRECTORY;
957 for (
int i = 0; i < dirName.
size(); ++i) {
966 for (
int slash=0; slash != -1; oldslash = slash) {
969 if (oldslash == dirName.
length())
975 bool existed =
false;
995 if (removeEmptyParents) {
997 for (
int oldslash = 0, slash=dirName.
length(); slash > 0; oldslash = slash) {
1004 return oldslash != 0;
1015 #if defined(Q_OS_WINCE) 1017 #elif defined(Q_FS_FAT) 1022 #elif defined(Q_OS_OS2EMX) 1034 #if !defined(QT_NO_LIBRARY) 1036 if (ptrGetUserProfileDirectoryW) {
1037 HANDLE hnd = ::GetCurrentProcess();
1039 BOOL ok = ::OpenProcessToken(hnd, TOKEN_QUERY, &token);
1041 DWORD dwBufferSize = 0;
1043 ok = ptrGetUserProfileDirectoryW(token, NULL, &dwBufferSize);
1044 if (!ok && dwBufferSize != 0) {
1045 wchar_t *userDirectory =
new wchar_t[dwBufferSize];
1047 ok = ptrGetUserProfileDirectoryW(token, userDirectory, &dwBufferSize);
1050 delete [] userDirectory;
1052 ::CloseHandle(token);
1064 #if defined(Q_OS_WINCE) 1079 wchar_t tempPath[MAX_PATH];
1080 DWORD len = GetTempPath(MAX_PATH, tempPath);
1089 #if !defined(Q_OS_WINCE) 1106 #if !defined(Q_OS_WINCE) 1111 qfsPrivateCurrentDir = entry.
filePath();
1119 #if !defined(Q_OS_WINCE) 1122 size = ::GetCurrentDirectory(
PATH_MAX, currentName);
1125 wchar_t *newCurrentName =
new wchar_t[size];
1126 if (::GetCurrentDirectory(
PATH_MAX, newCurrentName) != 0)
1128 delete [] newCurrentName;
1137 if (qfsPrivateCurrentDir.
isEmpty())
1212 #if defined(Q_OS_WINCE) 1215 systime.wYear = 1970;
1219 systime.wMinute = 0;
1220 systime.wSecond = 0;
1221 systime.wMilliseconds = 0;
1222 systime.wDayOfWeek = 4;
1223 SystemTimeToFileTime(&systime, &ftime);
1224 unsigned __int64 acttime = (
unsigned __int64)time->dwHighDateTime << 32 | time->dwLowDateTime;
1225 FileTimeToSystemTime(time, &systime);
1226 unsigned __int64 time1970 = (
unsigned __int64)ftime.dwHighDateTime << 32 | ftime.dwLowDateTime;
1227 unsigned __int64 difftime = acttime - time1970;
1228 difftime /= 10000000;
1231 SYSTEMTIME sTime, lTime;
1232 FileTimeToSystemTime(time, &sTime);
1233 SystemTimeToTzSpecificLocalTime(0, &sTime, &lTime);
1234 ret.
setDate(
QDate(lTime.wYear, lTime.wMonth, lTime.wDay));
1235 ret.
setTime(
QTime(lTime.wHour, lTime.wMinute, lTime.wSecond, lTime.wMilliseconds));
static QString fromWCharArray(const wchar_t *, int size=-1)
Returns a copy of the string, where the encoding of string depends on the size of wchar...
static bool fillMetaData(const QFileSystemEntry &entry, QFileSystemMetaData &data, QFileSystemMetaData::MetaDataFlags what)
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
static bool setPermissions(const QFileSystemEntry &entry, QFile::Permissions permissions, QSystemError &error, QFileSystemMetaData *data=0)
static QString fromLocal8Bit(const char *, int size=-1)
Returns a QString initialized with the first size characters of the 8-bit string str.
bool isLetter() const
Returns true if the character is a letter (Letter_* categories); otherwise returns false...
#define QT_END_NAMESPACE
This macro expands to.
static QString rootPath()
const QChar at(int i) const
Returns the character at the given index position in the string.
The QRegExp class provides pattern matching using regular expressions.
ushort unicode() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Q_CORE_EXPORT void qFree(void *ptr)
QString & replace(int i, int len, QChar after)
void chop(int n)
Removes n characters from the end of the string.
int length() const
Returns the number of characters in this string.
#define SEM_FAILCRITICALERRORS
int matchedLength() const
Returns the length of the last matched string, or -1 if there was no match.
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
#define QT_END_INCLUDE_NAMESPACE
This macro is equivalent to QT_BEGIN_NAMESPACE.
The QDate class provides date functions.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
int count(const T &t) const
Returns the number of occurrences of value in the list.
Q_CORE_EXPORT void * qMalloc(size_t size)
static const WinVersion WindowsVersion
the version of the Windows operating system on which the application is run (Windows only) ...
The QString class provides a Unicode character string.
static QString currentPath()
Returns the absolute path of the application's current directory.
static bool mkDir(const QString &path)
static bool tryDriveUNCFallback(const QFileSystemEntry &fname, QFileSystemMetaData &data)
static PtrNetApiBufferFree ptrNetApiBufferFree
static bool isCaseSensitive()
bool load(bool onlySystemDirectory=true)
static QChar separator()
Returns the native directory separator: "/" under Unix (including Mac OS X) and "\\" under Windows...
static bool uncListSharesOnServer(const QString &server, QStringList *list)
static QString longFileName(const QString &path)
struct _SHARE_INFO_1 SHARE_INFO_1
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
static QFileSystemEntry currentPath()
NativePath nativeFilePath() const
Q_CORE_EXPORT int qt_ntfs_permission_lookup
bool exists() const
Returns true if the file specified by fileName() exists; otherwise returns false. ...
static QString readLink(const QFileSystemEntry &link)
static bool resolveUNCLibs()
void append(const T &t)
Inserts value at the end of the list.
static QString applicationDirPath()
Returns the directory that contains the application executable.
The QTime class provides clock time functions.
#define QT_BEGIN_NAMESPACE
This macro expands to.
static QFileSystemEntry absoluteName(const QFileSystemEntry &entry)
static bool removeDirectory(const QFileSystemEntry &entry, bool removeEmptyParents)
static bool renameFile(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error)
static QString tempPath()
void setTime_t(uint secsSince1Jan1970UTC)
Sets the date and time given the number of seconds that have passed since 1970-01-01T00:00:00, Coordinated Universal Time (Qt::UTC).
void setDate(const QDate &date)
Sets the date part of this datetime to date.
int indexIn(const QString &str, int offset=0, CaretMode caretMode=CaretAtZero) const
Attempts to find a match in str from position offset (0 by default).
QString left(int n) const Q_REQUIRED_RESULT
Returns a substring that contains the n leftmost characters of the string.
int size() const
Returns the number of characters in this string.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
void setTime(const QTime &time)
Sets the time part of this datetime to time.
#define SPI_GETPLATFORMTYPE
#define Q_GLOBAL_STATIC(TYPE, NAME)
Declares a global static variable with the given type and name.
const T & at(int i) const
Returns the item at index position i in the list.
The QStringList class provides a list of strings.
static bool isDirPath(const QString &dirPath, bool *existed)
static void resolveLibs()
static const char * data(const QByteArray &arr)
DWORD(WINAPI * PtrNetShareEnum)(LPWSTR, DWORD, LPBYTE *, DWORD, LPDWORD, LPDWORD, LPDWORD)
static bool tryFindFallback(const QFileSystemEntry &fname, QFileSystemMetaData &data)
int indexOf(QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
QChar toUpper() const
Returns the uppercase equivalent if the character is lowercase or titlecase; otherwise returns the ch...
QBool contains(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the list contains the string str; otherwise returns false.
static PtrNetShareEnum ptrNetShareEnum
static QString qfsPrivateCurrentDir
QString right(int n) const Q_REQUIRED_RESULT
Returns a substring that contains the n rightmost characters of the string.
static bool fillPermissions(const QFileSystemEntry &entry, QFileSystemMetaData &data, QFileSystemMetaData::MetaDataFlags what)
static QString cleanPath(const QString &path)
Removes all multiple directory separators "/" and resolves any "."s or ".."s found in the path...
static QString nativeAbsoluteFilePath(const QString &path)
static QFileSystemEntry getLinkTarget(const QFileSystemEntry &link, QFileSystemMetaData &data)
static bool rmDir(const QString &path)
static bool getFindData(QString path, WIN32_FIND_DATA &findData)
static bool createDirectory(const QFileSystemEntry &entry, bool createParents)
ushort unicode() const
Converts a Latin-1 character to an 16-bit-encoded Unicode representation of the character.
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
static bool setCurrentPath(const QFileSystemEntry &entry)
static QAuServer & server()
The QMutexLocker class is a convenience class that simplifies locking and unlocking mutexes...
void * resolve(const char *symbol)
static bool createLink(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error)
QString & append(QChar c)
The QDateTime class provides date and time functions.
static bool uncShareExists(const QString &server)
int lastIndexOf(QChar c, int from=-1, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
static bool removeFile(const QFileSystemEntry &entry, QSystemError &error)
QString toLower() const Q_REQUIRED_RESULT
Returns a lowercase copy of the string.
#define SEM_NOOPENFILEERRORBOX
static QString homePath()
#define QT_BEGIN_INCLUDE_NAMESPACE
This macro is equivalent to QT_END_NAMESPACE.
static QString owner(const QFileSystemEntry &entry, QAbstractFileEngine::FileOwner own)
static bool copyFile(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error)
#define INVALID_FILE_ATTRIBUTES
QStringList split(const QString &sep, SplitBehavior behavior=KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const Q_REQUIRED_RESULT
Splits the string into substrings wherever sep occurs, and returns the list of those strings...
DWORD(WINAPI * PtrNetApiBufferFree)(LPVOID)
static QString fromNativeSeparators(const QString &pathName)
Returns pathName using '/' as file separator.
static QString readSymLink(const QFileSystemEntry &link)
QString & remove(int i, int len)
Removes n characters from the string, starting at the given position index, and returns a reference t...
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
The QFileInfo class provides system-independent file information.
static QString toNativeSeparators(const QString &pathName)
Returns pathName with the '/' separators converted to separators that are appropriate for the underly...
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
static QString fileName(const QString &fileUrl)
static QMutex * globalInstanceGet(const void *address)
Returns a QMutex from the global mutex pool.
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
static QDateTime fileTimeToQDateTime(const FILETIME *time)
static void clearWinStatData(QFileSystemMetaData &data)
static QFileSystemEntry canonicalName(const QFileSystemEntry &entry, QFileSystemMetaData &data)
const ushort * utf16() const
Returns the QString as a '\0\'-terminated array of unsigned shorts.