<commit_before>﻿// Copyright © 2010-2015 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Text;

namespace CefSharp
{
    /// <summary>
    /// TODO: Expand to support optional dependencies
    /// </summary>
    public static class DependencyChecker
    {
        private const string LocalPackPath = @"locales\en-US.pak";

        /// <summary>
        /// List of Cef Dependencies - currently contains all possabilties
        /// </summary>
        public static string[] CefDependencies =
        {
            "libcef.dll",
            "libEGL.dll",
            "libGLESv2.dll",
            "pdf.dll",
            "icudtl.dat",
            "ffmpegsumo.dll",
            "d3dcompiler_43.dll",
            "d3dcompiler_47.dll",
            "devtools_resources.pak",
            "cef.pak",
            "cef_100_percent.pak",
            "cef_200_percent.pak"
        };

        /// <summary>
        /// List of CefSharp Dependencies
        /// </summary>
        public static string[] CefSharpDependencies =
        {
            "CefSharp.Core.dll",
            "CefSharp.dll",
            "CefSharp.BrowserSubprocess.Core.dll",
            "CefSharp.BrowserSubprocess.exe"
        };

        /// <summary>
        /// CheckDependencies iterates through the list of Cef and CefSharp dependencines
        /// relative to the path provided and returns a list of missing ones
        /// </summary>
        /// <param name="path">path to check for dependencies</param>
        /// <param name="localePackFile">The locale pack file e.g. locales\en-US.pak</param>
        /// <returns>List of missing dependencies, if all present an empty List will be returned</returns>
        public static List<string> CheckDependencies(string path, string localePackFile)
        {
            var missingDependencies = new List<string>();

            //Loop through Cef dependencies and add to list if not found
            foreach (var cefDependency in CefDependencies)
            {<commit_msg>First attempt at splitting out into required/optional dependencies Based on https://github.com/cefsharp/cef-binary/blob/master/README.txt<commit_after>﻿// Copyright © 2010-2015 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Text;

namespace CefSharp
{
    /// <summary>
    /// TODO: Expand to support optional dependencies
    /// </summary>
    public static class DependencyChecker
    {
        private const string LocalPackPath = @"locales\en-US.pak";

        /// <summary>
        /// List of Cef Dependencies - currently contains all possabilties
        /// </summary>
        public static string[] CefDependencies =
        {
            // CEF core library
            "libcef.dll",
            // Unicode support
            "icudtl.dat",
            // Pack Files
            // Note: Contains WebKit image and inspector resources.
            "devtools_resources.pak",
            "cef.pak",
            "cef_100_percent.pak",
            "cef_200_percent.pak"
        };

        public static string[] CefOptionalDependencies =
        {
            // Angle and Direct3D support
            // Note: Without these components HTML5 accelerated content like 2D canvas, 3D CSS and WebGL will not function.
            "libEGL.dll",
            "libGLESv2.dll",
            "d3dcompiler_43.dll",
            "d3dcompiler_47.dll",
            // PDF support
            // Note: Without this component printing will not function.
            "pdf.dll",
            //FFmpeg audio and video support
            // Note: Without this component HTML5 audio and video will not function.
            "ffmpegsumo.dll",
        };

        /// <summary>
        /// List of CefSharp Dependencies
        /// </summary>
        public static string[] CefSharpDependencies =
        {
            "CefSharp.Core.dll",
            "CefSharp.dll",
            "CefSharp.BrowserSubprocess.Core.dll",
            "CefSharp.BrowserSubprocess.exe"
        };

        /// <summary>
        /// CheckDependencies iterates through the list of Cef and CefSharp dependencines
        /// relative to the path provided and returns a list of missing ones
        /// </summary>
        /// <param name="path">path to check for dependencies</param>
        /// <param name="localePackFile">The locale pack file e.g. locales\en-US.pak</param>
        /// <returns>List of missing dependencies, if all present an empty List will be returned</returns>
        public static List<string> CheckDependencies(string path, string localePackFile)
        {
            var missingDependencies = new List<string>();

            //Loop through Cef dependencies and add to list if not found
            foreach (var cefDependency in CefDependencies)
            {
                var dependencyPath = Path.Combine(path, cefDependency);

                if (!File.Exists(dependencyPath))
                {
                    missingDependencies.Add(cefDependency);
                }
            }

            //Loop through Cef Optional dependencies and add to list if not found
            foreach (var cefDependency in CefOptionalDependencies)
            {
{'fraction_non_alphanumeric': 0.09516070783676417, 'fraction_numerical': 0.008486818345973276, 'mean_word_length': 1.8640124095139607, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, 'https://': 1, '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': '4796672', 'n_tokens_mistral': 1526, 'n_tokens_neox': 1415, 'n_words': 449}