Sese Framework  x.y.z
A cross-platform framework
载入中...
搜索中...
未找到
sese::Yaml类 参考

Yaml 解析器 更多...

#include <Yaml.h>

静态 Public 成员函数

static Value parse (io::InputStream *input, size_t level)
 
static void streamify (io::OutputStream *output, const Value &value)
 

Private 类型

using Tokens = std::vector<std::string>
 
using TokensQueue = std::queue<std::tuple<int, Tokens>>
 
using InputStream = io::InputStream
 
using OutputStream = io::OutputStream
 
using Line = std::tuple<int, std::string>
 

静态 Private 成员函数

static Value parseBasic (const std::string &value)
 
static Value parseObject (TokensQueue &tokens_queue, size_t level)
 
static Value parseArray (TokensQueue &tokens_queue, size_t level)
 
static void streamifyObject (io::OutputStream *output, const Value::Dict &dict, size_t level)
 
static void streamifyArray (io::OutputStream *output, const Value::List &list, size_t level)
 
static int getSpaceCount (const std::string &line) noexcept
 
static Line getLine (InputStream *input) noexcept
 
static Tokens tokenizer (const std::string &line) noexcept
 
static void writeSpace (size_t count, OutputStream *output) noexcept
 

详细描述

Yaml 解析器

成员类型定义说明

◆ InputStream

◆ Line

using sese::Yaml::Line = std::tuple<int, std::string>
private

◆ OutputStream

◆ Tokens

using sese::Yaml::Tokens = std::vector<std::string>
private

◆ TokensQueue

using sese::Yaml::TokensQueue = std::queue<std::tuple<int, Tokens>>
private

成员函数说明

◆ getLine()

std::tuple< int, std::string > sese::Yaml::getLine ( InputStream * input)
staticprivatenoexcept

◆ getSpaceCount()

int sese::Yaml::getSpaceCount ( const std::string & line)
staticprivatenoexcept

被这些函数引用 getLine().

◆ parse()

Value Yaml::parse ( io::InputStream * input,
size_t level )
static

从流中反序列化 yaml 对象

参数
input输入流
level解析深度
返回
解析失败则 Value::isNull 为真

引用了 getLine(), parseArray(), parseObject() , 以及 tokenizer().

◆ parseArray()

Value Yaml::parseArray ( Yaml::TokensQueue & tokens_queue,
size_t level )
staticprivate

◆ parseBasic()

Value Yaml::parseBasic ( const std::string & value)
staticprivate

引用了 d , 以及 sese::strcmpDoNotCase().

被这些函数引用 parseObject().

◆ parseObject()

Value Yaml::parseObject ( TokensQueue & tokens_queue,
size_t level )
staticprivate

◆ streamify()

void Yaml::streamify ( io::OutputStream * output,
const Value & value )
static

向流中序列化 yaml 对象

参数
output输出流
valueyaml 对象

引用了 sese::Value::DICT, sese::Value::getDict(), sese::Value::getList(), sese::Value::getType(), sese::Value::LIST, streamifyArray() , 以及 streamifyObject().

◆ streamifyArray()

void Yaml::streamifyArray ( io::OutputStream * output,
const Value::List & list,
size_t level )
staticprivate

◆ streamifyObject()

void Yaml::streamifyObject ( io::OutputStream * output,
const Value::Dict & dict,
size_t level )
staticprivate

◆ tokenizer()

std::vector< std::string > sese::Yaml::tokenizer ( const std::string & line)
staticprivatenoexcept

◆ writeSpace()

void sese::Yaml::writeSpace ( size_t count,
OutputStream * output )
staticprivatenoexcept

引用了 count() , 以及 GET_SPACE_ARRAY.

被这些函数引用 streamifyArray() , 以及 streamifyObject().


该类的文档由以下文件生成: