| 125 | } |
| 126 | |
| 127 | Type 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 | |
| 155 | long int getPrecision(const Cantera::AnyValue& precisionSource) |
| 156 | { |