<commit_before>﻿// <copyright file="TargetUtilities.cs" company="<NAME>">
//  Opus
// </copyright>
// <summary>Opus Core</summary>
// <author><NAME></author>
namespace Opus.Core
{
    public static class TargetUtilities
    {
        /// <summary>
        /// For a given Target, identify whether the provided filters for platform, configuration and toolchain are a match or not.
        /// </summary>
        /// <param name="target">The Target to evaluate.</param>
        /// <param name="filterInterface">The filters to look for.</param>
        /// <returns>True if the Target matches the filters, false otherwise.</returns>
        public static bool MatchFilters(Target target, ITargetFilters filterInterface)
        {
            var baseTarget = (BaseTarget)target;
            if (!baseTarget.HasPlatform(filterInterface.Platform))
            {
                return false;
            }
            if (!baseTarget.HasConfiguration(filterInterface.Configuration))
            {
                return false;
            }
            if (null == filterInterface.ToolsetTypes)
            {
                return true;
            }

            foreach (var toolsetType in filterInterface.ToolsetTypes)
            {
                if (target.HasToolsetType(toolsetType))
                {
                    Log.DebugMessage("Target filter '{0}' matches target '{1}'", filterInterface.ToString(), target.ToString());
                    return true;
                }
            }
            return false;
        }

        /// <summary>
        /// Determine a standard name for a directory for this Target.
        /// </summary>
        /// <param name="target">Target to get the directory name for.</param>
        /// <returns>The Target's directory name.</returns>
        public static string DirectoryName(Target target)
        {
            if (null == target.Toolset)
            {
                throw new Exception("Getting the directory name for a null Toolset is not supported");
            }
            var versionString = target.Toolset.Version((BaseTarget)target);
            var builder = new System.Text.StringBuilder();
            builder.AppendFormat("{0}{1}", target.ToString(), versionString);
            return builder.ToString().ToLower();
        }
    }<commit_msg>[trunk] Removing spam debug message for filtering targets.<commit_after>﻿// <copyright file="TargetUtilities.cs" company="<NAME>">
//  Opus
// </copyright>
// <summary>Opus Core</summary>
// <author><NAME></author>
namespace Opus.Core
{
    public static class TargetUtilities
    {
        /// <summary>
        /// For a given Target, identify whether the provided filters for platform, configuration and toolchain are a match or not.
        /// </summary>
        /// <param name="target">The Target to evaluate.</param>
        /// <param name="filterInterface">The filters to look for.</param>
        /// <returns>True if the Target matches the filters, false otherwise.</returns>
        public static bool MatchFilters(Target target, ITargetFilters filterInterface)
        {
            var baseTarget = (BaseTarget)target;
            if (!baseTarget.HasPlatform(filterInterface.Platform))
            {
                return false;
            }
            if (!baseTarget.HasConfiguration(filterInterface.Configuration))
            {
                return false;
            }
            if (null == filterInterface.ToolsetTypes)
            {
                return true;
            }

            foreach (var toolsetType in filterInterface.ToolsetTypes)
            {
                if (target.HasToolsetType(toolsetType))
                {
                    //Log.DebugMessage("Target filter '{0}' matches target '{1}'", filterInterface.ToString(), target.ToString());
                    return true;
                }
            }
            return false;
        }

        /// <summary>
        /// Determine a standard name for a directory for this Target.
        /// </summary>
        /// <param name="target">Target to get the directory name for.</param>
        /// <returns>The Target's directory name.</returns>
        public static string DirectoryName(Target target)
        {
            if (null == target.Toolset)
            {
                throw new Exception("Getting the directory name for a null Toolset is not supported");
            }
            var versionString = target.Toolset.Version((BaseTarget)target);
            var builder = new System.Text.StringBuilder();
            builder.AppendFormat("{0}{1}", target.ToString(), versionString);
            return builder.ToString().ToLower();
        }
    }
{'fraction_non_alphanumeric': 0.11068458093410109, 'fraction_numerical': 0.0017061207080400938, 'mean_word_length': 1.8100659077291792, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6483562', 'n_tokens_mistral': 1105, 'n_tokens_neox': 1078, 'n_words': 317}