| 467 | } |
| 468 | |
| 469 | static std::string getErrorContext( size_t offset, std::string_view content ) { |
| 470 | static constexpr std::size_t CONTEXT_LENGTH = 50; |
| 471 | std::size_t minVal = offset >= CONTEXT_LENGTH ? offset - CONTEXT_LENGTH : 0; |
| 472 | std::size_t maxVal = offset + CONTEXT_LENGTH; |
| 473 | std::size_t left = std::max( static_cast<std::size_t>( 0ul ), minVal ); |
| 474 | std::size_t right = std::min( content.size(), maxVal ); |
| 475 | return std::string{ content.substr( left, right - left ) }; |
| 476 | } |
| 477 | |
| 478 | UIWidget* UISceneNode::loadLayoutFromFile( const std::string& layoutPath, Node* parent, |
| 479 | const Uint32& marker ) { |
no test coverage detected