本文整理汇总了C++中FSourceControlStatePtr::CanEdit方法的典型用法代码示例。如果您正苦于以下问题:C++ FSourceControlStatePtr::CanEdit方法的具体用法?C++ FSourceControlStatePtr::CanEdit怎么用?C++ FSourceControlStatePtr::CanEdit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FSourceControlStatePtr
的用法示例。
在下文中一共展示了FSourceControlStatePtr::CanEdit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Main
//.........这里部分代码省略.........
UE_LOG(LogFixupRedirectsCommandlet, Warning, TEXT(""));
CLEAR_WARN_COLOR();
// if we are only testing, just just quiet before actually doing anything
if (bIsTestOnly)
{
LogOutputFile->Close();
delete LogOutputFile;
LogOutputFile = NULL;
return 0;
}
/////////////////////////////////////////////////////////////////////
// Find redirectors that are referenced by packages we cant check out
/////////////////////////////////////////////////////////////////////
bool bEngineRedirectorCantBeCleaned = false;
ISourceControlProvider& SourceControlProvider = ISourceControlModule::Get().GetProvider();
// initialize source control if it hasn't been initialized yet
if(!bIsSCCDisabled)
{
SourceControlProvider.Init();
//Make sure we can check out all packages - update their state first
SourceControlProvider.Execute(ISourceControlOperation::Create<FUpdateStatus>(), UpdatePackages);
}
for( int32 PackageIndex = 0; PackageIndex < UpdatePackages.Num(); PackageIndex++ )
{
const FString& Filename = UpdatePackages[PackageIndex];
bool bCanEdit = true;
if(!bIsSCCDisabled)
{
FSourceControlStatePtr SourceControlState = SourceControlProvider.GetState(Filename, EStateCacheUsage::ForceUpdate);
if(SourceControlState.IsValid() && !SourceControlState->CanEdit())
{
bCanEdit = false;
}
}
else if(IFileManager::Get().IsReadOnly(*Filename))
{
bCanEdit = false;
}
if(!bCanEdit)
{
const bool bAllowCheckout = bUpdateEnginePackages || !Filename.StartsWith( FPaths::EngineDir() );
if (!bIsSCCDisabled && bAllowCheckout)
{
FString PackageName(FPackageName::FilenameToLongPackageName(Filename));
FSourceControlStatePtr SourceControlState = SourceControlProvider.GetState(Filename, EStateCacheUsage::ForceUpdate);
if (SourceControlState.IsValid() && SourceControlState->CanCheckout())
{
SourceControlProvider.Execute(ISourceControlOperation::Create<FCheckOut>(), SourceControlHelpers::PackageFilename(PackageName));
FSourceControlStatePtr NewSourceControlState = SourceControlProvider.GetState(Filename, EStateCacheUsage::ForceUpdate);
bCanEdit = NewSourceControlState.IsValid() && NewSourceControlState->CanEdit();
}
}
// if the checkout failed for any reason, we can't clean it up
if (bAllowCheckout && !bCanEdit)