本文整理汇总了C++中SourceCode::GetUrl方法的典型用法代码示例。如果您正苦于以下问题:C++ SourceCode::GetUrl方法的具体用法?C++ SourceCode::GetUrl怎么用?C++ SourceCode::GetUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SourceCode
的用法示例。
在下文中一共展示了SourceCode::GetUrl方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getCodeInfo
PDMBUILDER_API void getCodeInfo(char *url,char *version,char *localpath)
{
SourceCode *sourceCode = getSourceCode();
strcpy(url,sourceCode->GetUrl().c_str());
strcpy(version,sourceCode->GetVersion().c_str());
strcpy(localpath,sourceCode->GetLocalPath().c_str());
delete sourceCode;
//url = (char *)sourceCode->GetUrl().c_str();
//version = (char *)sourceCode->GetVersion().c_str();
//localpath = (char *)sourceCode->GetLocalPath().c_str();
}
示例2: checkout
PDMBUILDER_API string checkout(string workspace)
{
SourceCode *sourceCode = getSourceCode();
char ExportCmd[500];
memset(ExportCmd,0,sizeof(ExportCmd));
string url = sourceCode->GetUrl();
string log("<---------------------------checkout--------------------------->\nCheckout: ");
log.append(url).append("\n");
//string fullpath(workspace+"\\"+sourceCode->GetLocalPath());
string fullpath = sourceCode->GetLocalPath();
fullpath = changeSeparator(fullpath);
if(sourceCode->GetVersion() == "head"){
sprintf(ExportCmd, "svn checkout --force --non-interactive --username %s --password %s %s \"%s\"",buildName.c_str(),buildPassword.c_str(),sourceCode->GetUrl().c_str(), fullpath.c_str());
}else{
sprintf(ExportCmd, "svn checkout -r %s --force --non-interactive --username %s --password %s %s \"%s\"",buildName.c_str(),buildPassword.c_str(),sourceCode->GetVersion().c_str(),sourceCode->GetUrl().c_str(),fullpath.c_str());
}
int exitCode = 0;
log += ExeCommand(ExportCmd,exitCode,(char *)workspace.c_str());
if (exitCode>0&&exitCode!=STILL_ACTIVE)
{
return log +"\nerror";
}
int errorindex = log.find("svn: E");
if (errorindex!=string::npos)
{
return log +"\nerror";
}
if ("head" == sourceCode->GetVersion())
{
//int length = log.length();
int index = log.rfind("Checked out revision");
if(index!=string::npos){
int in = log.rfind(".");
index += 21;
sourceVersion = log.substr(index,in-index);
}
}else{
sourceVersion = sourceCode->GetVersion();
}
delete sourceCode;
return log;
}
示例3: import
PDMBUILDER_API string import()
{
SourceCode *scode = getSourceCode();
string sourceUrl = scode->GetUrl();
int tagsIndex = sourceUrl.find("tags");
int branchesIndex = sourceUrl.find("branches");
int trunkIndex = sourceUrl.find("trunk");
if (tagsIndex>0&&branchesIndex==string::npos&&trunkIndex==string::npos)
{
return "";
}else if (tagsIndex>trunkIndex||tagsIndex>branchesIndex)
{
return "";
}
list<ImportStep *> *importStep = getImportStep();
string log;
for(list<ImportStep *>::iterator iter=importStep->begin();iter != importStep->end();++iter)
{
string name = (*iter)->GetName();
string url = (*iter)->GetUrl();
list<ImportItem *> item = (*iter)->GetItem();
vector<string> source;
vector<string> target;
for(list<ImportItem *>::iterator iterItem=item.begin();iterItem != item.end();++iterItem)
{
string path =workspace+"\\"+(*iterItem)->GetSource();
path = changeSeparator(path);
source.push_back(path);
target.push_back(changeSeparator((*iterItem)->GetTarget()));
}
//string logPath = workspace + "\\log";
source.push_back(workspace+"\\log");
target.push_back(".");
//delete item;
log += ImportLibStep(name,url,sourceUrl,source,target);
}
delete scode;
delete importStep;
return log;
}
示例4: publish
PDMBUILDER_API string publish()
{
SourceCode *scode = getSourceCode();
string sourceUrl = scode->GetUrl();
int tagsIndex = sourceUrl.find("tags");
int branchesIndex = sourceUrl.find("branches");
int trunkIndex = sourceUrl.find("trunk");
if (tagsIndex<0&&branchesIndex>0||trunkIndex>0)
{
return "";
}else if (tagsIndex<trunkIndex||tagsIndex<branchesIndex)
{
return "";
}
Publish *publish = getPublish();
list<ImportItem *> itemList = publish->GetImportItem();
vector<string> source;
vector<string> target;
for (list<ImportItem *>::iterator iter = itemList.begin();iter != itemList.end();++iter)
{
string path =workspace+"\\"+(*iter)->GetSource();
path = changeSeparator(path);
source.push_back(path);
//source.push_back((*iter)->GetSource());
target.push_back((*iter)->GetTarget());
}
string log = ExeComponentUpLoad((char *)publish->GetUrl().c_str(),"component",(char *)publish->GetCategory().c_str(),(char *)publish->GetComponent().c_str(),(char *)publish->GetVersion().c_str(),source,target);
//delete itemList;
delete scode;
delete publish;
return log;
}