YSTest: DSIO.h 源文件

YSTest PreAlpha_b700_20160611 The YSLib Test Project

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

- 文件列表
- 文件成员

DSIO.h
浏览该文件的文档.
1 /*
2 © 2011-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_DS_INC_DSIO_h_
30 #define YCL_DS_INC_DSIO_h_ 1
31
32 #include "YCLib/YModules.h"
33 #include YFM_YCLib_YCommon // for size_t;
34 #if YCL_DS
35 # include YFM_YCLib_Reference // for lref;
36 # include <nds/disc_io.h> // for ::DISC_INTERFACE, ::sec_t;
37 # include <ystdex/base.h> // for ystdex::noncopyable, ystdex::nonmomable;
38 # include <ystdex/cache.hpp> // for ystdex::used_list_cache;
39 # include <ystdex/cstdio.h> //for ystdex::block_buffer;
40 # include YFM_YCLib_FileSystem // for platform::FAT, platform::Deref,
41 // platform::Concurrency, platform::FileSystemType, std::system_error, array,
42 // string, string_view;
43 # include <sys/syslimits.h> // for NAME_MAX.
44 # include <ystdex/optional.h> // for ystdex::ref_opt;
45 # include <bitset> // for std::bitset;
46 #endif
47
49 struct stat;
51 struct statvfs;
52
53 namespace platform_ex
54 {
55
56 #if YCL_DS
57
59
64 class YF_API Disc : private lref<const ::DISC_INTERFACE>
65 {
66 public:
67 Disc(const ::DISC_INTERFACE& disc) ynothrow
68 : lref(disc)
69 {}
70
71 DefPred(const ynothrow, Inserted, get().isInserted)
72 DefGetter(const ynothrow, std::uint32_t, Type, get().ioType)
73 DefGetter(const ynothrow, std::uint32_t, Features, get().features)
74
75 DefFwdTmpl(const ynothrow, bool, ReadSectors,
76 get().readSectors(yforward(args)...))
77
78 PDefH(bool, Shutdown, ) const ynothrow
79 ImplRet(get().shutdown())
80
81 PDefH(bool, Starup, ) const ynothrow
82 ImplRet(get().startup())
83
84 DefFwdTmpl(const ynothrow, bool, WriteSectors,
85 get().writeSectors(yforward(args)...))
86
87 using lref::get;
88 };
89
90
92 class YF_API SectorCache final : private ystdex::noncopyable,
93 private ystdex::nonmovable
94 {
95 private:
96 using UsedListCache
97 = ystdex::used_list_cache<::sec_t, ystdex::block_buffer>;
98 Disc disc;
99 size_t number_of_pages;
100 size_t sectors_per_page_shift;
101 ::sec_t end_of_partition;
102 size_t bytes_per_sector;
103 UsedListCache entries;
104
105 public:
106 SectorCache(size_t, size_t, Disc, ::sec_t, size_t);
107 ~SectorCache();
108
109 private:
111 size_t
112 GetBlockCount(::sec_t) const ynothrowv;
113
114 public:
116 DefGetter(const ynothrow, Disc, Disc, disc)
117
118 private:
119 PDefH(size_t, GetKey, ::sec_t sec) const ynothrowv
120 ImplRet(sec & ~((1 << sectors_per_page_shift) - 1))
122 ystdex::block_buffer*
123 GetPage(::sec_t) ynothrowv;
124
125 public:
127 YB_NONNULL(4) bool
128 EraseWritePartialSector(::sec_t, size_t, const void*, size_t = 1) ynothrowv;
129
131 bool
132 FillPartialSector(::sec_t, size_t, size_t = 1, byte = {}) ynothrowv;
133
135 bool
136 FillSectors(::sec_t, size_t = 1, byte = {}) ynothrow;
137
138 bool
139 Flush() ynothrow;
140
141 private:
142 bool
143 FlushEntry(UsedListCache::value_type&) ynothrow;
144
146
147 template<typename _func>
148 bool
149 PerformPartialSectorIO(_func f, ::sec_t sec, size_t offset, size_t n)
150 ynoexcept_spec(f(
151 std::declval<ystdex::block_buffer&>(), (sec - size_t(0)) * bytes_per_sector))
152 {
153 if(!(bytes_per_sector < offset + n))
154 {
155 const auto key(GetKey(sec));
156
157 if(const auto p_entry = GetPage(key))
158 {
159 f(*p_entry, (sec - key) * bytes_per_sector);
160 return true;
161 }
162 }
163 return {};
164 }
165
166 template<typename _func>
167 bool
168 PerformSectorsIO(_func f, ::sec_t& sec, size_t& n) ynoexcept_spec(
169 f(std::declval<ystdex::block_buffer&>(), sec - size_t(0), size_t(0)))
170 {
171 while(0 < n)
172 {
173 const auto key(GetKey(sec));
174
175 if(const auto p_entry = GetPage(key))
176 {
177 const auto sec_off(sec - key);
178 // TODO: Compare and assert 'count' and 'sec_off'?
179 const auto secs_to_process(
180 std::min<size_t>(GetBlockCount(key) - sec_off, n));
181
182 f(*p_entry, sec_off, secs_to_process);
183 yunseq(sec += secs_to_process, n -= secs_to_process);
184 }
185 else
186 return {};
187 }
188 return true;
189 }
190
191 public:
192 YB_NONNULL(2) bool
193 ReadPartialSector(void*, ::sec_t, size_t, size_t = 1) ynothrowv;
194
195 YB_NONNULL(2) bool
196 ReadSectors(void*, ::sec_t, size_t = 1) ynothrowv;
197
198 YB_NONNULL(4) bool
199 WritePartialSector(::sec_t, size_t, const void*, size_t = 1) ynothrowv;
200
201 YB_NONNULL(3) bool
202 WriteSectors(::sec_t, const void*, size_t = 1) ynothrow;
204 };
206
211 namespace FAT
212 {
213
215 static_assert(std::is_same<byte, ystdex::octet>::value,
216 "Only 8-bit byte is supported.");
217
218 static_assert(!(sizeof(size_t) < sizeof(std::uint32_t)),
219 "Invalid type found.");
220
221 using namespace platform::FAT;
222 using platform::Deref;
223 using namespace platform::Concurrency;
224 using platform::FileSystemType;
226 using namespace platform::Threading;
227
228 // XXX: Mutex lock probable may throw on platforms other than DS. However,
229 // ISO C++ [thread.req.exception] guaranteed only specified error conditions
230 // are allowed, and all of them in [thread.mutex.requirements.mutex] are
231 // carefully avoided. Thus the exception specifications are not effected even
232 // if each creation of lock is not in a try-block.
233
234
239 class YF_API AllocationTable final
240 {
241 private:
242 mutable mutex part_mutex{};
243 size_t sectors_per_cluster;
244 size_t bytes_per_sector;
245 size_t bytes_per_cluster;
246 ::sec_t table_start;
247 size_t table_size;
248 size_t total_sectors_num;
249 size_t limit;
250 size_t root_dir_start;
251 size_t root_dir_sectors_num;
252 size_t data_sectors_num;
254 ClusterIndex first_free = Clusters::First;
255 ClusterIndex free_cluster = 0;
257 ClusterIndex last_alloc_cluster = 0;
259 ClusterIndex last_cluster;
260 FileSystemType fs_type;
261 ClusterIndex root_dir_cluster;
262
263 public:
264 mutable SectorCache Cache;
265
266 YB_NONNULL(3)
267 AllocationTable(::sec_t, const byte*, size_t, size_t, Disc) ynothrowv;
268
269 DefDeCopyAssignment(AllocationTable)
270
272 PDefH(bool, IsFreeOrValid, ClusterIndex c) const ynothrow
273 ImplRet(c == Clusters::Free || IsValid(c))
275 PDefH(bool, IsValid, ClusterIndex c) const ynothrow
276 // NOTE: This will catch Clusters::Error.
277 ImplRet(Clusters::First <= c && c <= last_cluster)
278
279 DefGetter(const ynothrow, size_t, BytesPerCluster, bytes_per_cluster)
280 DefGetter(const ynothrow, size_t, BytesPerSector, bytes_per_sector)
281 DefGetter(const ynothrow, FileSystemType, FileSystemType, fs_type)
282 DefGetter(const ynothrow, size_t, FreeClusters,
283 fs_type == FileSystemType::FAT32 ? free_cluster : CountFreeCluster())
284 DefGetter(const ynothrow, mutex&, MutexRef, part_mutex)
285 DefGetter(const ynothrow, ClusterIndex, RootDirCluster, root_dir_cluster)
286 DefGetter(const ynothrow, ClusterIndex, RootDirSectorsNum,
287 root_dir_sectors_num)
288 DefGetter(const ynothrow, size_t, SectorsPerCluster, sectors_per_cluster)
289 DefGetter(const ynothrow, std::uint64_t, TotalSize, std::uint64_t(
290 data_sectors_num) * std::uint64_t(bytes_per_sector))
291 DefGetter(const ynothrow, size_t, UsedClusters,
292 last_cluster - Clusters::First + 1)
293
294 PDefH(::sec_t, ClusterToSector, ClusterIndex c) const ynothrow
295 ImplRet((c >= Clusters::First ? (c - Clusters::First) * ::sec_t(
296 sectors_per_cluster) + root_dir_sectors_num : 0) + root_dir_start)
297
303 bool
304 ClearLinks(ClusterIndex) ynothrow;
305
306 ClusterIndex
307 CountFreeCluster() const ynothrow;
308
313 ClusterIndex
314 LinkFree(ClusterIndex) ynothrow;
315
323 ClusterIndex
324 QueryNext(ClusterIndex c) const ynothrowv;
325
326 ClusterIndex
327 QueryLast(ClusterIndex) const ynothrow;
328
329 YB_NONNULL(2) void
330 ReadClusters(const byte*) ynothrowv;
331
343 ClusterIndex
344 TrimChain(ClusterIndex, size_t) ythrow(std::system_error);
345
347
348
353 ClusterIndex
354 TryLinkFree(ClusterIndex) ythrow(std::system_error);
355
362 ClusterIndex
363 TryLinkFreeCleared(ClusterIndex) ythrow(std::system_error);
365
366 YB_NONNULL(2) void
367 WriteClusters(byte*) const ynothrowv;
368
369 bool
370 WriteEntry(ClusterIndex, std::uint32_t) const ynothrow;
371
372 YB_NONNULL(2) void
373 WriteFSInfo(byte*) ynothrowv;
374 };
375
376
378
379 static_assert(LFN::MaxMBCSLength <= NAME_MAX, "Invalid constant found.");
380
381
383 class YF_API FilePosition final
384 {
385 private:
386 ClusterIndex cluster;
387 ::sec_t sector;
388 size_t byte;
389
390 public:
391 DefDeCtor(FilePosition)
392 FilePosition(ClusterIndex c)
393 : cluster(c), sector(0), byte(0)
394 {}
395 FilePosition(ClusterIndex c, ::sec_t sec, size_t b)
396 : cluster(c), sector(sec), byte(b)
397 {}
398
399 DefDeCopyAssignment(FilePosition)
400
401 DefGetter(const ynothrow, size_t, Byte, byte)
402 DefGetter(const ynothrow, size_t, Cluster, cluster)
403 DefGetter(const ynothrow, ::sec_t, Sector, sector)
404
405 DefSetter(ynothrow, size_t, Byte, byte)
406 DefSetter(ynothrow, size_t, Cluster, cluster)
407 DefSetter(ynothrow, ::sec_t, Sector, sector)
408
409 PDefH(void, AddByte, size_t x) ynothrow
410 ImplExpr(byte += x)
411
412 PDefH(void, AddSector, size_t x) ynothrow
413 ImplExpr(sector += x)
414
415 void
416 Decompose(std::uint32_t, size_t, size_t) ynothrowv;
417
418 PDefH(void, IncSector, ) ynothrow
419 ImplUnseq(++sector)
420
421 PDefH(void, IncSectorAndResetOffset, ) ynothrow
422 ImplUnseq(byte = 0, ++sector)
423 };
424
425
427 class YF_API DEntryPosition final
428 {
429 private:
430 ClusterIndex cluster;
431 ::sec_t sector;
432 size_t offset;
433
434 public:
435 DefDeCtor(DEntryPosition)
436 DEntryPosition(ClusterIndex c)
437 : cluster(c), sector(0), offset(0)
438 {}
439 DEntryPosition(ClusterIndex c, ::sec_t sec, size_t o)
440 : cluster(c), sector(sec), offset(o)
441 {}
442
443 DefDeCopyAssignment(DEntryPosition)
444
445 PDefH(bool, IsFAT16RootCluster) const ynothrow
446 ImplRet(cluster == Clusters::FAT16RootDirectory)
447
448 DefGetter(const ynothrow, size_t, Byte, offset * EntryDataSize)
449 DefGetter(const ynothrow, size_t, Cluster, cluster)
450 DefGetter(const ynothrow, ::sec_t, Sector, sector)
451
452 DefSetter(ynothrow, size_t, Cluster, cluster)
453 DefSetter(ynothrow, ::sec_t, Sector, sector)
454
455 PDefH(size_t, IncOffset, ) ynothrow
456 ImplRet(++offset)
457
458 PDefH(void, IncSectorAndResetOffset, ) ynothrow
459 ImplUnseq(offset = 0, ++sector)
460
461 friend PDefHOp(bool, ==, const DEntryPosition& x,
462 const DEntryPosition& y) ynothrow
463 ImplRet(x.cluster == y.cluster && x.sector == y.sector
464 && x.offset == y.offset)
465 };
466
467
472 enum class LeafAction
473 {
475 Return = 0,
480 ThrowExisted,
485 EnsureDirectory
486 };
487
493 enum class ExtensionResult
494 {
495 Success,
496 EndOfFile,
497 NoSpace
498 };
499
500
501 class Partition;
502
504 class DEntry final
505 {
506 public:
513 using NamePosition = array<DEntryPosition, 2>;
514
516 EntryData Data;
522 NamePosition NamePos;
523
524 private:
526 string name;
527
528 public:
533 DEntry(ClusterIndex c)
534 : NamePos(GenerateBeforeFirstNamePos(c))
535 {}
543 DEntry(Partition&);
549 DEntry(Partition&, const NamePosition&);
570 DEntry(Partition&, string_view, LeafAction = LeafAction::Return,
571 std::function<void(DEntry&)> = {},
572 ClusterIndex& = ystdex::ref_opt<ClusterIndex>());
573
574 DefPred(const ynothrow, Dot, name == "." || name == "..")
575
576 DefGetter(const ynothrow, const string&, Name, name)
577 DefGetter(ynothrow, string&, NameRef, name)
578
587 void
588 FindEntryGap(Partition&, ClusterIndex, size_t) ythrow(std::system_error);
589
590 private:
591 static YB_STATELESS PDefH(DEntryPosition, GenerateBeforeFirstDEntryPos,
592 ClusterIndex c) ynothrow
593 ImplRet({c, 0, size_t(-1)})
594
595 public:
597 static YB_STATELESS PDefH(NamePosition, GenerateBeforeFirstNamePos,
598 ClusterIndex c) ynothrow
599 ImplRet({GenerateBeforeFirstDEntryPos(c),
600 GenerateBeforeFirstDEntryPos(c)})
601
608 bool
609 QueryNextFrom(Partition&) ythrow(system_error);
610 };
611
612
613 class FileInfo;
614
621 class Partition final : private ystdex::noncopyable, private ystdex::nonmovable
622 {
623 public:
624 using OpenFilesSet = set<lref<FileInfo>, ystdex::get_less<FileInfo>>;
625
626 private:
627 Disc disc;
629 VolumeLabel label;
630
631 public:
632 AllocationTable Table;
633
634 private:
635 ::sec_t fs_info_sector;
636 bool read_only;
637 ClusterIndex cwd_cluster;
638 OpenFilesSet open_files{};
639
645 Partition(byte*, Disc, size_t, size_t, ::sec_t);
646
647 public:
653 Partition(Disc, size_t, size_t, ::sec_t);
655 ~Partition();
656
657 DefPred(const ynothrow, ReadOnly, read_only)
658
659 DefGetterMem(const ynothrow, size_t, BytesPerCluster, Table)
660 DefGetterMem(const ynothrow, size_t, BytesPerSector, Table)
661 DefGetter(const ynothrow, ClusterIndex, CWDCluster, cwd_cluster)
662 DefGetter(const ynothrow, SectorCache&, CacheRef, Table.Cache)
663 DefGetterMem(const ynothrow, FileSystemType, FileSystemType, Table)
664 DefGetter(const ynothrow, const VolumeLabel&, Label, label)
666 DefGetter(const ynothrow, basic_string_view<byte>, LabelString,
667 {label.data(), label.size()})
668 DefGetterMem(const ynothrow, mutex&, MutexRef, Table)
669 DefGetterMem(const ynothrow, ClusterIndex, RootDirCluster, Table)
670 DefGetterMem(const ynothrow, size_t, SectorsPerCluster, Table)
671 DefGetterMem(const ynothrow, size_t, TotalSize, Table)
672
680 void
681 ChangeDir(string_view) ythrow(std::system_error);
682
688 void
689 CreateFSInfo();
690
691 private:
692 YB_NONNULL(1) ::sec_t
693 FindFirstValidPartition(byte*) const ynothrowv;
694
695 public:
702 void
703 CheckPositionForNextCluster(FilePosition&) ythrow(std::system_error);
704
711 bool
712 EntryExists(string_view, ClusterIndex) ythrow(system_error);
713
723 void
724 ExtendPosition(DEntryPosition&) ythrow(std::system_error);
725
731 PDefH(void, Flush, ) ythrow(std::system_error)
732 ImplExpr(GetCacheRef().Flush() ? void()
733 : ystdex::throw_error(std::errc::io_error))
734
742 ExtensionResult
743 IncrementPosition(DEntryPosition& pos) ynothrowv;
744
745 PDefH(locked_ptr<OpenFilesSet>, LockOpenFiles, )
746 ImplRet({&open_files, GetMutexRef()})
747
760 void
761 MakeDir(string_view) ythrow(std::system_error);
762
763 private:
765 void
766 ReadFSInfo();
767
768 public:
769 YB_NONNULL(1) PDefH(bool, ReadFSInfoSector, byte* sec_buf) const ynothrowv
770 ImplRet(ReadSector(fs_info_sector, sec_buf))
771
772 YB_NONNULL(1) PDefH(bool, ReadSector, ::sec_t sector, byte* sec_buf) const
773 ynothrowv
774 ImplRet(disc.ReadSectors(sector, 1, sec_buf))
775
784 void
785 RemoveEntry(const DEntry::NamePosition&) ythrow(std::system_error);
786
802 void
803 Rename(string_view, string_view) ythrow(std::system_error);
804
806 void
807 StatFS(struct ::statvfs&);
808
816 PDefH(void, Stat, struct ::stat& st, string_view path)
817 ythrow(std::system_error)
818 ImplExpr(StatFromEntry(DEntry(*this, path).Data, st))
819
827 void
828 StatFromEntry(const EntryData&, struct ::stat&) const
829 ythrow(std::system_error);
830
837 ClusterIndex
838 TryGetClusterFromEntry(const EntryData&) const ythrow(std::system_error);
839
851 void
852 Unlink(string_view) ythrow(std::system_error);
853
855 void
856 WriteFSInfo() const;
857
858 YB_NONNULL(3) PDefH(bool, WriteSector, ::sec_t sector, const byte* sec_buf)
859 const ynothrowv
860 ImplRet(disc.WriteSectors(sector, 1, sec_buf))
861 };
862
863
868 YF_API YB_NONNULL(1) Partition*
869 FetchPartitionFromPath(const char*) ynothrowv;
870
871
876 class DirState final
877 {
878 private:
879 lref<Partition> part_ref;
880 // XXX: Members %(start_cluster, valid_entry) should be protected by the
881 // partition mutex in construction.
882 // FIXME: More precise concurrency safety?
883 ClusterIndex start_cluster;
884 DEntry current_entry;
885 bool valid_entry;
886
887 public:
901 DirState(Partition&, string_view) ythrow(std::system_error);
902
903 DefGetter(const ynothrow, Partition&, PartitionRef, part_ref)
904
914 YB_NONNULL(2) void
915 Iterate(char*, struct ::stat*) ythrow(std::system_error);
916
922 void
923 Reset() ythrow(std::system_error);
924 };
925
926
931 class FileInfo final
932 {
933 private:
934 enum Bits
935 {
936 ReadBit = 0,
937 WriteBit,
938 AppendBit,
939 ModifiedBit,
940 BitSize
941 };
942 std::uint32_t file_size;
943 ClusterIndex start_cluster;
944 std::uint32_t current_position;
949 FilePosition rw_position;
950 FilePosition append_position;
952 DEntry::NamePosition name_position;
953 Partition* part_ptr;
954 std::bitset<BitSize> attr{};
955
956 public:
971 FileInfo(Partition&, string_view, int);
972
973 PDefH(bool, CanAppend) const ynothrow
974 ImplRet(attr[AppendBit])
975 PDefH(bool, CanRead) const ynothrow
976 ImplRet(attr[ReadBit])
977 PDefH(bool, CanWrite) const ynothrow
978 ImplRet(attr[WriteBit])
979 DefPred(const ynothrow, Modified, attr[ModifiedBit])
980
981 DefGetter(const ynothrow, std::uint32_t, CurrentPosition, current_position)
983 DefGetter(const ynothrow, const DEntry::NamePosition&, NamePosition,
984 name_position)
985 // XXX: Extended partition mutex to lock directory states.
986 DefGetter(const ynothrow, mutex&, MutexRef, GetPartitionRef().GetMutexRef())
987 DefGetter(const ynothrow, Partition&, PartitionRef, Deref(part_ptr))
988 DefGetter(const ynothrow, const FilePosition&, RWPosition, rw_position)
989 DefGetter(const ynothrow, FileSize, Size, file_size)
990 DefGetter(const ynothrow, ClusterIndex, StartCluster, start_cluster)
991
992 DefSetter(ynothrow, const FilePosition&, AppendPosition, append_position)
993 DefSetter(ynothrow, FileSize, CurrentPosition, current_position)
995 DefSetter(ynothrow, const FilePosition&, RWPosition, rw_position)
996
997 void
998 CheckAppend() ynothrow;
999
1007 void
1008 Extend() ythrow(std::system_error);
1009
1016 void
1017 SyncToDisc() ythrow(std::system_error);
1018
1024 void
1025 Stat(struct ::stat&) const;
1026
1035 void
1036 Truncate(FileSize) ythrow(std::system_error);
1037
1044 YB_NONNULL(2) ::ssize_t
1045 TryRead(char*, size_t) ythrow(std::system_error);
1046
1054 ::off_t
1055 TrySeek(::off_t, int) ythrow(std::system_error);
1056
1064 YB_NONNULL(2) ::ssize_t
1065 TryWrite(const char*, size_t) ythrow(std::system_error);
1066
1067 PDefH(void, UpdateSize, std::uint32_t size) ynothrow
1068 ImplUnseq(file_size = size, attr.set(ModifiedBit))
1069 };
1070
1071
1083 YF_API bool
1084 Mount(string_view, const ::DISC_INTERFACE&, ::sec_t, size_t, size_t);
1085
1091 YF_API YB_NONNULL(1) bool
1092 Unmount(const char* name = "fat") ynothrow;
1094
1095 } // namespace FAT;
1096
1097 #endif
1098
1099 } // namespace platform_ex;
1100
1101 #endif
1102
YSLib::Drawing::x
The boundary is out of the const Rect SDst SPos x
Definition: YDraw.h:127
ystdex::composed
复合函数。
Definition: functional.hpp:619
YB_STATELESS
#define YB_STATELESS
指示函数或函数模板实例为无状态函数。
Definition: ydef.h:522
ystdex::string_view
basic_string_view< char > string_view
Definition: string_view.hpp:415
ynothrow
#define ynothrow
YSLib 无异常抛出保证：若支持 noexcept 关键字， 指定特定的 noexcept 异常规范。
Definition: ydef.h:740
NPL::Decompose
YF_API list< string > Decompose(string_view)
分解字符串为记号。
Definition: Lexical.cpp:377
platform::FAT::EntryDataSize
yconstexpr const size_t EntryDataSize(0x20)
目录项数据大小。
cstdio.h
NPL::A1::name
ctx const string & name
Definition: NPLA1.h:248
optional.h
可选值包装类型。
ynothrowv
#define ynothrowv
YSLib 无异常抛出保证验证：有条件地使用无异常抛出规范。
Definition: ydef.h:760
DefDeCopyAssignment
#define DefDeCopyAssignment(_t)
Definition: YBaseMacro.h:185
platform::size_t
YF_API size_t
Definition: FileIO.h:1262
YSLib::IO::EnsureDirectory
EnsureDirectory
Definition: YSLib/Service/FileSystem.h:415
DefDeCtor
#define DefDeCtor(_t)
简单通用成员函数定义。
Definition: YBaseMacro.h:156
DefGetterMem
#define DefGetterMem(_q, _t, _n, _m)
Definition: YBaseMacro.h:246
CHRLib::c
c
Definition: CharacterProcessing.h:81
ystdex::used_list_cache
按最近使用策略刷新的缓存。
Definition: cache.hpp:170
DefGetter
#define DefGetter(_q, _t, _n,...)
Definition: YBaseMacro.h:240
ImplUnseq
#define ImplUnseq(...)
Definition: YBaseMacro.h:110
platform_ex::Reset
unsigned long Reset(COMPtr< _iCOM > &ptr) ynothrow
Definition: COM.h:408
ynoexcept_spec
#define ynoexcept_spec(...)
表达式 noexcept 异常规范。
Definition: ydef.h:768
platform::ssize_t
ystdex::make_signed_t< std::size_t > ssize_t
Definition: NativeAPI.h:73
cache.hpp
高速缓冲容器模板。
ystdex::throw_error
void throw_error(std::error_code ec, _tParams &&...args)
抛出错误： std::system_error 或允许相同构造函数参数的异常。
Definition: ystdex/exception.h:162
platform::Concurrency
Definition: Mutex.h:47
base.h
基类实用设施。
std
Definition: memory.hpp:1100
platform::Deref
yconstfn auto Deref(_type &&p) -> decltype(*p)
断言并解引用非空指针。
Definition: Debug.h:440
ystdex::size
auto size(const _tRange &c) -> decltype(c.size())
类容器访问。
Definition: range.hpp:233
yunseq
#define yunseq
无序列依赖表达式组求值。
Definition: ydef.h:996
platform_ex
平台扩展命名空间。
Definition: Android.h:45
YSLib::path
YF_API const char * path
Definition: Initialization.h:74
platform::FAT::FileSize
std::uint32_t FileSize
文件大小：字节数。
Definition: YCLib/FileSystem.h:804
ystdex
特性测试宏。
Definition: ydef.h:796
platform::FAT::EntryData
目录项数据。
Definition: YCLib/FileSystem.h:951
platform::FAT
文件分配表接口。
Definition: YCLib/FileSystem.h:625
YModules.h
YSLib::UI::y
SPos SPos y
Definition: YWidget.cpp:44
ystdex::byte
unsigned char byte
字节类型。
Definition: ydef.h:808
platform::FAT::LFN::MaxMBCSLength
UTF-8 项最大长度。
Definition: YCLib/FileSystem.h:870
DefFwdTmpl
#define DefFwdTmpl(_q, _t, _n,...)
传递模板。
Definition: YBaseMacro.h:326
platform::FileSystemType
FileSystemType
已知文件系统类型。
Definition: YCLib/FileSystem.h:612
platform::Threading
Definition: Mutex.h:70
platform::FAT::ClusterIndex
std::uint32_t ClusterIndex
Definition: YCLib/FileSystem.h:629
yforward
#define yforward(_expr)
根据参数类型使用 std::forward 传递对应参数。
Definition: ydef.h:969
ystdex::locked_ptr
threading::locked_ptr< _type, _tMutex, _tLock > locked_ptr
独占所有权的锁定指针：默认使用标准库互斥量和锁。
Definition: concurrency.h:62
YF_API
#define YF_API
Definition: Platform.h:56
ythrow
#define ythrow(...)
YSLib 动态异常规范：根据是否使用异常规范宏指定或忽略动态异常规范。
Definition: ydef.h:791
platform::FAT::VolumeLabel
array< byte, 11 > VolumeLabel
卷标数据类型。
Definition: YCLib/FileSystem.h:717
YSLib::IO::f
const string &path const String &path _func f
Definition: YSLib/Service/FileSystem.h:430
CHRLib::args
_tParams && args
Definition: CharacterProcessing.h:538
DefPred
#define DefPred(_q, _n,...)
Definition: YBaseMacro.h:231
DefSetter
#define DefSetter(_q, _t, _n, _m)
Definition: YBaseMacro.h:251
platform::n
size_t n
Definition: YCLib/FileSystem.cpp:321