MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / beginsWith

Method beginsWith

source/core/StarStringView.cpp:108–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108bool StringView::beginsWith(StringView beg, CaseSensitivity cs) const {
109 if (beg.m_view.empty())
110 return true;
111
112 size_t begSize = beg.size();
113 auto it = begin();
114 auto itEnd = end();
115 for (size_t i = 0; i != begSize; ++i)
116 {
117 if (it == itEnd)
118 return false;
119 it++;
120 }
121
122 return compare(0, begSize, beg, 0, NPos, cs) == 0;
123}
124
125bool StringView::beginsWith(Char beg, CaseSensitivity cs) const {
126 if (m_view.empty())

Callers

nothing calls this directly

Calls 5

beginFunction · 0.85
endFunction · 0.85
compareFunction · 0.85
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected