MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / trimTrailingSeparators

Function trimTrailingSeparators

Libraries/Testing/Testing.cpp:121–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121static void trimTrailingSeparators(StringPath& path)
122{
123 const size_t rootLength = findRootLength(path.view());
124 size_t length = nativeLength(path.view());
125 native_char_t* buffer = path.writableSpan().data();
126 while (length > rootLength && isSeparator(buffer[length - 1]))
127 {
128 length--;
129 }
130 (void)path.resize(length);
131}
132
133static Result pathJoin(StringPath& output, StringSpan base, StringSpan leaf)
134{

Callers 2

pathJoinFunction · 0.85

Calls 7

findRootLengthFunction · 0.85
nativeLengthFunction · 0.85
isSeparatorFunction · 0.85
writableSpanMethod · 0.80
viewMethod · 0.45
dataMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected