OSDN Git Service

Ver0.26
[gefu/Gefu.git] / win32.cpp
1 //#define Q_OS_WIN
2
3 #include "win32.h"
4
5 #ifdef Q_OS_WIN
6     #include <windows.h>
7 #endif
8
9 ///////////////////////////////////////////////////////////////////////////////
10 /// \brief Win32::hasSystemAttribute
11 /// \param path パス
12 /// \return システム属性ファイルであればtrueを返します。
13 ///
14 bool Win32::hasSystemAttribute(const QString &path)
15 {
16 #ifdef Q_OS_WIN
17     DWORD dwFlags = ::GetFileAttributes(path.toStdWString().c_str());
18     if (dwFlags != DWORD(-1) &&
19         (dwFlags & FILE_ATTRIBUTE_SYSTEM) == FILE_ATTRIBUTE_SYSTEM)
20     {
21         return true;
22     }
23 #else
24     Q_UNUSED(path);
25 #endif
26     return false;
27 }