fix: improve doc link navigation and tree display
- Fix link resolution with proper relative/absolute path handling - Improve link styling with underline decoration - Hide leaf nodes from tree, only show directories - Fix log file path for packaged app
This commit is contained in:
35
docs/api/containers/hashmap/contains.md
Normal file
35
docs/api/containers/hashmap/contains.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# HashMap::Contains
|
||||
|
||||
```cpp
|
||||
bool Contains(const Key& key) const;
|
||||
```
|
||||
|
||||
检查哈希表中是否包含指定的键。
|
||||
|
||||
**参数:**
|
||||
- `key` - 要检查的键
|
||||
|
||||
**返回:** 如果键存在返回 `true`,否则返回 `false`。
|
||||
|
||||
**复杂度:** O(1) 平均,最坏 O(n)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
XCEngine::Containers::HashMap<int, const char*> map;
|
||||
map.Insert(1, "one");
|
||||
map.Insert(2, "two");
|
||||
|
||||
if (map.Contains(1)) {
|
||||
std::cout << "Key 1 exists" << std::endl; // 输出 "Key 1 exists"
|
||||
}
|
||||
|
||||
if (!map.Contains(99)) {
|
||||
std::cout << "Key 99 does not exist" << std::endl; // 输出 "Key 99 does not exist"
|
||||
}
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [HashMap 总览](hashmap.md) - 返回类总览
|
||||
- [Find](find.md) - 查找键对应的值
|
||||
Reference in New Issue
Block a user