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

实现XML配置信息结构体的序列化逻辑 More...

#include "tools/tab/xml/xmlinfo.h"
#include <string_view>

Functions

constexpr char ngl::xmlinfo_detail::ascii_tolower (char avalue)
 ASCII大写转小写(constexpr)
bool ngl::xmlinfo_detail::equals_ascii_icase (std::string_view alhs, const char *arhs)
 ASCII大小写不敏感的字符串比较
bool ngl::xmlinfo_detail::parse_text_bool (std::string_view avalue, bool &aout)
 将文本值解析为布尔值

Detailed Description

实现XML配置信息结构体的序列化逻辑

提供xarg_info的类型安全查找方法,支持bool、string等类型, 并实现了灵活的布尔值文本解析(支持true/false/yes/no/on/off/1/0)。

See also
xmlinfo.h

Function Documentation

◆ ascii_tolower()

char ngl::xmlinfo_detail::ascii_tolower ( char avalue)
constexpr

ASCII大写转小写(constexpr)

Parameters
avalue输入字符
Returns
转换后的小写字符,非大写字母原样返回

◆ equals_ascii_icase()

bool ngl::xmlinfo_detail::equals_ascii_icase ( std::string_view alhs,
const char * arhs )

ASCII大小写不敏感的字符串比较

Parameters
alhs左侧字符串视图
arhs右侧C字符串(预期全小写)
Return values
true长度和内容匹配
false不匹配

◆ parse_text_bool()

bool ngl::xmlinfo_detail::parse_text_bool ( std::string_view avalue,
bool & aout )

将文本值解析为布尔值

支持:1/0、true/false、yes/no、on/off(大小写不敏感)

Parameters
avalue输入文本
aout输出布尔值
Return values
true解析成功
false无法识别的格式