📦 预定义数据类型操作集

可直接使用的内置数据类型 InfoOfData

📖 概述

Oper 模块提供了常用的内置数据类型的 InfoOfData 操作集实现,可以直接与 DList_S、ChainMap_S、OAMap_S 等单一数据类型容器配合使用,无需自行实现操作函数。

📋 可用操作集

🔢

Info_Int

整数类型操作集

Oper/Int_Info/int_info.h
🔤

Info_String

字符串类型操作集

Oper/String_Info/string_info.h
🔢

Info_Double

浮点数类型操作集

Oper/Double_Info/double_info.h
✔️

Info_Bool

布尔类型操作集

Oper/Bool_Info/bool_info.h 注:一般做 value,不做 key

💡 使用示例

#include "base.h"
#include "Oper/Int_Info/int_info.h"
#include "Oper/String_Info/string_info.h"
#include "List/DList/Single_Data/dlist_sdata.h"

// 使用预定义操作集
int main() {
    DList_S intList;
    initSDList(&intList, &Info_Int);  // 使用 Info_Int

    // 插入整数
    int num1 = 100, num2 = 200;
    insertSDataAtEndInSDList(&intList, Data_S_OWN(&num1, NULL));
    insertSDataAtEndInSDList(&intList, Data_S_OWN(&num2, NULL));

    printSDList(&intList);
    freeSDList(&intList);
    return 0;
}

📚 数据类型对比

操作集 数据类型 推荐场景
Info_Int int 整数数据存储、计数、索引
Info_String char* 字符串键、文本数据
Info_Double double 浮点数据、精确计算
Info_Bool bool 布尔标记(建议仅做 value)