Beispiel #1
0
        /// <summary>
        ///     Extracts the masks.
        /// </summary>
        /// <param name="args">The arguments.</param>
        /// <param name="i">The i.</param>
        /// <param name="arg">The argument.</param>
        /// <param name="options">The options.</param>
        /// <exception cref="FormatException"></exception>
        /// <exception cref="ArgumentException"></exception>
        /// <exception cref="System.FormatException"></exception>
        /// <exception cref="System.ArgumentException"></exception>
        internal static void ExtractMasks(string[] args, int i, string arg, IndexOptions options)
        {
            var breakpointMasks = new List <BreakpointMask>();

            for (var j = i + 1; j < args.Length; j++)
            {
                var ptr = args[j];
                if (Switches.Contains(ptr))
                {
                    break;
                }
                try
                {
                    var mask = BreakpointMask.Parse(ptr);
                    breakpointMasks.Add(mask);
                }
                catch (Exception e)
                {
                    throw new FormatException($"Unable to parse {ptr} as a BreakpointMask", e);
                }
            }

            if (!breakpointMasks.Any())
            {
                throw new ArgumentException($"No breakpoint masks provided to {arg}");
            }
            options.BreakpointMasks = breakpointMasks;
        }
Beispiel #2
0
 internal virtual int ExtractBreakpointMasks(string[] args, int startIndex, string arg, IndexOptions options)
 {
     var breakpointMasks = new List<BreakpointMask>();
     int j;
     for (j = startIndex + 1; j < args.Length; j++)
     {
         var ptr = args[j];
         if (Switches.Contains(ptr))
             break;
         try
         {
             var mask = BreakpointMask.Parse(ptr);
             breakpointMasks.Add(mask);
         }
         catch (Exception e)
         {
             throw new FormatException($"Unable to parse {ptr} as a BreakpointMask", e);
         }
     }
     
     options.BreakpointMasks = breakpointMasks;
     return j - 1;
 }