| 316 | |
| 317 | template <typename ResultType> |
| 318 | bool XMLAttributeValueView::TryGetInteger(ResultType& value) const noexcept |
| 319 | { |
| 320 | static_assert(std::is_integral_v<ResultType>); |
| 321 | |
| 322 | if (mType == Type::SignedInteger) |
| 323 | { |
| 324 | return CheckInteger(value, mInteger); |
| 325 | } |
| 326 | else if (mType == Type::UnsignedInteger) |
| 327 | { |
| 328 | return CheckInteger(value, static_cast<uint64_t>(mInteger)); |
| 329 | } |
| 330 | else if (mType == Type::StringView) |
| 331 | { |
| 332 | const char* end = mStringView.Data + mStringView.Length; |
| 333 | |
| 334 | ResultType tempValue = {}; |
| 335 | |
| 336 | const auto result = FromChars(mStringView.Data, end, tempValue); |
| 337 | |
| 338 | if (result.ec == std::errc() && result.ptr == end) |
| 339 | { |
| 340 | value = tempValue; |
| 341 | return true; |
| 342 | } |
| 343 | } |
| 344 | |
| 345 | return false; |
| 346 | } |
nothing calls this directly
no test coverage detected