Files
XCEngine/docs/api/resources/filearchive/open.md

35 lines
669 B
Markdown
Raw Normal View History

2026-03-20 02:35:35 +08:00
# FileArchive::Open
打开归档目录。
## 方法签名
```cpp
bool Open(const Containers::String& path) override;
```
## 详细描述
打开指定路径的目录作为归档。归档路径可以是绝对路径或相对路径。方法会设置内部路径并标记归档为有效状态。
## 参数
| 参数 | 类型 | 描述 |
|------|------|------|
| `path` | `const Containers::String&` | 归档目录路径 |
## 返回值
| 类型 | 描述 |
|------|------|
| `bool` | 始终返回 `true`。当前实现不验证路径是否真实存在。 |
## 示例
```cpp
FileArchive archive;
if (archive.Open("resources/textures/")) {
// 归档已打开
}
```