ngl_server 1.0
基于 Actor 模型的 C++ 服务器框架
tools_split.cpp File Reference

实现工具库中的拆分和拼接辅助函数 More...

Namespaces

namespace  ngl::tools
 工具函数命名空间。

Functions

bool ngl::tools::splite (const char *abuff, const char *afg, std::vector< std::string > &avec)
 按分隔符拆分C字符串到vector
bool ngl::tools::splicing (const std::vector< std::string > &avec, const char *afg, std::string &astr, int32_t apos)
 将vector中的字符串用分隔符拼接
bool ngl::tools::splite (int32_t aindex, const std::vector< std::string > &avec, std::vector< std::string > &adata)
 从指定索引开始提取子vector
bool ngl::tools::splicing (const std::set< std::string > &aset, const char *afg, std::string &astr)
 将set中的字符串用分隔符拼接

Detailed Description

实现工具库中的拆分和拼接辅助函数

提供字符串拆分(split)和拼接(splice)功能 支持多种容器类型(vector、set)和分隔符 用于配置解析、数据序列化等场景

Note
所有函数都进行边界检查,确保内存安全