コード例 #1
0
ファイル: VFSManager.cs プロジェクト: ChrisJamesSadler/IL2CPU
        //Mimics the behaviour of System.IO.Directory.InternalGetFileDirectoryNames
        public static string[] InternalGetFileDirectoryNames(string path, string userPathOriginal, string searchPattern, bool includeFiles, bool includeDirs, SearchOption searchOption)
        {
            //TODO: Add SearchOption functionality
            //TODO: What is userPathOriginal?
            //TODO: Add SearchPattern functionality

            List <string> xFileAndDirectoryNames = new List <string>();

            //Validate input arguments
            if ((searchOption != SearchOption.TopDirectoryOnly) && (searchOption != SearchOption.AllDirectories))
            {
                throw new ArgumentOutOfRangeException("searchOption");
            }

            searchPattern = searchPattern.TrimEnd(new char[0]);
            if (searchPattern.Length == 0)
            {
                return(new string[0]);
            }

            //Perform search in filesystem
            FilesystemEntry[] xEntries = VFSManager.GetDirectoryListing(path);

            foreach (FilesystemEntry xEntry in xEntries)
            {
                if (xEntry.IsDirectory && includeDirs)
                {
                    xFileAndDirectoryNames.Add(xEntry.Name);
                }
                else if (!xEntry.IsDirectory && includeFiles)
                {
                    xFileAndDirectoryNames.Add(xEntry.Name);
                }
            }

            return(xFileAndDirectoryNames.ToArray());
        }
コード例 #2
0
ファイル: Global.cs プロジェクト: ChrisJamesSadler/IL2CPU
 static public void Init()
 {
     Console.WriteLine("    Init Virtual File System");
     VFSManager.Init();
 }