Directory: | ./ |
---|---|
File: | src/gitlab_doc.cpp |
Date: | 2025-04-25 19:10:50 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 12 | 12 | 100.0% |
Branches: | 21 | 21 | 100.0% |
Line | Branch | Exec | Source |
---|---|---|---|
1 | /*************************************** | ||
2 | Auteur : Pierre Aubert | ||
3 | Mail : pierre.aubert@lapp.in2p3.fr | ||
4 | Licence : CeCILL-C | ||
5 | ****************************************/ | ||
6 | |||
7 | |||
8 | #include "gitlab_doc.h" | ||
9 | |||
10 | ///Get the documentation url of the given project url if possible | ||
11 | /** @param projectUrl : url of the project to be used | ||
12 | * @return corresponding documentation url or empty string if it cannot be determined | ||
13 | */ | ||
14 | 9 | PString getGitlabDocUrl(const PString & projectUrl){ | |
15 |
1/1✓ Branch 1 taken 9 times.
|
9 | PString docUrl; |
16 |
4/4✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 1 times.
✓ Branch 8 taken 8 times.
|
9 | if(!projectUrl.isSameBegining("https://gitlab")){ |
17 | 1 | return docUrl; | |
18 | } | ||
19 |
1/1✓ Branch 1 taken 8 times.
|
8 | PVecString vecSeparator(projectUrl.split('/')); |
20 |
2/2✓ Branch 1 taken 1 times.
✓ Branch 2 taken 7 times.
|
8 | if(vecSeparator.size() < 5lu){ |
21 | 1 | return docUrl; | |
22 | } | ||
23 |
9/9✓ Branch 2 taken 7 times.
✓ Branch 5 taken 7 times.
✓ Branch 8 taken 7 times.
✓ Branch 12 taken 7 times.
✓ Branch 15 taken 7 times.
✓ Branch 18 taken 7 times.
✓ Branch 21 taken 7 times.
✓ Branch 24 taken 7 times.
✓ Branch 27 taken 7 times.
|
7 | docUrl += "https://" + vecSeparator[3lu].toLower() + ".pages" + vecSeparator[2lu].replace("gitlab", "") + "/"; |
24 |
2/2✓ Branch 1 taken 17 times.
✓ Branch 2 taken 7 times.
|
24 | for(size_t i(4lu); i < vecSeparator.size(); ++i){ |
25 |
2/2✓ Branch 2 taken 17 times.
✓ Branch 5 taken 17 times.
|
17 | docUrl += vecSeparator[i] + "/"; |
26 | } | ||
27 | 7 | return docUrl; | |
28 | 8 | } | |
29 | |||
30 | |||
31 |