예제 #1
0
        /// <summary>
        /// Extracts a name of configuration file
        /// </summary>
        /// <returns>
        /// Reference a name of configuration file
        /// or an empty string if it is not provided in a configuration file
        /// </returns>
        /// <param name="TANFileContent">Content of a task allocation file</param>
        public static string GetConfigFilename(string TANFileContent)
        {
            Regex rx    = new Regex(@"CONFIGURATION,""(.*\.csv)""");
            Match match = FileParser.GetRegexMatch(TANFileContent, rx);

            if (!match.Success)
            {
                return("");
            }
            else
            {
                return(match.Groups[1].Captures[0].Value);
            }
        }
예제 #2
0
        /// <summary>
        /// Extracts ids of provided processors.
        /// </summary>
        /// <returns>
        /// Ids of used processors
        /// </returns>
        /// <param name="configFileContent">Content of a configuration file</param>
        public static List <string> GetProcessorIds(string configFileContent)
        {
            Regex processorIdsRx = new Regex($@"PROCESSOR-ID,FREQUENCY(?:{FileParser.NewLineRx})(?:\s*(\d+),\d+\.\d+(?:{FileParser.NewLineRx})?)+");

            return(FileParser.GetCaptureValues(configFileContent, processorIdsRx));
        }