Files
UnrealEngineUWP/Engine/Source/Programs/Shared/EpicGames.Perforce/FileSpecList.cs
ben marsh 0824f2efa0 Horde: Support for replicating stream hierarchies to the blob store. Currently disabled, pending implementation of code to pack index data into blobs.
#ROBOMERGE-AUTHOR: ben.marsh
#ROBOMERGE-SOURCE: CL 17722664 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v879-17706426)

[CL 17722684 by ben marsh in ue5-release-engine-test branch]
2021-10-05 11:58:55 -04:00

66 lines
1.8 KiB
C#

// Copyright Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
using System.Text;
namespace EpicGames.Perforce
{
/// <summary>
/// Wrapper for a list of filespecs. Allows implicit conversion from string (a single entry) or list.
/// </summary>
public struct FileSpecList
{
/// <summary>
/// Empty filespec list
/// </summary>
public static FileSpecList Empty { get; } = new FileSpecList(new List<string>());
/// <summary>
/// Matches any files in the depot
/// </summary>
public static FileSpecList Any { get; } = new FileSpecList(new List<string> { "//..." });
/// <summary>
/// The list of filespecs
/// </summary>
public IReadOnlyList<string> List { get; }
/// <summary>
/// Private constructor. Use implicit conversion operators below instead.
/// </summary>
/// <param name="FileSpecList">List of filespecs</param>
private FileSpecList(IReadOnlyList<string> FileSpecList)
{
this.List = FileSpecList;
}
/// <summary>
/// Implicit conversion operator from a list of filespecs
/// </summary>
/// <param name="List">The list to construct from</param>
public static implicit operator FileSpecList(List<string> List)
{
return new FileSpecList(List);
}
/// <summary>
/// Implicit conversion operator from an array of filespecs
/// </summary>
/// <param name="Array">The array to construct from</param>
public static implicit operator FileSpecList(string[] Array)
{
return new FileSpecList(Array);
}
/// <summary>
/// Implicit conversion operator from a single filespec
/// </summary>
/// <param name="FileSpec">The single filespec to construct from</param>
public static implicit operator FileSpecList(string FileSpec)
{
return new FileSpecList(new string[] { FileSpec });
}
}
}