2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-08-12 22:05:52 -04:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
namespace SourceControlAutomationCommon
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Helper class for receiving the results of async source control operations
|
|
|
|
|
*/
|
|
|
|
|
class FAsyncCommandHelper
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
FAsyncCommandHelper(const FString& InParameter = FString())
|
|
|
|
|
: Parameter(InParameter)
|
|
|
|
|
, bDispatched(false)
|
|
|
|
|
, bDone(false)
|
|
|
|
|
, bSuccessful(false)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SourceControlOperationComplete(const FSourceControlOperationRef& Operation, ECommandResult::Type InResult)
|
|
|
|
|
{
|
|
|
|
|
bDone = true;
|
|
|
|
|
bSuccessful = InResult == ECommandResult::Succeeded;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const FString& GetParameter() const
|
|
|
|
|
{
|
|
|
|
|
return Parameter;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool IsDispatched() const
|
|
|
|
|
{
|
|
|
|
|
return bDispatched;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SetDispatched()
|
|
|
|
|
{
|
|
|
|
|
bDispatched = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool IsDone() const
|
|
|
|
|
{
|
|
|
|
|
return bDone;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool IsSuccessful() const
|
|
|
|
|
{
|
|
|
|
|
return bSuccessful;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
/** Parameter we perform this operation with, if any */
|
|
|
|
|
FString Parameter;
|
|
|
|
|
|
|
|
|
|
/** Whether the async operation been issued */
|
|
|
|
|
bool bDispatched;
|
|
|
|
|
|
|
|
|
|
/** Whether the async operation has completed */
|
|
|
|
|
bool bDone;
|
|
|
|
|
|
|
|
|
|
/** Whether the operation was successful */
|
|
|
|
|
bool bSuccessful;
|
|
|
|
|
};
|
|
|
|
|
}
|