1 Star 0 Fork 5

TinyPiXOS/yaml-cpp

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
null.cpp 537 Bytes
一键复制 编辑 原始数据 按行查看 历史
Daniel Levin 提交于 2024-10-20 13:36 +08:00 . emitter: Support std::string_view
#include "yaml-cpp/null.h"
#include <cstring>
namespace YAML {
_Null Null;
template <std::size_t N>
static bool same(const char* str, std::size_t size, const char (&literal)[N]) {
constexpr int literalSize = N - 1; // minus null terminator
return size == literalSize && std::strncmp(str, literal, literalSize) == 0;
}
bool IsNullString(const char* str, std::size_t size) {
return size == 0 || same(str, size, "~") || same(str, size, "null") ||
same(str, size, "Null") || same(str, size, "NULL");
}
} // namespace YAML
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tinypixos/yaml-cpp.git
git@gitee.com:tinypixos/yaml-cpp.git
tinypixos
yaml-cpp
yaml-cpp
master

搜索帮助