<commit_before>// <copyright file="InstallPathAction.cs" company="<NAME>">
//  Opus package
// </copyright>
// <summary>ClangCommon package</summary>
// <author><NAME></author>

[assembly: Opus.Core.RegisterAction(typeof(ClangCommon.InstallPathAction))]

namespace ClangCommon
{
    [Opus.Core.PreambleAction]
    public sealed class InstallPathAction : Opus.Core.IActionWithArguments
    {
        private string InstallPath
        {
            get;
            set;
        }

        void Opus.Core.IActionWithArguments.AssignArguments(string arguments)
        {
            this.InstallPath = arguments;
        }

        string Opus.Core.IAction.CommandLineSwitch
        {
            get
            {
                return "-clang.installpath";
            }
        }

        string Opus.Core.IAction.Description
        {
            get
            {
                return "Override the Clang installation path";
            }
        }

        bool Opus.Core.IAction.Execute()
        {
            if (!System.IO.Directory.Exists(this.InstallPath))
            {
                string absolutePath = System.IO.Path.Combine(Opus.Core.State.WorkingDirectory, this.InstallPath);
                if (!System.IO.Directory.Exists(absolutePath))
                {
                    throw new Opus.Core.Exception("Path '{0}' does not exist and is not relative to the working directory '{1}", this.InstallPath, Opus.Core.State.WorkingDirectory);
                }

                this.InstallPath = absolutePath;
            }

            Opus.Core.State.AddCategory("Clang");
            Opus.Core.State.Set("Clang", "InstallPath", this.InstallPath);

            Opus.Core.Log.DebugMessage("Clang installation path is now '{0}'", this.InstallPath);<commit_msg>[050copyfiles] Updated ClangCommon-dev using 'var' to simplify code layout<commit_after>// <copyright file="InstallPathAction.cs" company="<NAME>">
//  Opus package
// </copyright>
// <summary>ClangCommon package</summary>
// <author><NAME></author>

[assembly: Opus.Core.RegisterAction(typeof(ClangCommon.InstallPathAction))]

namespace ClangCommon
{
    [Opus.Core.PreambleAction]
    public sealed class InstallPathAction : Opus.Core.IActionWithArguments
    {
        private string InstallPath
        {
            get;
            set;
        }

        void Opus.Core.IActionWithArguments.AssignArguments(string arguments)
        {
            this.InstallPath = arguments;
        }

        string Opus.Core.IAction.CommandLineSwitch
        {
            get
            {
                return "-clang.installpath";
            }
        }

        string Opus.Core.IAction.Description
        {
            get
            {
                return "Override the Clang installation path";
            }
        }

        bool Opus.Core.IAction.Execute()
        {
            if (!System.IO.Directory.Exists(this.InstallPath))
            {
                var absolutePath = System.IO.Path.Combine(Opus.Core.State.WorkingDirectory, this.InstallPath);
                if (!System.IO.Directory.Exists(absolutePath))
                {
                    throw new Opus.Core.Exception("Path '{0}' does not exist and is not relative to the working directory '{1}", this.InstallPath, Opus.Core.State.WorkingDirectory);
                }

                this.InstallPath = absolutePath;
            }

            Opus.Core.State.AddCategory("Clang");
            Opus.Core.State.Set("Clang", "InstallPath", this.InstallPath);

            Opus.Core.Log.DebugMessage("Clang installation path is now '{0}'", this.InstallPath);
{'fraction_non_alphanumeric': 0.10702433628318585, 'fraction_numerical': 0.002488938053097345, 'mean_word_length': 1.8706349206349207, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '5934849', 'n_tokens_mistral': 982, 'n_tokens_neox': 943, 'n_words': 177}