MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / Split

Function Split

src/script/descriptor.cpp:417–431  ·  view source on GitHub ↗

Split a string on every instance of sep, returning a vector. */

Source from the content-addressed store, hash-verified

415
416/** Split a string on every instance of sep, returning a vector. */
417std::vector<Span<const char>> Split(const Span<const char>& sp, char sep)
418{
419 std::vector<Span<const char>> ret;
420 auto it = sp.begin();
421 auto start = it;
422 while (it != sp.end()) {
423 if (*it == sep) {
424 ret.emplace_back(start, it);
425 start = it + 1;
426 }
427 ++it;
428 }
429 ret.emplace_back(start, it);
430 return ret;
431}
432
433/** Parse a key path, being passed a split list of elements (the first element is ignored). */
434bool ParseKeyPath(const std::vector<Span<const char>>& split, KeyPath& out)

Callers 1

ParsePubkeyFunction · 0.85

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected