MCPcopy Create free account
hub / github.com/SpartanJ/eepp / getErrorContext

Function getErrorContext

src/eepp/ui/uiscenenode.cpp:469–476  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

467}
468
469static 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
478UIWidget* UISceneNode::loadLayoutFromFile( const std::string& layoutPath, Node* parent,
479 const Uint32& marker ) {

Callers 4

loadLayoutFromFileMethod · 0.85
loadLayoutFromStringMethod · 0.85
loadLayoutFromMemoryMethod · 0.85
loadLayoutFromStreamMethod · 0.85

Calls 2

substrMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected