2019-12-26 15:32:37 -05:00
// Copyright Epic Games, Inc. All Rights Reserved.
2014-03-14 14:13:41 -04:00
# pragma once
2016-11-23 15:48:37 -05:00
# include "CoreMinimal.h"
2021-08-31 15:12:47 -04:00
# include "ISourceControlProvider.h"
2014-03-14 14:13:41 -04:00
/**
* A single line of an annotated file
*/
class FAnnotationLine
{
public :
FAnnotationLine ( int32 InChangeNumber , const FString & InUserName , const FString & InLine )
: ChangeNumber ( InChangeNumber )
, UserName ( InUserName )
, Line ( InLine )
{
}
int32 ChangeNumber ;
FString UserName ;
FString Line ;
} ;
/**
* Abstraction of a source control revision.
*/
class ISourceControlRevision : public TSharedFromThis < ISourceControlRevision , ESPMode : : ThreadSafe >
{
public :
/**
* Virtual destructor
*/
virtual ~ ISourceControlRevision ( ) { }
/**
* Get this revision of the file & store it in a temp file.
* @param InOutFilename The filename that the revision will be written to. If this is empty a temp filename will be generated and returned in this string.
2021-08-31 15:12:47 -04:00
* @param InConcurrency The concurrency type of the get operation. Should be used when the revision is not requested from the main thread.
2014-03-14 14:13:41 -04:00
* @return true if the operation succeeded.
*/
2021-08-31 15:12:47 -04:00
virtual bool Get ( FString & InOutFilename , EConcurrency : : Type InConcurrency = EConcurrency : : Synchronous ) const = 0 ;
2014-03-14 14:13:41 -04:00
/**
* Get an annotated revision of the file & store it in a temp file.
* @param OutLines Array of lines representing the contents of the file.
* @return true if the operation succeeded.
*/
virtual bool GetAnnotated ( TArray < FAnnotationLine > & OutLines ) const = 0 ;
/**
* Get an annotated revision of the file & store it in a temp file.
* @param InOutFilename The filename that the revision will be written to. If this is empty a temp filename will be generated and returned in this string.
* @return true if the operation succeeded.
*/
virtual bool GetAnnotated ( FString & InOutFilename ) const = 0 ;
/** Get the local filename of this file. */
virtual const FString & GetFilename ( ) const = 0 ;
/** Number of the revision */
virtual int32 GetRevisionNumber ( ) const = 0 ;
2015-01-20 05:48:14 -05:00
/** String representation of the revision */
virtual const FString & GetRevision ( ) const = 0 ;
2014-03-14 14:13:41 -04:00
/** Changelist/Commit description */
virtual const FString & GetDescription ( ) const = 0 ;
/** User name of the submitter */
virtual const FString & GetUserName ( ) const = 0 ;
/** Workspace/Clientspec of the submitter (if any) */
virtual const FString & GetClientSpec ( ) const = 0 ;
/** Action taken to the file this revision (branch/integrate/edit/etc.) */
virtual const FString & GetAction ( ) const = 0 ;
2014-06-05 12:10:47 -04:00
/** Source of branch, if any */
virtual TSharedPtr < ISourceControlRevision , ESPMode : : ThreadSafe > GetBranchSource ( ) const = 0 ;
2014-03-14 14:13:41 -04:00
/** Date of the revision */
virtual const FDateTime & GetDate ( ) const = 0 ;
/** Changelist number/revision number of the revision - an identifier for the check-in */
virtual int32 GetCheckInIdentifier ( ) const = 0 ;
/** File size of the revision (0 if the file was deleted) */
virtual int32 GetFileSize ( ) const = 0 ;
2016-11-23 15:48:37 -05:00
} ;