MCPcopy Create free account
hub / github.com/KDE/kdevelop / slicedOrEmptyView

Function slicedOrEmptyView

kdevplatform/util/stringviewhelpers.h:20–24  ·  view source on GitHub ↗

* @pre @p pos >= 0 * @return a string view starting at position @p pos in @p view and extending to its end, * or an empty string view if @p pos exceeds the length of @p view */

Source from the content-addressed store, hash-verified

18 * or an empty string view if @p pos exceeds the length of @p view
19 */
20constexpr QStringView slicedOrEmptyView(QStringView view, qsizetype pos)
21{
22 Q_ASSERT(pos >= 0);
23 return pos < view.size() ? view.sliced(pos) : QStringView{};
24}
25
26/**
27 * @pre @p offset >= 0

Callers 2

createWorkingCopyMethod · 0.85
parseGitStashListMethod · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected