forked from MonoGame/MonoGame
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWildcardRule.cs
More file actions
21 lines (18 loc) · 980 Bytes
/
WildcardRule.cs
File metadata and controls
21 lines (18 loc) · 980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// MonoGame - Copyright (C) MonoGame Foundation, Inc
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.
using Microsoft.VisualBasic;
using Microsoft.VisualBasic.CompilerServices;
namespace MonoGame.Framework.Content.Pipeline.Builder;
/// <summary>
/// A wildcard based rule by which <see cref="ContentCollection"/> includes or excludes the files.
/// </summary>
public class WildcardRule : ContentRule
{
/// <summary>
/// Used in <see cref="ContentCollection"/> to check if the passed filePath matches the current Wildcard <see cref="ContentRule.Pattern"/>.
/// </summary>
/// <param name="filePath">Relative path to the content file.</param>
/// <returns>Returns true if filePath matches the Wildcard <see cref="ContentRule.Pattern"/>.</returns>
public override bool IsMatch(string filePath) => LikeOperator.LikeString(filePath, Pattern.Sanitize(), CompareMethod.Binary);
}