docs: update resources API docs
This commit is contained in:
33
docs/api/resources/resourcepath/isvalid.md
Normal file
33
docs/api/resources/resourcepath/isvalid.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# ResourcePath::IsValid
|
||||
|
||||
```cpp
|
||||
bool IsValid() const
|
||||
```
|
||||
|
||||
检查路径是否有效(非空)。
|
||||
|
||||
**详细描述:**
|
||||
|
||||
判断路径是否有效,即路径字符串是否非空。
|
||||
|
||||
**返回:** `bool`,路径非空返回 `true`,否则返回 `false`
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
ResourcePath validPath("textures/player.png");
|
||||
if (validPath.IsValid()) {
|
||||
// 处理有效路径
|
||||
}
|
||||
|
||||
ResourcePath emptyPath("");
|
||||
if (!emptyPath.IsValid()) {
|
||||
// 处理空路径
|
||||
}
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [ResourcePath 总览](resourcepath.md) - 返回类总览
|
||||
Reference in New Issue
Block a user