MCPcopy Create free account
hub / github.com/MaaXYZ/MaaFramework / check_head_tail

Method check_head_tail

source/MaaAdbControlUnit/Screencap/ScreencapHelper.cpp:191–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189}
190
191bool ScreencapHelper::check_head_tail(std::string_view input, std::string_view head, std::string_view tail)
192{
193 if (input.size() < head.size() || input.size() < tail.size()) {
194 LogError << "input too short" << VAR(input) << VAR(head) << VAR(tail);
195 return false;
196 }
197
198 if (input.substr(0, head.size()) != head || input.substr(input.size() - tail.size(), tail.size()) != tail) {
199 LogError << "head or tail mismatch" << VAR(input) << VAR(head) << VAR(tail);
200 return false;
201 }
202
203 return true;
204}
205
206MAA_CTRL_UNIT_NS_END

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected