YSTest: MinGW32.h 源文件

YSTest PreAlpha_b700_20160611 The YSLib Test Project

- 首页
- 相关页面
- 模块
- 命名空间
- 类
- 文件

- 文件列表
- 文件成员

MinGW32.h
浏览该文件的文档.
1 /*
2 © 2013-2016 FrankHB.
3
4 This file is part of the YSLib project, and may only be used,
5 modified, and distributed under the terms of the YSLib project
6 license, LICENSE.TXT. By continuing to use, modify, or distribute
7 this file you indicate that you have read the license and
8 understand and accept it fully.
9 */
10
29 #ifndef YCL_MinGW32_INC_MinGW32_h_
30 #define YCL_MinGW32_INC_MinGW32_h_ 1
31
32 #include "YCLib/YModules.h"
33 #include YFM_YCLib_Host
34 #include YFM_YCLib_NativeAPI // for MAX_PATH;
35 #if !YCL_Win32
36 # error "This file is only for Win32."
37 #endif
38 #include YFM_YCLib_Debug // for string, platform::Deref, wstring, ystdex::ends_with, pair;
39 #include <ystdex/enum.hpp> // for ystdex::enum_union, ystdex::wrapped_enum_traits_t;
40 #include YFM_YCLib_FileIO // for platform::NodeCategory;
41 #include <chrono> // for std::chrono::nanoseconds;
42
43 namespace platform_ex
44 {
45
50 inline namespace Windows
51 {
52
54 using ErrorCode = unsigned long;
55
61 YF_API YB_STATELESS int
62 ConvertToErrno(ErrorCode) ynothrow;
63
68 inline PDefH(int, GetErrnoFromWin32, ) ynothrow
69 ImplRet(ConvertToErrno(::GetLastError()))
70
71
77 class YF_API Win32Exception : public Exception
78 {
79 public:
86 Win32Exception(ErrorCode, string_view = "Win32 exception",
87 YSLib::RecordLevel = YSLib::Emergent);
92 YB_NONNULL(4)
93 Win32Exception(ErrorCode, string_view, const char*,
94 YSLib::RecordLevel = YSLib::Emergent);
96 DefDeCopyCtor(Win32Exception)
102 ~Win32Exception() override;
103
104 DefGetter(const ynothrow, ErrorCode, ErrorCode, ErrorCode(code().value()))
106 DefGetter(const ynothrow, std::string, Message,
107 FormatMessage(GetErrorCode()))
108
109 explicit DefCvt(const ynothrow, ErrorCode, GetErrorCode())
110
111
116 static const std::error_category&
117 GetErrorCategory();
118
123 static std::string
124 FormatMessage(ErrorCode) ynothrow;
126 };
127
128
130
131 # define YCL_Raise_Win32Exception(...) \
133 { \
134 const auto err(::GetLastError()); \
135 \
136 throw platform_ex::Windows::Win32Exception(err, __VA_ARGS__); \
137 }
138
140 # define YCL_Raise_Win32Exception_On_Failure(_expr, ...) \
141 { \
142 const auto err(Windows::ErrorCode(_expr)); \
143 \
144 if(err != ERROR_SUCCESS) \
145 throw platform_ex::Windows::Win32Exception(err, __VA_ARGS__); \
146 }
147
148
153 # define YCL_Trace_Win32Error(_lv, _fn, _msg) \
154 YTraceDe(_lv, "Error %lu: failed calling " #_fn " @ %s.", \
155 ::GetLastError(), _msg)
156
167 # define YCL_WrapCallWin32(_fn, ...) \
168 [&](const char* msg) YB_NONNULL(1){ \
169 const auto res(_fn(__VA_ARGS__)); \
170 \
171 if(YB_UNLIKELY(!res)) \
172 YCL_Raise_Win32Exception(#_fn, msg); \
173 return res; \
174 }
175
176 # define YCL_CallWin32(_fn, _msg, ...) YCL_WrapCallWin32(_fn, __VA_ARGS__)(_msg)
177
179 # define YCL_CallWin32F(_fn, ...) YCL_CallWin32(_fn, yfsig, __VA_ARGS__)
180
181
189 # define YCL_WrapCallWin32_Trace(_fn, ...) \
190 [&](const char* msg) YB_NONNULL(1){ \
191 const auto res(_fn(__VA_ARGS__)); \
192 \
193 if(YB_UNLIKELY(!res)) \
194 YCL_Trace_Win32Error(platform::Descriptions::Warning, _fn, msg); \
195 return res; \
196 }
197
198 # define YCL_CallWin32_Trace(_fn, _msg, ...) \
199 YCL_WrapCallWin32_Trace(_fn, __VA_ARGS__)(_msg)
200
202 # define YCL_CallWin32F_Trace(_fn, ...) \
203 YCL_CallWin32_Trace(_fn, yfsig, __VA_ARGS__)
204
205
206
207
209
210 using ModuleProc
212 = ystdex::remove_reference_t<decltype(*::GetProcAddress(::HMODULE(), {}))>;
213
219 YF_API YB_ATTR_returns_nonnull YB_NONNULL(2) ModuleProc*
220 LoadProc(::HMODULE, const char*);
221 template<typename _func>
222 inline YB_NONNULL(2) _func&
223 LoadProc(::HMODULE h_module, const char* proc)
224 {
225 return platform::Deref(reinterpret_cast<_func*>(LoadProc(h_module, proc)));
226 }
227 template<typename _func>
228 YB_NONNULL(1, 2) _func&
229 LoadProc(const wchar_t* module, const char* proc)
230 {
231 return LoadProc<_func>(YCL_CallWin32F(GetModuleHandleW, module), proc);
232 }
234
235
236 #define YCL_Impl_W32Call_Fn(_fn) W32_##_fn##_t
237 #define YCL_Impl_W32Call_FnCall(_fn) W32_##_fn##_call
238
244 #define YCL_DeclW32Call(_fn, _module, _tRet, ...) \
245 YCL_DeclCheck_t(_fn, _fn) \
246 using YCL_Impl_W32Call_Fn(_fn) = _tRet __stdcall(__VA_ARGS__); \
247 \
248 template<typename... _tParams> \
249 auto \
250 YCL_Impl_W32Call_FnCall(_fn)(_tParams&&... args) \
251 -> YCL_CheckDecl_t(_fn)<_tParams...> \
252 { \
253 return _fn(yforward(args)...); \
254 } \
255 template<typename... _tParams> \
256 ystdex::enable_fallback_t<YCL_CheckDecl_t(_fn), \
257 YCL_Impl_W32Call_Fn(_fn), _tParams...> \
258 YCL_Impl_W32Call_FnCall(_fn)(_tParams&&... args) \
259 { \
260 return platform_ex::Windows::LoadProc<YCL_Impl_W32Call_Fn(_fn)>( \
261 L###_module, #_fn)(yforward(args)...); \
262 } \
263 \
264 template<typename... _tParams> \
265 auto \
266 _fn(_tParams&&... args) \
267 -> decltype(YCL_Impl_W32Call_FnCall(_fn)(yforward(args)...)) \
268 { \
269 return YCL_Impl_W32Call_FnCall(_fn)(yforward(args)...); \
270 }
271
272
273
278 YF_API wstring
279 FetchModuleFileName(::HMODULE = {});
280
281
282
284
285 struct YF_API GlobalDelete
287 {
288 using pointer = ::HGLOBAL;
289
290 void
291 operator()(pointer) const ynothrow;
292 };
293
294
296 class YF_API GlobalLocked
297 {
298 private:
300 void* p_locked;
301
302 public:
308 GlobalLocked(::HGLOBAL);
309 template<typename _tPointer>
310 GlobalLocked(const _tPointer& p)
311 : GlobalLocked(p.get())
312 {}
314 ~GlobalLocked();
315
316 template<typename _type = void>
317 observer_ptr<_type>
318 GetPtr() const ynothrow
319 {
320 return make_observer(static_cast<_type*>(p_locked));
321 }
322 };
324
325
330 struct YF_API LocalDelete
331 {
332 using pointer = ::HLOCAL;
333
334 void
335 operator()(pointer) const ynothrow;
336 };
337
338
340
341
346 enum class AccessRights : ::ACCESS_MASK
347 {
348 None = 0,
349 GenericRead = GENERIC_READ,
350 GenericWrite = GENERIC_WRITE,
351 GenericReadWrite = GenericRead | GenericWrite,
352 GenericExecute = GENERIC_EXECUTE,
353 GenericAll = GENERIC_ALL,
354 MaximumAllowed = MAXIMUM_ALLOWED,
355 AccessSystemACL = ACCESS_SYSTEM_SECURITY,
356 Delete = DELETE,
357 ReadControl = READ_CONTROL,
358 Synchronize = SYNCHRONIZE,
359 WriteDAC = WRITE_DAC,
360 WriteOwner = WRITE_OWNER,
361 All = STANDARD_RIGHTS_ALL,
362 Execute = STANDARD_RIGHTS_EXECUTE,
363 StandardRead = STANDARD_RIGHTS_READ,
364 Required = STANDARD_RIGHTS_REQUIRED,
365 StandardWrite = STANDARD_RIGHTS_WRITE
366 };
367
369 DefBitmaskEnum(AccessRights)
370
371
372 enum class FileSpecificAccessRights : ::ACCESS_MASK
374 {
375 AddFile = FILE_ADD_FILE,
376 AddSubdirectory = FILE_ADD_SUBDIRECTORY,
377 AllAccess = FILE_ALL_ACCESS,
378 AppendData = FILE_APPEND_DATA,
379 CreatePipeInstance = FILE_CREATE_PIPE_INSTANCE,
380 DeleteChild = FILE_DELETE_CHILD,
381 Execute = FILE_EXECUTE,
382 ListDirectory = FILE_LIST_DIRECTORY,
383 ReadAttributes = FILE_READ_ATTRIBUTES,
384 ReadData = FILE_READ_DATA,
385 ReadEA = FILE_READ_EA,
386 Traverse = FILE_TRAVERSE,
387 WriteAttributes = FILE_WRITE_ATTRIBUTES,
388 WriteData = FILE_WRITE_DATA,
389 WriteEA = FILE_WRITE_EA,
390 Read = STANDARD_RIGHTS_READ,
391 Write = STANDARD_RIGHTS_WRITE
392 };
393
395 DefBitmaskEnum(FileSpecificAccessRights)
396
397
398 using FileAccessRights
400 = ystdex::enum_union<AccessRights, FileSpecificAccessRights>;
401
403 DefBitmaskOperations(FileAccessRights,
404 ystdex::wrapped_enum_traits_t<FileAccessRights>)
405
406
408 enum class FileShareMode : ::ACCESS_MASK
409 {
410 None = 0,
411 Delete = FILE_SHARE_DELETE,
412 Read = FILE_SHARE_READ,
413 Write = FILE_SHARE_WRITE,
414 ReadWrite = Read | Write,
415 All = Delete | Read | Write
416 };
417
419 DefBitmaskEnum(FileShareMode)
420
421
422 enum class CreationDisposition : unsigned long
424 {
425 CreateAlways = CREATE_ALWAYS,
426 CreateNew = CREATE_NEW,
427 OpenAlways = OPEN_ALWAYS,
428 OpenExisting = OPEN_EXISTING,
429 TruncateExisting = TRUNCATE_EXISTING
430 };
432
433
435
436 enum FileAttributes : unsigned long
438 {
439 ReadOnly = FILE_ATTRIBUTE_READONLY,
440 Hidden = FILE_ATTRIBUTE_HIDDEN,
441 System = FILE_ATTRIBUTE_SYSTEM,
442 Directory = FILE_ATTRIBUTE_DIRECTORY,
443 Archive = FILE_ATTRIBUTE_ARCHIVE,
444 Device = FILE_ATTRIBUTE_DEVICE,
445 Normal = FILE_ATTRIBUTE_NORMAL,
446 Temporary = FILE_ATTRIBUTE_TEMPORARY,
447 SparseFile = FILE_ATTRIBUTE_SPARSE_FILE,
448 ReparsePoint = FILE_ATTRIBUTE_REPARSE_POINT,
449 Compressed = FILE_ATTRIBUTE_COMPRESSED,
450 Offline = FILE_ATTRIBUTE_OFFLINE,
451 NotContentIndexed = FILE_ATTRIBUTE_NOT_CONTENT_INDEXED,
452 Encrypted = FILE_ATTRIBUTE_ENCRYPTED,
453 // IntegrityStream = FILE_ATTRIBUTE_INTEGRITY_STREAM,
454 IntegrityStream = 0x8000,
455 Virtual = FILE_ATTRIBUTE_VIRTUAL,
456 // NoScrubData = FILE_ATTRIBUTE_NO_SCRUB_DATA,
457 NoScrubData = 0x20000,
458 // EA = FILE_ATTRIBUTE_EA,
460 EA = 0x40000,
461 Invalid = INVALID_FILE_ATTRIBUTES
462 };
463
465 enum FileFlags : unsigned long
466 {
467 WriteThrough = FILE_FLAG_WRITE_THROUGH,
468 Overlapped = FILE_FLAG_OVERLAPPED,
469 NoBuffering = FILE_FLAG_NO_BUFFERING,
470 RandomAccess = FILE_FLAG_RANDOM_ACCESS,
471 SequentialScan = FILE_FLAG_SEQUENTIAL_SCAN,
472 DeleteOnClose = FILE_FLAG_DELETE_ON_CLOSE,
473 BackupSemantics = FILE_FLAG_BACKUP_SEMANTICS,
474 POSIXSemantics = FILE_FLAG_POSIX_SEMANTICS,
475 SessionAware = FILE_FLAG_SESSION_AWARE,
476 OpenReparsePoint = FILE_FLAG_OPEN_REPARSE_POINT,
477 OpenNoRecall = FILE_FLAG_OPEN_NO_RECALL,
478 // \see https://msdn.microsoft.com/zh-cn/library/windows/desktop/aa365150(v=vs.85).aspx 。
479 FirstPipeInstance = FILE_FLAG_FIRST_PIPE_INSTANCE
480 };
481
482 enum SecurityQoS : unsigned long
483 {
484 Anonymous = SECURITY_ANONYMOUS,
485 ContextTracking = SECURITY_CONTEXT_TRACKING,
486 Delegation = SECURITY_DELEGATION,
487 EffectiveOnly = SECURITY_EFFECTIVE_ONLY,
488 Identification = SECURITY_IDENTIFICATION,
489 Impersonation = SECURITY_IMPERSONATION,
490 Present = SECURITY_SQOS_PRESENT,
491 ValidFlags = SECURITY_VALID_SQOS_FLAGS
492 };
493
494 enum FileAttributesAndFlags : unsigned long
495 {
496 NormalWithDirectory = Normal | BackupSemantics,
497 NormalAll = NormalWithDirectory | OpenReparsePoint
498 };
500
501
506 inline PDefH(bool, IsDirectory, const ::WIN32_FIND_DATAA& d) ynothrow
507 ImplRet(d.dwFileAttributes & Directory)
512 inline PDefH(bool, IsDirectory, const ::WIN32_FIND_DATAW& d) ynothrow
513 ImplRet(d.dwFileAttributes & Directory)
514
522 YF_API platform::NodeCategory
523 CategorizeNode(const ::WIN32_FIND_DATAW&) ynothrow;
531 YF_API platform::NodeCategory
532 CategorizeNode(UniqueHandle::pointer) ynothrowv;
533
534
542 YF_API YB_NONNULL(1) UniqueHandle
543 MakeFile(const wchar_t*, FileAccessRights = AccessRights::None,
544 FileShareMode = FileShareMode::All, CreationDisposition
545 = CreationDisposition::OpenExisting,
546 FileAttributesAndFlags = FileAttributesAndFlags::NormalAll) ynothrowv;
548 inline YB_NONNULL(1) PDefH(UniqueHandle, MakeFile, const wchar_t* path,
549 FileAccessRights desired_access, FileShareMode shared_mode,
550 FileAttributesAndFlags attributes_and_flags) ynothrowv
551 ImplRet(MakeFile(path, desired_access, shared_mode,
552 CreationDisposition::OpenExisting, attributes_and_flags))
553 inline YB_NONNULL(1) PDefH(UniqueHandle, MakeFile, const wchar_t* path,
554 FileAccessRights desired_access, CreationDisposition creation_disposition,
555 FileAttributesAndFlags attributes_and_flags
556 = FileAttributesAndFlags::NormalAll) ynothrowv
557 ImplRet(MakeFile(path, desired_access, FileShareMode::All,
558 creation_disposition, attributes_and_flags))
560 inline YB_NONNULL(1) PDefH(UniqueHandle, MakeFile, const wchar_t* path,
561 FileAccessRights desired_access,
562 FileAttributesAndFlags attributes_and_flags) ynothrowv
563 ImplRet(MakeFile(path, desired_access, FileShareMode::All,
564 CreationDisposition::OpenExisting, attributes_and_flags))
566
567 inline YB_NONNULL(1) PDefH(UniqueHandle, MakeFile, const wchar_t* path,
568 FileShareMode shared_mode, CreationDisposition creation_disposition
569 = CreationDisposition::OpenExisting, FileAttributesAndFlags
570 attributes_and_flags = FileAttributesAndFlags::NormalAll) ynothrowv
571 ImplRet(MakeFile(path, AccessRights::None, shared_mode,
572 creation_disposition, attributes_and_flags))
573 inline YB_NONNULL(1) PDefH(UniqueHandle, MakeFile, const wchar_t* path,
574 CreationDisposition creation_disposition
575 = CreationDisposition::OpenExisting, FileAttributesAndFlags
576 attributes_and_flags = FileAttributesAndFlags::NormalAll) ynothrowv
577 ImplRet(MakeFile(path, AccessRights::None, FileShareMode::All,
578 creation_disposition, attributes_and_flags))
579 inline YB_NONNULL(1) PDefH(UniqueHandle, MakeFile, const wchar_t* path,
580 FileShareMode shared_mode, FileAttributesAndFlags
581 attributes_and_flags = FileAttributesAndFlags::NormalAll) ynothrowv
582 ImplRet(MakeFile(path, AccessRights::None, shared_mode,
583 CreationDisposition::OpenExisting, attributes_and_flags))
584 inline YB_NONNULL(1) PDefH(UniqueHandle, MakeFile, const wchar_t* path,
585 FileAttributesAndFlags attributes_and_flags) ynothrowv
586 ImplRet(MakeFile(path, AccessRights::None, FileShareMode::All,
587 CreationDisposition::OpenExisting, attributes_and_flags))
589
590
591
608 YF_API void
609 FixConsoleHandler(int(WINAPI*)(unsigned long) = {}, bool = true);
610
616 YF_API bool
617 CheckWine();
618
619
628 YF_API YB_NONNULL(1) string
630 MBCSToMBCS(const char*, unsigned = CP_UTF8, unsigned = CP_ACP);
632 YF_API string
633 MBCSToMBCS(string_view, unsigned = CP_UTF8, unsigned = CP_ACP);
634
636 YF_API YB_NONNULL(1) wstring
637 MBCSToWCS(const char*, unsigned = CP_ACP);
639 YF_API wstring
640 MBCSToWCS(string_view, unsigned = CP_ACP);
641
643 YF_API YB_NONNULL(1) string
644 WCSToMBCS(const wchar_t*, unsigned = CP_ACP);
646 YF_API string
647 WCSToMBCS(wstring_view, unsigned = CP_ACP);
648
650 inline YB_NONNULL(1) PDefH(wstring, UTF8ToWCS, const char* str)
651 ImplRet(MBCSToWCS(str, CP_UTF8))
653 inline PDefH(wstring, UTF8ToWCS, string_view sv)
654 ImplRet(MBCSToWCS(sv, CP_UTF8))
655
657 inline YB_NONNULL(1) PDefH(string, WCSToUTF8, const wchar_t* str)
658 ImplRet(WCSToMBCS(str, CP_UTF8))
660 inline PDefH(string, WCSToUTF8, wstring_view sv)
661 ImplRet(WCSToMBCS(sv, CP_UTF8))
663
664
669 class YF_API DirectoryFindData : private ystdex::noncopyable
670 {
671 private:
679 wstring dir_name;
681 ::WIN32_FIND_DATAW find_data;
683 ::HANDLE h_node = {};
688 wstring d_name{};
689
690 public:
700 DirectoryFindData(wstring_view);
702 ~DirectoryFindData();
703
705 DefBoolNeg(explicit, h_node)
706
707
708 DefGetter(const ynothrow, unsigned long, Attributes,
709 find_data.dwFileAttributes)
710 DefGetter(const ynothrow, const ::WIN32_FIND_DATAW&, FindData, find_data)
712 DefGetter(const ynothrow, const wstring&, DirName, (YAssert(
713 dir_name.length() > 1 && ystdex::ends_with(dir_name, L"\\*"),
714 "Invalid directory name found."), dir_name))
715
726 platform::NodeCategory
727 GetNodeCategory() const ynothrow;
728
729 private:
734 void
735 Close() ynothrow;
736
737 public:
747 observer_ptr<wstring>
748 Read();
749
751 void
752 Rewind() ynothrow;
753 };
754
755
765 YF_API YB_NONNULL(1) wstring
766 ResolveReparsePoint(const wchar_t*);
767
768
774 using FileID = std::uint64_t;
777 using VolumeID = std::uint32_t;
779
781
782
784
786 YF_API size_t
788 QueryFileLinks(UniqueHandle::pointer);
793 YF_API YB_NONNULL(1) size_t
794 QueryFileLinks(const wchar_t*, bool = {});
796
804 YF_API pair<VolumeID, FileID>
806 QueryFileNodeID(UniqueHandle::pointer);
811 YF_API YB_NONNULL(1) pair<VolumeID, FileID>
812 QueryFileNodeID(const wchar_t*, bool = {});
814
815
816 /*
817 \note 后三个参数可选，指针为空时忽略。
818 \note 最高精度取决于文件系统。
819 */
821
823
828 YF_API void
829 QueryFileTime(UniqueHandle::pointer, ::FILETIME* = {}, ::FILETIME* = {},
830 ::FILETIME* = {});
836 YF_API YB_NONNULL(1) void
837 QueryFileTime(const wchar_t*, ::FILETIME* = {}, ::FILETIME* = {},
838 ::FILETIME* = {}, bool = {});
840
850 YF_API void
851 SetFileTime(UniqueHandle::pointer, ::FILETIME* = {}, ::FILETIME* = {},
852 ::FILETIME* = {});
857 YF_API YB_NONNULL(1) void
858 SetFileTime(const wchar_t*, ::FILETIME* = {}, ::FILETIME* = {},
859 ::FILETIME* = {}, bool = {});
861
862
863
873 YF_API std::chrono::nanoseconds
874 ConvertTime(const ::FILETIME&);
879 YF_API ::FILETIME
880 ConvertTime(std::chrono::nanoseconds);
882
884
885
890 YF_API YB_NONNULL(1) wstring
891 ExpandEnvironmentStrings(const wchar_t*);
892
894
895
899 YF_API wstring
900 FetchSystemPath(size_t = MAX_PATH);
901
906 YF_API wstring
907 FetchWindowsPath(size_t = MAX_PATH);
909
910
911 } // inline namespace Windows;
912
913 } // namespace platform_ex;
914
915 #endif
916
platform_ex::Windows::AccessRights::Synchronize
platform::p
while p p
Definition: YCLib/FileSystem.h:225
platform_ex::Windows::Temporary
Definition: MinGW32.h:446
platform_ex::Windows::AccessRights::MaximumAllowed
platform_ex::Windows::SetFileTime
YF_API void SetFileTime(UniqueHandle::pointer,::FILETIME *={},::FILETIME *={},::FILETIME *={})
设置文件的创建、访问和/或修改时间。
platform_ex::Windows::IntegrityStream
Definition: MinGW32.h:454
YB_STATELESS
#define YB_STATELESS
指示函数或函数模板实例为无状态函数。
Definition: ydef.h:522
ystdex::string_view
basic_string_view< char > string_view
Definition: string_view.hpp:415
platform_ex::Windows::Archive
Definition: MinGW32.h:443
ynothrow
#define ynothrow
YSLib 无异常抛出保证：若支持 noexcept 关键字， 指定特定的 noexcept 异常规范。
Definition: ydef.h:740
platform::containers::string
basic_string< char > string
Definition: Container.h:101
YSLib::IO::Traverse
void Traverse(const string &path, _func f)
Definition: YSLib/Service/FileSystem.h:454
platform_ex::Windows::RandomAccess
Definition: MinGW32.h:470
platform_ex::Windows::GlobalLocked
全局锁定存储。
Definition: MinGW32.h:296
platform_ex::Windows::shared_mode
const wchar_t FileAccessRights FileShareMode shared_mode
Definition: MinGW32.h:548
platform_ex::Windows::NoScrubData
Definition: MinGW32.h:457
platform_ex::Windows::AccessRights::StandardWrite
platform::KeyCodes::DS::L
Definition: Keys.h:227
platform_ex::Windows::Hidden
Definition: MinGW32.h:440
DefBitmaskEnum
#define DefBitmaskEnum(_tEnum)
Definition: YBaseMacro.h:475
platform_ex::Windows::Normal
Definition: MinGW32.h:445
platform_ex::Windows::OpenNoRecall
Definition: MinGW32.h:477
platform_ex::Windows::ReparsePoint
Definition: MinGW32.h:448
platform_ex::Windows::Overlapped
Definition: MinGW32.h:468
SecurityQoS
SecurityQoS
Definition: MinGW32.h:482
platform_ex::Windows::QueryFileTime
YF_API void QueryFileTime(UniqueHandle::pointer,::FILETIME *={},::FILETIME *={},::FILETIME *={})
查询文件的创建、访问和/或修改时间。
platform_ex::Windows::EA
Definition: MinGW32.h:460
YSLib::UI::Close
void Close(IWidget &wgt)
Definition: YWidget.cpp:92
DefBitmaskOperations
#define DefBitmaskOperations(_tBitmask, _tInt)
Definition: YBaseMacro.h:462
platform_ex::Windows::NoBuffering
Definition: MinGW32.h:469
platform::NodeCategory
NodeCategory
文件节点类别。
Definition: FileIO.h:117
platform_ex::Windows::BackupSemantics
Definition: MinGW32.h:473
platform_ex::Windows::GlobalDelete::pointer
::HGLOBAL pointer
Definition: MinGW32.h:288
ystdex::cpp2014::remove_reference_t
typename remove_reference< _type >::type remove_reference_t
Definition: type_traits.hpp:304
ystdex::wrapped_enum_traits_t
_t< wrapped_enum_traits< _type >> wrapped_enum_traits_t
Definition: enum.hpp:54
ynothrowv
#define ynothrowv
YSLib 无异常抛出保证验证：有条件地使用无异常抛出规范。
Definition: ydef.h:760
platform_ex::Windows::FileID
std::uint64_t FileID
文件标识。
Definition: MinGW32.h:775
YAssert
#define YAssert(_expr, _msg)
Definition: cassert.h:105
CHRLib::d
_tDst * d
Definition: CharacterProcessing.h:139
platform_ex::Windows::FetchWindowsPath
YF_API wstring FetchWindowsPath(size_t=MAX_PATH)
取系统目录路径。
platform_ex::Windows::Present
Definition: MinGW32.h:490
platform_ex::Windows::GlobalLocked::GetPtr
observer_ptr< _type > GetPtr() const ynothrow
Definition: MinGW32.h:318
platform_ex::Windows::CheckWine
YF_API bool CheckWine()
判断是否在 Wine 环境下运行。
platform_ex::Windows::SessionAware
Definition: MinGW32.h:475
platform_ex::Windows::Directory
Definition: MinGW32.h:442
platform_ex::Windows::CreationDisposition
YF_API CreationDisposition
Definition: MinGW32.h:545
platform_ex::Windows::AccessRights
AccessRights
访问权限。
Definition: MinGW32.h:346
platform_ex::Windows::Anonymous
Definition: MinGW32.h:484
ystdex::wstring_view
basic_string_view< wchar_t > wstring_view
Definition: string_view.hpp:418
platform_ex::Windows::Compressed
Definition: MinGW32.h:449
platform_ex::Windows::OpenReparsePoint
Definition: MinGW32.h:476
platform_ex::Windows::AccessRights::GenericExecute
platform_ex::Windows::System
Definition: MinGW32.h:441
platform_ex::Windows::Impersonation
Definition: MinGW32.h:489
platform_ex::Windows::GlobalLocked::GlobalLocked
GlobalLocked(const _tPointer &p)
Definition: MinGW32.h:310
DefGetter
#define DefGetter(_q, _t, _n,...)
Definition: YBaseMacro.h:240
platform::Descriptions::Emergent
Definition: YCommon.h:153
platform_ex::Windows::NotContentIndexed
Definition: MinGW32.h:451
platform_ex::Windows::Invalid
Definition: MinGW32.h:461
platform_ex::Windows::GlobalLocked::p_locked
void * p_locked
Definition: MinGW32.h:300
platform_ex::Windows::ValidFlags
Definition: MinGW32.h:491
platform_ex::Windows::LocalDelete
局部存储删除器。
Definition: MinGW32.h:330
YCL_CallWin32F
#define YCL_CallWin32F(_fn,...)
Definition: MinGW32.h:179
DefCvt
#define DefCvt(_q, _t,...)
Definition: YBaseMacro.h:205
platform_ex::Windows::AccessRights::GenericReadWrite
platform_ex::Windows::AccessRights::None
platform_ex::Windows::SparseFile
Definition: MinGW32.h:447
platform_ex::Windows::QueryFileNodeID
YF_API pair< VolumeID, FileID > QueryFileNodeID(UniqueHandle::pointer)
查询文件标识。
FileAttributesAndFlags
FileAttributesAndFlags
Definition: MinGW32.h:494
platform_ex::Windows::PDefH
PDefH(wstring, FetchCPFileNameFromRegistry, int cp) ImplRet(FetchNLSItemFromRegistry(to_wstring(cp).c_str())) YF_API const unsigned short *FetchDBCSOffset(int) ynothrow
取注册表中指定代码页的 NLS 文件路径。
platform_ex::Windows::AccessRights::WriteDAC
FileAttributes
FileAttributes
文件共享模式。
Definition: MinGW32.h:437
platform
默认平台命名空间。
Definition: Container.h:47
platform_ex::Windows::ConvertTime
YF_API std::chrono::nanoseconds ConvertTime(const ::FILETIME &)
转换文件时间为以 POSIX 历元起始度量的时间间隔。
std
Definition: memory.hpp:1100
platform::Deref
yconstfn auto Deref(_type &&p) -> decltype(*p)
断言并解引用非空指针。
Definition: Debug.h:440
platform_ex::Windows::AccessRights::GenericRead
platform_ex::Windows::ImplRet
const wchar_t FileAccessRights FileShareMode FileAttributesAndFlags attributes_and_flags ynothrowv ImplRet(MakeFile(path, desired_access, shared_mode, CreationDisposition::OpenExisting, attributes_and_flags)) inline YB_NONNULL(1) PDefH(UniqueHandle
platform_ex::Windows::FirstPipeInstance
Definition: MinGW32.h:479
platform_ex::Windows::FileAccessRights
YF_API FileAccessRights
Definition: MinGW32.h:543
platform_ex::Windows::NormalAll
Definition: MinGW32.h:497
platform_ex::Windows::ConvertToErrno
YF_API YB_STATELESS int ConvertToErrno(ErrorCode) ynothrow
转换 Win32 错误为 errno 。
platform_ex::Windows::SequentialScan
Definition: MinGW32.h:471
platform_ex::Windows::CategorizeNode
const ::WIN32_FIND_DATAW &d ynothrow ImplRet(d.dwFileAttributes &Directory) YF_API platform YF_API platform::NodeCategory CategorizeNode(UniqueHandle::pointer) ynothrowv
按 ::WIN32_FIND_DATAW 归类节点类别。
Definition: MinGW32.h:532
platform_ex::Windows::MBCSToMBCS
YF_API string MBCSToMBCS(string_view, unsigned=CP_UTF8, unsigned=CP_ACP)
platform_ex::Windows::AccessRights::ReadControl
DefDeCopyCtor
#define DefDeCopyCtor(_t)
Definition: YBaseMacro.h:161
platform_ex::Windows::POSIXSemantics
Definition: MinGW32.h:474
platform::containers::wstring
basic_string< wchar_t > wstring
Definition: Container.h:108
platform_ex
平台扩展命名空间。
Definition: Android.h:45
platform_ex::Windows::FetchModuleFileName
YF_API wstring FetchModuleFileName(::HMODULE={})
取模块映像路径。
platform_ex::Windows::EffectiveOnly
Definition: MinGW32.h:487
ystdex
特性测试宏。
Definition: ydef.h:796
YSLib::Text::str
const char const char * str
Definition: TextFile.h:77
platform_ex::Windows::AccessRights::Execute
platform_ex::Windows::AccessRights::Required
platform_ex::Windows::WCSToMBCS
YF_API string WCSToMBCS(wstring_view, unsigned=CP_ACP)
platform_ex::Windows::ContextTracking
Definition: MinGW32.h:485
platform_ex::Windows::VolumeID
std::uint32_t VolumeID
卷序列号。
Definition: MinGW32.h:777
platform_ex::Windows::AccessRights::WriteOwner
enum.hpp
枚举相关操作。
YModules.h
platform_ex::Windows::DeleteOnClose
Definition: MinGW32.h:472
platform_ex::Windows::YB_NONNULL
YF_API YB_ATTR_returns_nonnull YB_NONNULL(2) ModuleProc *LoadProc( YB_NONNULL(2) _func &LoadProc(
从模块加载指定过程的指针。
Definition: MinGW32.h:222
platform_ex::Windows::MBCSToWCS
YF_API wstring MBCSToWCS(string_view, unsigned=CP_ACP)
platform_ex::Windows::AccessRights::Delete
platform_ex::Windows::Delegation
Definition: MinGW32.h:486
platform_ex::Windows::FetchSystemPath
YF_API wstring FetchSystemPath(size_t=MAX_PATH)
取系统目录路径。
platform_ex::Windows::creation_disposition
const wchar_t FileAccessRights FileShareMode FileAttributesAndFlags attributes_and_flags ynothrowv const wchar_t FileAccessRights CreationDisposition creation_disposition
Definition: MinGW32.h:553
platform_ex::Windows::proc
const char * proc
Definition: MinGW32.h:230
platform_ex::Windows::MakeFile
MakeFile
Definition: MinGW32.h:548
FileFlags
FileFlags
Definition: MinGW32.h:465
platform_ex::Windows::AccessRights::GenericAll
platform_ex::Windows::NormalWithDirectory
Definition: MinGW32.h:496
platform_ex::Windows::attributes_and_flags
const wchar_t FileAccessRights FileShareMode FileAttributesAndFlags attributes_and_flags ynothrowv const wchar_t FileAccessRights CreationDisposition FileAttributesAndFlags attributes_and_flags
Definition: MinGW32.h:556
platform_ex::Windows::WriteThrough
Definition: MinGW32.h:467
platform_ex::Windows::path
const wchar_t * path
Definition: MinGW32.h:548
platform_ex::Windows::QueryFileLinks
YF_API size_t QueryFileLinks(UniqueHandle::pointer)
查询文件链接数。
platform_ex::Windows::AccessRights::GenericWrite
DefBoolNeg
#define DefBoolNeg(_spec,...)
定义表示显式转换 bool 操作符及其否定的 operator! 。
Definition: YBaseMacro.h:227
ystdex::make_observer
observer_ptr< _type > make_observer(_type *p)
Definition: memory.hpp:1042
platform_ex::Windows::desired_access
const wchar_t FileAccessRights desired_access
Definition: MinGW32.h:548
platform_ex::Windows::WCSToUTF8
const char *str string_view sv WCSToUTF8
Definition: MinGW32.h:657
platform::Descriptions::RecordLevel
RecordLevel
记录等级。
Definition: YCommon.h:151
YF_API
#define YF_API
Definition: Platform.h:56
ystdex::ends_with
bool ends_with(const _tRange1 &input, const _tRange2 &test, _fPred comp)
判断第一个参数指定的串是否以第二个参数结束。
Definition: string.hpp:362
YB_ATTR_returns_nonnull
#define YB_ATTR_returns_nonnull
指示返回非空属性。
Definition: ydef.h:390
platform_ex::Windows::ModuleProc
ystdex::remove_reference_t< decltype(*::GetProcAddress(::HMODULE(),{}))> ModuleProc
加载过程地址得到的过程类型。
Definition: MinGW32.h:212
platform_ex::Windows::Encrypted
Definition: MinGW32.h:452
platform_ex::Windows::Virtual
Definition: MinGW32.h:455
platform_ex::Windows::IsDirectory
IsDirectory
Definition: MinGW32.h:512
platform_ex::Windows::Device
Definition: MinGW32.h:444
platform_ex::Windows::ErrorCode
unsigned long ErrorCode
Definition: MinGW32.h:54
platform_ex::Windows::Identification
Definition: MinGW32.h:488
platform_ex::Windows::AccessRights::All
platform_ex::Windows::UTF8ToWCS
UTF8ToWCS
Definition: MinGW32.h:650
platform_ex::Windows::AccessRights::AccessSystemACL
platform_ex::Windows::FileShareMode
YF_API FileShareMode
Definition: MinGW32.h:544
platform_ex::Windows::Offline
Definition: MinGW32.h:450
platform_ex::Windows::ReadOnly
Definition: MinGW32.h:439
platform_ex::Windows::AccessRights::StandardRead
platform_ex::Windows::LocalDelete::pointer
::HLOCAL pointer
Definition: MinGW32.h:332