You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rb wouter.burgers #jira UE-181418 #preflight 642ece61df6c5c78fc9b99c9 - Added FSourceControlResultInfo::EAdditionalErrorContext that describes additional info about errors that the operation might have encountered that the caller can poll for rather than trying to parse error strings. -- NOTE that we cannot enforce this info to be provided by source control provider implementations so this additional info should only be used to improve error messages. -- Initially we support the connection to the provider failing and the connection to the provider dropping mid operation. - Moved FSourceControlResultInfo to its own code files. - I wanted to move the implementation of FSourceControlResultInfo::Append to the cpp, but this causes linker problems even with SOURCECONTROL_API as some modules are not including source control properly. For now I have left it in the header file and will look into this in another code pass. [CL 24943799 by paul chipchase in ue5-main branch]
79 lines
2.1 KiB
C++
79 lines
2.1 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "SourceControlResultInfo.h"
|
|
|
|
class ISourceControlOperation : public TSharedFromThis<ISourceControlOperation, ESPMode::ThreadSafe>
|
|
{
|
|
public:
|
|
/**
|
|
* Virtual destructor
|
|
*/
|
|
virtual ~ISourceControlOperation() {}
|
|
|
|
/** Get the name of this operation, used as a unique identifier */
|
|
virtual FName GetName() const = 0;
|
|
|
|
/** Get the string to display when this operation is in progress */
|
|
virtual FText GetInProgressString() const
|
|
{
|
|
return FText();
|
|
}
|
|
|
|
/** Retrieve any info or error messages that may have accumulated during the operation. */
|
|
virtual const FSourceControlResultInfo& GetResultInfo() const
|
|
{
|
|
// Implemented in subclasses
|
|
static const FSourceControlResultInfo ResultInfo = FSourceControlResultInfo();
|
|
return ResultInfo;
|
|
}
|
|
|
|
/** Add info/warning message. */
|
|
virtual void AddInfoMessge(const FText& InInfo)
|
|
{
|
|
// Implemented in subclasses
|
|
}
|
|
|
|
/** Add error message. */
|
|
virtual void AddErrorMessge(const FText& InError)
|
|
{
|
|
// Implemented in subclasses
|
|
}
|
|
|
|
/** Add tag. */
|
|
virtual void AddTag(const FString& InTag)
|
|
{
|
|
// Implemented in subclasses
|
|
}
|
|
|
|
/**
|
|
* Append any info or error messages that may have accumulated during the operation prior
|
|
* to returning a result, ensuring to keep any already accumulated info.
|
|
*/
|
|
virtual void AppendResultInfo(const FSourceControlResultInfo& InResultInfo)
|
|
{
|
|
// Implemented in subclasses
|
|
}
|
|
|
|
/**
|
|
* This will return true if the operation can be safely called from a background thread.
|
|
* Currently it is assumed to only the operation 'FDownloadFile' will return true at least
|
|
* until the API is made thread safe.
|
|
*/
|
|
virtual bool CanBeCalledFromBackgroundThreads() const
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/** Factory method for easier operation creation */
|
|
template<typename Type, typename... TArgs>
|
|
static TSharedRef<Type, ESPMode::ThreadSafe> Create(TArgs&&... Args)
|
|
{
|
|
return MakeShareable( new Type(Forward<TArgs>(Args)...));
|
|
}
|
|
};
|
|
|
|
typedef TSharedRef<class ISourceControlOperation, ESPMode::ThreadSafe> FSourceControlOperationRef;
|