PhoenixGenerator  2.0.0
Set of tools to generate code
gitlab_doc.h File Reference
#include "PString.h"
+ Include dependency graph for gitlab_doc.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

PString getGitlabDocUrl (const PString &projectUrl)
 Get the documentation url of the given project url if possible. More...
 

Function Documentation

◆ getGitlabDocUrl()

PString getGitlabDocUrl ( const PString projectUrl)

Get the documentation url of the given project url if possible.

Parameters
projectUrl: url of the project to be used
Returns
corresponding documentation url or empty string if it cannot be determined

Definition at line 14 of file gitlab_doc.cpp.

14  {
15  PString docUrl;
16  if(!projectUrl.isSameBegining("https://gitlab")){
17  return docUrl;
18  }
19  PVecString vecSeparator(projectUrl.split('/'));
20  if(vecSeparator.size() < 5lu){
21  return docUrl;
22  }
23  docUrl += "https://" + vecSeparator[3lu].toLower() + ".pages" + vecSeparator[2lu].replace("gitlab", "") + "/";
24  for(size_t i(4lu); i < vecSeparator.size(); ++i){
25  docUrl += vecSeparator[i] + "/";
26  }
27  return docUrl;
28 }
std::vector< PString > PVecString
Definition: PString.h:96
Extends the std::string.
Definition: PString.h:16
PString replace(const PString &pattern, const PString &replaceStr) const
Replace a PString into an other PString.
Definition: PString.cpp:204
std::vector< PString > split(char separator) const
Cut a PString on the given separator char.
Definition: PString.cpp:420
PString toLower() const
Convert PString in lower case.
Definition: PString.cpp:598
bool isSameBegining(const PString &beginStr) const
Say if the current PString has the same begining of beginStr.
Definition: PString.cpp:306

References PString::isSameBegining(), PString::replace(), PString::split(), and PString::toLower().

Referenced by project_generator_readme().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: