예제 #1
0
        internal static IEnumerable <string> /*!*/ GetMatches(Context ctx, string /*!*/ pattern, GlobOptions flags)
        {
            if (pattern.Length == 0)
            {
                yield break;
            }

            bool noEscape = ((flags & GlobOptions.NoEscape) != 0);
            bool brace    = ((flags & GlobOptions.Brace) != 0);

            string[] groups = UngroupGlobs(pattern, noEscape, brace);
            if (groups.Length == 0)
            {
                yield break;
            }

            foreach (string group in groups)
            {
                GlobMatcher matcher = new GlobMatcher(ctx, group, flags);
                foreach (string filename in matcher.DoGlob())
                {
                    yield return(filename.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar));
                }
            }
        }
예제 #2
0
파일: Glob.cs 프로젝트: emilcardell/Phantom
        /*!*/
        public static IEnumerable<string> GlobResults(IFileAdaptionLayer pal, string/*!*/ pattern, int flags)
        {
            if (pattern.Length == 0) {
                yield break;
            }
            bool noEscape = ((flags & Constants.FNM_NOESCAPE) != 0);
            string[] groups = UngroupGlobs(pattern, noEscape);
            if (groups.Length == 0) {
                yield break;
            }

            foreach (string group in groups) {
                GlobMatcher matcher = new GlobMatcher(pal, group, flags);
                foreach (string filename in matcher.DoGlob()) {
                    yield return filename;
                }
            }
        }
예제 #3
0
        internal static IEnumerable <string> /*!*/ GetMatches(Context ctx, string /*!*/ pattern, GlobOptions flags)
        {
            if (string.IsNullOrEmpty(pattern))
            {
                yield break;
            }

            var noEscape = (flags & GlobOptions.NoEscape) != 0;
            var brace    = (flags & GlobOptions.Brace) != 0;

            var groups = UngroupGlobs(pattern, noEscape, brace);

            foreach (string group in groups)
            {
                var matcher = new GlobMatcher(ctx, group, flags);

                foreach (string filename in matcher.DoGlob())
                {
                    yield return(CurrentPlatform.NormalizeSlashes(filename));
                }
            }
        }
예제 #4
0
        public static IEnumerable <string> /*!*/ GetMatches(string /*!*/ pattern, int flags)
        {
            if (pattern.Length == 0)
            {
                yield break;
            }
            bool noEscape = ((flags & Constants.FNM_NOESCAPE) != 0);

            string[] groups = UngroupGlobs(pattern, noEscape);
            if (groups.Length == 0)
            {
                yield break;
            }
            foreach (string group in groups)
            {
                GlobMatcher matcher = new GlobMatcher(group, flags);
                foreach (string filename in matcher.DoGlob())
                {
                    yield return(filename);
                }
            }
        }
예제 #5
0
        private static IEnumerable <string> GetMatches(PlatformAdaptationLayer pal, string pattern, Constants flags)
        {
            if (pattern.Length == 0)
            {
                yield break;
            }
            var noEscape = ((flags & Constants.NoEscape) != 0);
            var groups   = UngroupGlobs(pattern, noEscape);

            if (groups.Length == 0)
            {
                yield break;
            }

            foreach (var group in groups)
            {
                var matcher = new GlobMatcher(pal, group, flags);
                foreach (var filename in matcher.DoGlob())
                {
                    yield return(filename.Replace("//", "/"));
                }
            }
        }
예제 #6
0
        private static IEnumerable<string> GetMatches(PlatformAdaptationLayer pal, string pattern, Constants flags)
        {
            if (pattern.Length == 0)
            {
                yield break;
            }
            var noEscape = ((flags & Constants.NoEscape) != 0);
            var groups = UngroupGlobs(pattern, noEscape);
            if (groups.Length == 0)
            {
                yield break;
            }

            foreach (var group in groups)
            {
                var matcher = new GlobMatcher(pal, group, flags);
                foreach (var filename in matcher.DoGlob())
                {
                    yield return filename.Replace("//", "/");
                }
            }
        }
예제 #7
0
파일: Glob.cs 프로젝트: yonglehou/docfx
 public static IEnumerable<string>/*!*/ GetMatches(string baseDirectory, string/*!*/ pattern, int flags, Func<string, IEnumerable<string>> filesProvider)
 {
     if (pattern.Length == 0)
     {
         yield break;
     }
     bool noEscape = ((flags & Constants.FNM_NOESCAPE) != 0);
     string[] groups = UngroupGlobs(pattern, noEscape);
     if (groups.Length == 0)
     {
         yield break;
     }
     foreach (string group in groups)
     {
         GlobMatcher matcher = new GlobMatcher(baseDirectory, group, flags, filesProvider);
         foreach (string filename in matcher.DoGlob())
         {
             yield return filename;
         }
     }
 }
예제 #8
0
파일: Glob.cs 프로젝트: gaybro8777/ironruby
        private static IList <string> /*!*/ DoGlob(PlatformAdaptationLayer /*!*/ pal, string /*!*/ pattern, int flags)
        {
            GlobMatcher matcher = new GlobMatcher(pal, pattern, flags);

            return(matcher.DoGlob());
        }
예제 #9
0
        internal static IEnumerable<string>/*!*/ GetMatches(string/*!*/ pattern, GlobOptions flags) 
        {
            if (pattern.Length == 0) {
                yield break;
            }

            bool noEscape = ((flags & GlobOptions.NoEscape) != 0);
            bool brace = ((flags & GlobOptions.Brace) != 0);

            string[] groups = UngroupGlobs(pattern, noEscape, brace);
            if (groups.Length == 0) {
                yield break;
            }

            foreach (string group in groups) {
                GlobMatcher matcher = new GlobMatcher(group, flags);
                foreach (string filename in matcher.DoGlob()) {                 
                    yield return filename;
                }
            }            
        }
예제 #10
0
파일: Glob.cs 프로젝트: jcteague/ironruby
 private static IList<string>/*!*/ DoGlob(PlatformAdaptationLayer/*!*/ pal, string/*!*/ pattern, int flags) {
     GlobMatcher matcher = new GlobMatcher(pal, pattern, flags);
     return matcher.DoGlob();
 }