doc: add documentation

- add documentation for CKDefines, CKGlobals and VxMemoryMappedFile.
- fix build issue in VxMemoryMappedFile.
- add file size limitation in VxMemoryMappedFile. File whose size exceed the maximum value can not be opened.
This commit is contained in:
2024-08-22 10:57:53 +08:00
parent a7c1028926
commit 1028aad155
6 changed files with 174 additions and 75 deletions

View File

@ -122,6 +122,14 @@ namespace LibCmo::CK2 {
return strl[0] == u8'\0';
}
CKDWORD CKStrLen(CKSTRING strl) {
if (strl == nullptr) return 0u;
size_t len = std::strlen(YYCC::EncodingHelper::ToOrdinary(strl));
if (len > static_cast<size_t>(std::numeric_limits<CKDWORD>::max()))
throw RuntimeException("Exceed maximum value when cast size_t to CKDWORD.");
return static_cast<CKDWORD>(len);
}
#pragma endregion
#pragma region CKClass Registration