Matcher クラス
定義
指定されたパターンに一致する名前を持つファイルを、ファイル システム内で検索します。Searches the file system for files with names that match specified patterns.
public ref class Matcher
public class Matcher
type Matcher = class
Public Class Matcher
- 継承
-
Matcher
注釈
とで指定されたパターンは AddInclude(String) AddExclude(String) 、次の形式を使用して、複数のファイルまたはディレクトリと一致させることができます。Patterns specified in AddInclude(String) and AddExclude(String) can use the following formats to match multiple files or directories.
- ディレクトリとファイル名を正確に指定します。Exact directory and file name.
one.txt
one.txt
dir/two.txt
dir/two.txt
- ファイル名とディレクトリ名のワイルドカード (\*) は、ディレクトリ区切り文字を含まない0個以上の文字を表します。Wildcards (\*) in file and directory names that represent zero to many characters not including directory separators characters.
[値]Value 説明Description \*.txt
\*.txt
.Txt ファイル拡張子を持つすべてのファイル。All files with .txt file extension. *.*
*.*
拡張子を持つすべてのファイル。All files with an extension. *
最上位のディレクトリにあるすべてのファイル。All files in top-level directory. .\*
.\*
ファイル名の先頭に '. ' を使用します。File names beginning with '.'. *テキスト*
*word*
ファイル名に ' word ' が含まれているすべてのファイル。All files with 'word' in the filename. readme. \*
readme.\*
すべてのファイル拡張子を持つ ' readme ' という名前のすべてのファイル。All files named 'readme' with any file extension. スタイル/\* .css
styles/\*.css
ディレクトリ ' styles/' に拡張子 ' .css ' を持つすべてのファイル。All files with extension '.css' in the directory 'styles/'. 下付き*/*
scripts/*/*
' Scripts/' 内のすべてのファイル、または ' scripts/' の下の1つのレベルのサブディレクトリ。All files in 'scripts/' or one level of subdirectory under 'scripts/'. イメージ*/*
images*/*
名前がで、または ' images ' で始まるフォルダー内のすべてのファイル。All files in a folder with name that is or begins with 'images'. - 任意のディレクトリの深さ (
/\*\*/
)。Arbitrary directory depth (/\*\*/
).[値]Value 説明Description **/*
任意のサブディレクトリ内のすべてのファイル。All files in any subdirectory. dir/\**/*
dir/\**/*
' Dir/' の下のすべてのサブディレクトリにあるすべてのファイル。All files in any subdirectory under 'dir/'. - 相対パス。Relative paths.
[値]Value 説明Description ../shared/\*
../shared/\*
兄弟レベルで "shared" という名前のすべてのファイルが、に指定された基本ディレクトリに渡され Execute(DirectoryInfoBase) ます。All files in a diretory named "shared" at the sibling level to the base directory given to Execute(DirectoryInfoBase).
コンストラクター
Matcher() |
大文字と小文字を区別しない一致を使用して Matcher のインスタンスを初期化します。Initializes an instance of Matcher using case-insensitive matching. |
Matcher(StringComparison) |
指定された文字列比較メソッドを使用して、Matcher のインスタンスを初期化します。Initializes an instance of Matcher using the string comparsion method specified. |
メソッド
AddExclude(String) |
マッチャーによって結果から除外される必要があるファイルのファイル名パターンを追加します。Add a file name pattern for files the matcher should exclude from the results. パターンは、Execute(DirectoryInfoBase) が呼び出されたときに指定されたルート ディレクトリを基準にしています。Patterns are relative to the root directory given when Execute(DirectoryInfoBase) is called. ディレクトリの区切り記号を表すには、スラッシュ '/' を使用します。Use the forward slash '/' to represent directory separator. ファイル名およびディレクトリ名でワイルドカードを表すには、'\*' を使用します。Use '\*' to represent wildcards in file and directory names. 任意のディレクトリの深さを表すには、'\*\*' を使用します。Use '\*\*' to represent arbitrary directory depth. 親ディレクトリを表すには、'..'Use '..' を使用します。to represent a parent directory. |
AddInclude(String) |
ファイルを検出する場合にマッチャーによって使用される必要があるファイル名のパターンを追加します。Add a file name pattern that the matcher should use to discover files. パターンは、Execute(DirectoryInfoBase) が呼び出されたときに指定されたルート ディレクトリを基準にしています。Patterns are relative to the root directory given when Execute(DirectoryInfoBase) is called. ディレクトリの区切り記号を表すには、スラッシュ '/' を使用します。Use the forward slash '/' to represent directory separator. ファイル名およびディレクトリ名でワイルドカードを表すには、'\*' を使用します。Use '\*' to represent wildcards in file and directory names. 任意のディレクトリの深さを表すには、'\*\*' を使用します。Use '\*\*' to represent arbitrary directory depth. 親ディレクトリを表すには、'..'Use '..' を使用します。to represent a parent directory. |
Equals(Object) |
指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。Determines whether the specified object is equal to the current object. (継承元 Object) |
Execute(DirectoryInfoBase) |
Matcher のこのインスタンスに追加されたパターンに一致するすべてのファイルを、指定されたディレクトリ内で検索しますSearches the directory specified for all files matching patterns added to this instance of Matcher |
GetHashCode() |
既定のハッシュ関数として機能します。Serves as the default hash function. (継承元 Object) |
GetType() |
現在のインスタンスの Type を取得します。Gets the Type of the current instance. (継承元 Object) |
MemberwiseClone() |
現在の Object の簡易コピーを作成します。Creates a shallow copy of the current Object. (継承元 Object) |
ToString() |
現在のオブジェクトを表す文字列を返します。Returns a string that represents the current object. (継承元 Object) |
拡張メソッド
AddExcludePatterns(Matcher, IEnumerable<String>[]) |
複数の exclude パターンを Matcher に追加します。Adds multiple exclude patterns to Matcher. |
AddIncludePatterns(Matcher, IEnumerable<String>[]) |
Matcher に含める複数のパターンを追加します。Adds multiple patterns to include in Matcher. |
GetResultsInFullPath(Matcher, String) |
Matcher のこのインスタンスに追加されたパターンに一致するすべてのファイルを、指定されたディレクトリ内で検索します。Searches the specified directory for all files matching patterns added to this instance of Matcher. |
Match(Matcher, IEnumerable<String>) |
ディスクに移動することなく、渡されたファイルをマッチャー内のパターンと照合します。Matches the files passed in with the patterns in the matcher without going to disk. |
Match(Matcher, String) |
ディスクに移動することなく、渡されたファイルをマッチャー内のパターンと照合します。Matches the file passed in with the patterns in the matcher without going to disk. |
Match(Matcher, String, IEnumerable<String>) |
ディスクに移動することなく、渡されたファイルをマッチャー内のパターンと照合します。Matches the files passed in with the patterns in the matcher without going to disk. |
Match(Matcher, String, String) |
ディスクに移動することなく、渡されたファイルをマッチャー内のパターンと照合します。Matches the file passed in with the patterns in the matcher without going to disk. |