Exemplo n.º 1
0
 /** 検索。初回ヒット。
  *
  *      a_full_path						: フルパス。
  *      a_directory_pattern				: ディレクトリ名の正規表現パターン。
  *      a_file_pattern					: ファイル名の正規表現パターン。
  *
  */
 public static string FindFirst(string a_full_path, string a_directory_pattern, string a_file_pattern)
 {
     System.Text.RegularExpressions.Regex     t_directory_regex = new System.Text.RegularExpressions.Regex(a_directory_pattern, System.Text.RegularExpressions.RegexOptions.Multiline);
     System.Text.RegularExpressions.Regex     t_file_regex      = new System.Text.RegularExpressions.Regex(a_file_pattern, System.Text.RegularExpressions.RegexOptions.Multiline);
     System.Collections.Generic.List <string> t_list            = CreateFileNameListWithFullPath.CreateAll(a_full_path);
     foreach (string t_item in t_list)
     {
         if (t_file_regex.IsMatch(System.IO.Path.GetFileName(t_item)))
         {
             if (t_directory_regex.IsMatch(System.IO.Path.GetDirectoryName(t_item)))
             {
                 return(t_item);
             }
         }
     }
     return(null);
 }
 /** 作成。直下のみ。
  *
  *      a_assets_path					: 「Assets」からの相対パス。
  *
  */
 public static System.Collections.Generic.List <string> CreateTopOnly(string a_assets_path)
 {
     return(CreateFileNameListWithFullPath.CreateTopOnly(AssetLib.GetApplicationDataPath() + '\\' + a_assets_path));
 }