dl
首页
相关页面
命名空间
概念
类
文件
文件列表
文件成员
dl
io
dl_json.h
浏览该文件的文档.
1
12
#pragma once
13
14
#include <json.hpp>
15
16
using
json
= nlohmann::json;
17
18
namespace
dl::Json
19
{
20
25
json
Parse
(std::string_view path_name);
26
27
31
template
<
typename
T>
32
bool
Get
(
const
json
& j,
const
std::string& name,
T
& t)
33
{
34
auto
iter = j.find(name);
35
if
(iter == j.end())
36
return
false
;
37
t = *iter;
38
return
true
;
39
}
40
41
42
}
43
json
nlohmann::json json
Definition:
dl_json.h:16
dl::Json
Definition:
dl_json.h:19
dl::Json::Parse
json Parse(std::string_view path_name)
从 文件 构建json对象
dl::Json::Get
bool Get(const json &j, const std::string &name, T &t)
从json返回值,不存在则返回false,并且不进行任何操作
Definition:
dl_json.h:32
dl::KeyCode::T
@ T
制作者
1.9.5