docs: update resources API docs

This commit is contained in:
2026-03-20 02:35:35 +08:00
parent fd792b7df1
commit ea756c0177
314 changed files with 9439 additions and 1360 deletions

View File

@@ -0,0 +1,53 @@
# IsValid
检查资源包当前是否有效。
## 方法签名
```cpp
bool IsValid() const;
```
## 详细描述
返回一个布尔值,表示资源包当前是否处于有效状态。当包成功打开且未被关闭时返回 `true`
## 参数
## 返回值
| 类型 | 描述 |
|------|------|
| `bool` | 包有效返回 `true`,无效返回 `false` |
## 示例
```cpp
ResourcePackage package;
// 打开前
if (!package.IsValid()) {
printf("Package is not valid yet\n");
}
package.Open("assets/resources.xcp");
// 打开后
if (package.IsValid()) {
printf("Package is valid and ready to use\n");
}
package.Close();
// 关闭后
if (!package.IsValid()) {
printf("Package has been closed\n");
}
```
## 相关方法
- [Open](open.md) - 打开资源包
- [Close](close.md) - 关闭资源包