From 3ac93ba2e86a31ea126b27353bcbdbb2aded00e7 Mon Sep 17 00:00:00 2001 From: ssdfasd <2156608475@qq.com> Date: Thu, 19 Mar 2026 01:04:10 +0800 Subject: [PATCH] Fix containers documentation discrepancies - Remove Size() from String docs (does not exist in source, use Length()) - Remove broken links to operator+ and operator==/!= (inline functions) - Fix string.md to correctly reference Length/Capacity/Empty instead of Size - Add proper documentation for inline operators in string.md --- docs/api/containers/string/size.md | 5 +---- docs/api/containers/string/string.md | 8 ++++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/docs/api/containers/string/size.md b/docs/api/containers/string/size.md index ef57bc83..90847229 100644 --- a/docs/api/containers/string/size.md +++ b/docs/api/containers/string/size.md @@ -1,8 +1,7 @@ -# String::Length / Size / Capacity / Empty +# String::Length / Capacity / Empty ```cpp SizeType Length() const; -SizeType Size() const; SizeType Capacity() const; bool Empty() const; ``` @@ -13,7 +12,6 @@ bool Empty() const; **返回:** - `Length()` - 返回字符串的字符数(不包括终止 null 字符) -- `Size()` - 与 `Length()` 功能相同,返回字符串的字符数 - `Capacity()` - 返回已分配的存储容量 - `Empty()` - 如果字符串为空则返回 `true` @@ -30,7 +28,6 @@ int main() { XCEngine::Containers::String s2("Hello"); std::cout << "Length: " << s2.Length() << std::endl; // 输出: Length: 5 - std::cout << "Size: " << s2.Size() << std::endl; // 输出: Size: 5 std::cout << "Capacity: " << s2.Capacity() << std::endl; // 输出: Capacity: 6 或更大 s2.Reserve(100); diff --git a/docs/api/containers/string/string.md b/docs/api/containers/string/string.md index a45013b4..539a4167 100644 --- a/docs/api/containers/string/string.md +++ b/docs/api/containers/string/string.md @@ -37,14 +37,14 @@ | 方法 | 描述 | |------|------| | [operator+=](operator-plus-assign.md) | 追加字符串/字符 | -| [operator+](operator-plus.md) | 字符串连接 | +| operator+ | 字符串连接 | ### 比较运算符 | 方法 | 描述 | |------|------| -| [operator==](operator-equal.md) | 判断两个字符串是否相等 | -| [operator!=](operator-equal.md) | 判断两个字符串是否不相等 | +| operator== | 判断两个字符串是否相等 | +| operator!= | 判断两个字符串是否不相等 | ### 字符串操作 @@ -62,7 +62,7 @@ | 方法 | 描述 | |------|------| | [CStr](cstr.md) | 获取 C 字符串指针 | -| [Length/Size/Capacity/Empty](size.md) | 获取尺寸信息 | +| [Length/Capacity/Empty](size.md) | 获取尺寸信息 | | [operator[]](./operator-subscript.md) | 下标访问 | ### 容量管理