本文整理汇总了C++中SourceCode::GetSourceFile方法的典型用法代码示例。如果您正苦于以下问题:C++ SourceCode::GetSourceFile方法的具体用法?C++ SourceCode::GetSourceFile怎么用?C++ SourceCode::GetSourceFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SourceCode
的用法示例。
在下文中一共展示了SourceCode::GetSourceFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: locker
void
TeamWindow::_HandleSourceCodeChanged()
{
// If we don't have an active function anymore, the message is obsolete.
if (fActiveFunction == NULL)
return;
// get a reference to the source code
AutoLocker< ::Team> locker(fTeam);
SourceCode* sourceCode = fActiveFunction->GetFunction()->GetSourceCode();
LocatableFile* sourceFile = NULL;
BString sourceText;
BString truncatedText;
if (sourceCode == NULL)
sourceCode = fActiveFunction->GetSourceCode();
if (sourceCode != NULL)
sourceFile = fActiveFunction->GetFunctionDebugInfo()->SourceFile();
if (sourceFile != NULL && !sourceFile->GetLocatedPath(sourceText))
sourceFile->GetPath(sourceText);
if (sourceCode != NULL && sourceCode->GetSourceFile() == NULL
&& sourceFile != NULL) {
sourceText.Prepend("Click to locate source file '");
sourceText += "'";
truncatedText = sourceText;
fSourcePathView->TruncateString(&truncatedText, B_TRUNCATE_MIDDLE,
fSourcePathView->Bounds().Width());
if (sourceText != truncatedText)
fSourcePathView->SetToolTip(sourceText.String());
fSourcePathView->SetText(truncatedText.String());
} else if (sourceFile != NULL) {
sourceText.Prepend("File: ");
fSourcePathView->SetText(sourceText.String());
} else
fSourcePathView->SetText("Source file unavailable.");
BReference<SourceCode> sourceCodeReference(sourceCode);
locker.Unlock();
_SetActiveSourceCode(sourceCode);
}