MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / split

Function split

modules/engine/runtime/src/ecs/query.cpp:28–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26namespace skr
27{
28inline void split(const skr::stl_u8string_view& s, skr::stl_vector<skr::stl_u8string_view>& tokens, const skr::stl_u8string_view& delimiters = u8" ")
29{
30 skr::stl_string::size_type lastPos = s.find_first_not_of(delimiters, 0);
31 skr::stl_string::size_type pos = s.find_first_of(delimiters, lastPos);
32 while (skr::stl_string::npos != pos || skr::stl_string::npos != lastPos)
33 {
34 auto substr = s.substr(lastPos, pos - lastPos);
35 tokens.push_back(substr); // use emplace_back after C++11
36 lastPos = s.find_first_not_of(delimiters, pos);
37 pos = s.find_first_of(delimiters, lastPos);
38 }
39}
40
41inline bool ends_with(skr::stl_u8string_view const& value, skr::stl_u8string_view const& ending)
42{

Callers 3

make_queryMethod · 0.70
get_with_code_linesMethod · 0.50
is_valid_ip_addressMethod · 0.50

Calls 4

find_first_not_ofMethod · 0.45
find_first_ofMethod · 0.45
substrMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected