MCPcopy Create free account
hub / github.com/Cantera/cantera / elementTypes

Function elementTypes

src/base/AnyMap.cpp:127–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125}
126
127Type elementTypes(const YAML::Node& node)
128{
129 // See what kinds of elements we have:
130 Type types = Type::Unknown;
131 for (const auto& el : node) {
132 if (el.IsMap()) {
133 types = types | Type::Map;
134 } else if (el.IsSequence()) {
135 types = types | Type::Sequence;
136 } else if (el.IsScalar()) {
137 string nodestr = el.as<string>();
138 if (el.Tag() == "!") {
139 // Prevent implicit conversion of quoted strings to numeric types
140 types = types | Type::String;
141 } else if (isInt(nodestr)) {
142 types = types | Type::Integer;
143 } else if (isFloat(nodestr)) {
144 types = types | Type::Double;
145 } else if (isBool(nodestr)) {
146 types = types | Type::Bool;
147 } else {
148 types = types | Type::String;
149 }
150 }
151 }
152 return types;
153}
154
155long int getPrecision(const Cantera::AnyValue& precisionSource)
156{

Callers 1

decodeMethod · 0.85

Calls 3

isIntFunction · 0.85
isFloatFunction · 0.85
isBoolFunction · 0.85

Tested by

no test coverage detected