예제 #1
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;
                }
            }
        }
예제 #2
0
파일: Glob.cs 프로젝트: emilcardell/Phantom
 internal GlobMatcher(IFileAdaptionLayer pal, string/*!*/ pattern, int flags)
 {
     _pal = pal;
     _pattern = (pattern == "**") ? "*" : pattern;
     _flags = flags | Constants.FNM_CASEFOLD;
     _result = new List<string>();
     _dirOnly = LastCharacter(pattern) == '/';
     _stripTwo = false;
 }