| 197 | { |
| 198 | |
| 199 | VTK_ABI_NAMESPACE_BEGIN |
| 200 | |
| 201 | int ArrayComponents(const std::string& enumerantStr) |
| 202 | { |
| 203 | if (enumerantStr == "vtkArrayComponents::L1Norm" || enumerantStr == "L1Norm" || |
| 204 | enumerantStr == "L₁norm" || enumerantStr == "L₁ norm" || enumerantStr == "||·||₁") |
| 205 | { |
| 206 | return static_cast<int>(vtkArrayComponents::L1Norm); |
| 207 | } |
| 208 | else if (enumerantStr == "vtkArrayComponents::L2Norm" || enumerantStr == "L2Norm" || |
| 209 | enumerantStr == "L₂norm" || enumerantStr == "L₂ norm" || enumerantStr == "||·||₂") |
| 210 | { |
| 211 | return static_cast<int>(vtkArrayComponents::L2Norm); |
| 212 | } |
| 213 | else if (enumerantStr == "vtkArrayComponents::LInfNorm" || enumerantStr == "LInfNorm" || |
| 214 | enumerantStr == "L∞norm" || enumerantStr == "L∞ norm" || enumerantStr == "||·||∞") |
| 215 | { |
| 216 | return static_cast<int>(vtkArrayComponents::LInfNorm); |
| 217 | } |
| 218 | else if (enumerantStr == "vtkArrayComponents::AllComponents" || enumerantStr == "AllComponents" || |
| 219 | enumerantStr == "all components") |
| 220 | { |
| 221 | return static_cast<int>(vtkArrayComponents::AllComponents); |
| 222 | } |
| 223 | else if (enumerantStr == "vtkArrayComponents::Requested" || enumerantStr == "Requested" || |
| 224 | enumerantStr == "requested" || enumerantStr == "requested components") |
| 225 | { |
| 226 | return static_cast<int>(vtkArrayComponents::Requested); |
| 227 | } |
| 228 | // No enumerants match; assume it is an integer. |
| 229 | return vtk::scan_int<int>(enumerantStr)->value(); |
| 230 | } |
| 231 | |
| 232 | std::string to_string(vtkArrayComponents enumerant) |
| 233 | { |
no test coverage detected