# ani_utils **Repository Path**: nickwang007/ani_utils ## Basic Information - **Project Name**: ani_utils - **Description**: No description available - **Primary Language**: TypeScript - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2025-04-03 - **Last Updated**: 2025-04-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # AniUtils #### 介绍 **AniUtils** 是一个简化`ani`操作的 header only 类库。包括:类型查找、对象创建、类型转换、内存管理等。 | 头文件 | 包含类 | 说明 | | ------------- | ------------- | ------------- | | ani_util_array.h | ArrayAccessor | 数组类型转换 | | ani_util_base.h | expected, FinalAction, finally | 基础类 | | ani_util_class.h | AniTypeFinder, AniObjectFactory | 类型发现、对象创建 | | ani_util_composite.h | UnionAccessor, OptionalAccessor, EnumAccessor | 复合类型转换 | | ani_util_common.h | AniErrorFactory | 错误、异常处理 | | ani_util_native_ptr.h | StdSharedPtrHolder, OhSharedPtrHolder, NativePtrWrapper, NativePtrCleaner | 内存管理 | | ani_util_primitive.h | AniStringUtils, ... | 简单类型转换 | | ani_util_scope.h | AniLocalScopeGuard, ScopedAniEnv | 作用域、跨线程 | #### 软件架构 **AniUtils** 基于以下理念设计: * 引入类似于`C++23`的`expected`类,将原生`ani`接口中的`ani_status`返回值与出参统一起来,从而简化`ani`操作。 * 引入模版(含变参数模板),使得类型查找、对象创建等函数更简单友好。 * 兼容`STL`。 #### 安装教程 由于该类库为 header only 类库,直接将头文件引入: `#include "ani_utils.h"` #### 使用说明 见:`hello_ani.ets`、`hello_ani.cpp`。 该类库尚在开发中,请审视后使用, * 不保证无问题。 * 不保证兼容性,包括文件名、类名、函数名、函数签名都可能在后续版本中重构修改。 #### 参与贡献 欢迎提 Issue。