|
NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
|
YAML值的抽象基类 更多...
#include <yaml_value.hpp>
Public 类型 | |
| enum | types { Null , Boolean , Integer , Float , String , Timestamp , Sequence , Mapping } |
| YAML值类型枚举 更多... | |
Public 成员函数 | |
| virtual types | type () const noexcept=0 |
| 获取值的具体类型 | |
| void | set_anchor (const string &a) |
| 设置锚点名 | |
| void | set_tag (const string &t) |
| 设置类型标签 | |
| string | to_string () const |
| 紧凑单行序列化 | |
| string | to_document () const |
| 格式化文档序列化 | |
类型转换方法 | |
安全地向下转型到具体类型,失败时返回 nullptr。 | |
类型检查方法 | |
便捷的类型判断方法,等价于 type() == types::Xxx。 | |
| Public 成员函数 继承自 istringify< yaml_value > | |
| constexpr string | to_string () const |
| 转换为字符串 | |
Public 属性 | |
| string | anchor |
| 锚点名(YAML &anchor 语法),空字符串表示无锚点 | |
| string | tag |
| 类型标签(YAML !tag 语法),空字符串表示无标签 | |
YAML值的抽象基类
所有YAML值类型的基类,定义了YAML值树的公共接口和类型系统。
每个 yaml_value 节点可携带可选的锚点和标签元数据:
在文件 yaml_value.hpp 第 216 行定义.
| enum yaml_value::types |
YAML值类型枚举
| 枚举值 | |
|---|---|
| Null | 空值类型 |
| Boolean | 布尔值类型 |
| Integer | 64位有符号整数类型 |
| Float | 双精度浮点数类型 |
| String | Unicode字符串类型 |
| Timestamp | ISO 8601 / RFC 3339 时间戳类型 |
| Sequence | 有序值列表类型 |
| Mapping | 键值对集合类型 |
在文件 yaml_value.hpp 第 225 行定义.
|
inline |
|
inline |
|
nodiscard |
格式化文档序列化
|
nodiscard |
紧凑单行序列化
|
nodiscardpure virtualnoexcept |
获取值的具体类型
在 yaml_boolean, yaml_float, yaml_integer, yaml_mapping, yaml_null, yaml_sequence, yaml_string , 以及 yaml_timestamp 内被实现.
引用了 type().
被这些函数引用 type().