Definition at line 1107 of file yaml_decoders.cc.
|
| static bool | parse_scalar (const YAML::Node &node, inja::json &rhs) |
| |
| static bool | decode (const Node &node, inja::json &rhs) |
| |
◆ decode()
| static bool YAML::convert< inja::json >::decode |
( |
const Node & |
node, |
|
|
inja::json & |
rhs |
|
) |
| |
|
inlinestatic |
Definition at line 1135 of file yaml_decoders.cc.
1136 {
1137 switch (node.Type()) {
1138 case YAML::NodeType::Null:
1139 break;
1140 case YAML::NodeType::Scalar:
1142 break;
1143 case YAML::NodeType::Sequence:
1144 for (auto &&array_element : node)
1145 rhs.emplace_back(array_element.as<inja::
json>());
1146 break;
1147 case YAML::NodeType::Map:
1148 for (auto &&it : node)
1149 rhs[it.first.as<
std::string>()] = it.second.as<inja::
json>();
1150 break;
1151 default:
1152 break;
1153 }
1154 return true;
1155 }
◆ parse_scalar()
| static bool YAML::convert< inja::json >::parse_scalar |
( |
const YAML::Node & |
node, |
|
|
inja::json & |
rhs |
|
) |
| |
|
inlinestatic |
Definition at line 1108 of file yaml_decoders.cc.
1109 {
1110 int i{};
1111 double d{};
1112 bool b{};
1113 std::string s;
1114
1115 if (YAML::convert<int>::decode(node, i)) {
1116 rhs = i;
1117 return true;
1118 }
1119 if (YAML::convert<double>::decode(node, d)) {
1120 rhs = d;
1121 return true;
1122 }
1123 if (YAML::convert<bool>::decode(node, b)) {
1124 rhs = b;
1125 return true;
1126 }
1127 if (YAML::convert<std::string>::decode(node, s)) {
1128 rhs = s;
1129 return true;
1130 }
1131
1132 return false;
1133 }
The documentation for this struct was generated from the following file: