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

Function removeDirectoryPrefix

plugins/grepview/grepfindthread.cpp:90–97  ·  view source on GitHub ↗

* Returns a slash plus the path to @p filePath relative to its parent directory @p parentDirectoryPath. * @param filePath the path to a file. * @param parentDirectoryPath the path to a parent directory of @p filePath without a trailing slash * (an empty string is the root directory path). */

Source from the content-addressed store, hash-verified

88 * (an empty string is the root directory path).
89 */
90QString removeDirectoryPrefix(QString filePath, const QString& parentDirectoryPath)
91{
92 Q_ASSERT(filePath.startsWith(parentDirectoryPath));
93 Q_ASSERT(filePath.size() > parentDirectoryPath.size());
94 Q_ASSERT(filePath.at(parentDirectoryPath.size()) == QLatin1Char{'/'});
95 filePath.remove(0, parentDirectoryPath.size());
96 return filePath;
97}
98
99class FileFinder
100{

Callers 1

getProjectFilesMethod · 0.85

Calls 3

sizeMethod · 0.45
atMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected