示例#1
0
        public IEnumerable <IFileSystemInfo> Walk(GlobNode node, Func <IDirectory, bool> predicate)
        {
            var context = new GlobVisitorContext(_fileSystem, _environment, predicate);

            node.Accept(this, context);
            return(context.Results);
        }
示例#2
0
        public static void Validate(GlobNode node)
        {
            var previous = (GlobNode)null;
            var current  = node;

            while (current != null)
            {
                if (previous is RecursiveWildcardSegment)
                {
                    if (current is ParentSegment)
                    {
                        throw new NotSupportedException("Visiting a parent that is a recursive wildcard is not supported.");
                    }
                }
                previous = current;
                current  = current.Next;
            }
        }