コード例 #1
0
        /// <summary>
        /// Gets <see cref="FastFileInfo"/> for all the files in a directory that match a
        /// specific filter.
        /// </summary>
        /// <param name="path">The path to search.</param>
        /// <param name="searchPattern">The search string to match against files in the path.</param>
        /// <returns>An object that implements <see cref="IEnumerable{FileData}"/> and
        /// allows you to enumerate the files in the given directory.</returns>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="path"/> is a null reference (Nothing in VB)
        /// </exception>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="filter"/> is a null reference (Nothing in VB)
        /// </exception>
        public static FastFileInfo[] GetFiles(string path, string searchPattern, SearchOption searchOption)
        {
            IEnumerable <FastFileInfo> e    = FastDirectoryInfo.EnumerateFiles(path, searchPattern, searchOption);
            List <FastFileInfo>        list = new List <FastFileInfo>(e);

            FastFileInfo[] retval = new FastFileInfo[list.Count];
            list.CopyTo(retval);

            return(retval);
        }
コード例 #2
0
 /// <summary>
 /// Gets <see cref="FastFileInfo"/> for all the files in a directory that match a
 /// specific filter.
 /// </summary>
 /// <param name="path">The path to search.</param>
 /// <param name="searchPattern">The search string to match against files in the path.</param>
 /// <returns>An object that implements <see cref="IEnumerable{FileData}"/> and
 /// allows you to enumerate the files in the given directory.</returns>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="path"/> is a null reference (Nothing in VB)
 /// </exception>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="filter"/> is a null reference (Nothing in VB)
 /// </exception>
 public static IEnumerable <FastFileInfo> EnumerateFiles(string path, string searchPattern)
 {
     return(FastDirectoryInfo.EnumerateFiles(path, searchPattern, SearchOption.TopDirectoryOnly));
 }
コード例 #3
0
 /// <summary>
 /// Gets <see cref="FastFileInfo"/> for all the files in a directory.
 /// </summary>
 /// <param name="path">The path to search.</param>
 /// <returns>An object that implements <see cref="IEnumerable{FileData}"/> and
 /// allows you to enumerate the files in the given directory.</returns>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="path"/> is a null reference (Nothing in VB)
 /// </exception>
 public static IEnumerable <FastFileInfo> EnumerateFiles(string path)
 {
     return(FastDirectoryInfo.EnumerateFiles(path, "*"));
 }