Exemple #1
0
        AssetTimings[] GenerateTimings(string[] doneImportingLines)
        {
            Regex pathRegex    = new Regex("'.*' ", RegexOptions.Compiled);
            Regex secondsRegex = new Regex(@" [0-9]+\.[0-9]+ ", RegexOptions.Compiled);

            List <AssetTimings> timings = new List <AssetTimings>();

            foreach (var curLine in doneImportingLines)
            {
                var pathMatch    = pathRegex.Match(curLine);
                var secondsMatch = secondsRegex.Match(curLine);

                if (pathMatch.Success && secondsMatch.Success)
                {
                    var pathCleaned = pathMatch.ToString().Replace('\'', ' ');

                    pathCleaned = pathCleaned.Trim();

                    if (pathCleaned.IndexOf(",") >= 0)
                    {
                        pathCleaned = "\"" + pathCleaned + "\"";
                    }

                    var timing = new AssetTimings(pathCleaned, secondsMatch.ToString().Trim());
                    timings.Add(timing);
                }
            }

            return(timings.ToArray());
        }
Exemple #2
0
        private static AssetTimings[] GenerateTimings_2020_2_OR_NEWER(string[] doneImportingLines)
        {
            Regex pathRegex    = new Regex("importing .*using Guid", RegexOptions.Compiled);
            Regex secondsRegex = new Regex(@" [0-9]+\.[0-9]+ ", RegexOptions.Compiled);

            List <AssetTimings> timings = new List <AssetTimings>();

            foreach (var curLine in doneImportingLines)
            {
                var pathMatch    = pathRegex.Match(curLine);
                var secondsMatch = secondsRegex.Match(curLine);

                if (pathMatch.Success && secondsMatch.Success)
                {
                    var pathCleaned = pathMatch.ToString().Replace("importing ", string.Empty);
                    pathCleaned = pathCleaned.Replace(" using Guid", string.Empty);
                    pathCleaned = pathCleaned.Trim();

                    if (pathCleaned.IndexOf(",") >= 0)
                    {
                        pathCleaned = "\"" + pathCleaned + "\"";
                    }

                    var timing = new AssetTimings(pathCleaned, secondsMatch.ToString().Trim());
                    timings.Add(timing);
                }
            }

            return(timings.ToArray());
        }