> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# WdCopySearchOptions

> WdCopySearchOptions

# WdCopySearchOptions

コピー操作のファイルおよびディレクトリのフィルター パターンを指定します。

## 構文

```cpp theme={null}
struct WdCopySearchOptions 
{ 
    const char* includeFilePattern;
    const char* excludeFilePattern;
    const char* excludeDirPattern;
    uint64_t includeFileAttributes;
    uint64_t excludeFileAttributes;
};
```

### メンバー

`_In_z_ includeFilePattern`\
Type: **const char\***

コピー操作に含めるファイルを指定する glob パターン (例: すべてのファイルを含めるには `"*"`、実行可能ファイルと DLL のみを含めるには `"*.exe;*.dll"`)。

`_In_z_ excludeFilePattern`\
Type: **const char\***

コピー操作から除外するファイルを指定する glob パターン (例: デバッグ シンボルを除外するには `"*.pdb"`)。

`_In_z_ excludeDirPattern`\
Type: **const char\***

コピー操作から除外するディレクトリを指定する glob パターン (例: Visual Studio とビルド出力のディレクトリを除外するには `".vs;obj"`)。

`includeFileAttributes`\
Type: **uint64\_t**

コピーに含めるためにファイルが持つ必要のあるファイル属性のビットマスク。属性でフィルタリングしない場合は `0` に設定します。ファイル属性の詳細については、[ファイル属性定数](https://learn.microsoft.com/windows/win32/fileio/file-attribute-constants) を参照してください。

`excludeFileAttributes`\
Type: **uint64\_t**

コピーからファイルを除外させるファイル属性のビットマスク。属性でフィルタリングしない場合は `0` に設定します。ファイル属性の詳細については、[ファイル属性定数](https://learn.microsoft.com/windows/win32/fileio/file-attribute-constants) を参照してください。

## 例

**`.exe` と `.dll` ファイルのみをコピーする:**

```cpp theme={null}
WdCopySearchOptions searchOptions = {
    .includeFilePattern = "*.exe;*.dll",
    .excludeFilePattern = nullptr,
    .excludeDirPattern = nullptr,
    .includeFileAttributes = 0,
    .excludeFileAttributes = 0
};
```

**コピーから `temp` という名前のディレクトリを除外する:**

```cpp theme={null}
WdCopySearchOptions searchOptions = {
    .includeFilePattern = nullptr,
    .excludeFilePattern = nullptr,
    .excludeDirPattern = "temp",
    .includeFileAttributes = 0,
    .excludeFileAttributes = 0
};
```

**読み取り専用ファイルまたはシステム ファイルのみをコピーし、隠しファイルを除外する:**

```cpp theme={null}
WdCopySearchOptions searchOptions = {
    .includeFilePattern = nullptr,
    .excludeFilePattern = nullptr,
    .excludeDirPattern = nullptr,
    .includeFileAttributes = FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM,
    .excludeFileAttributes = FILE_ATTRIBUTE_HIDDEN
};
```

<Note>包含パターンと除外パターンが競合する場合、除外パターンが優先され、そのファイルはコピーされません。</Note>

## 解説

コピー操作に含めるファイルとディレクトリをフィルタリングするには、`searchOptions` パラメーターを介してこの構造体を [WdRemoteCopy](/reference/remoting/functions/wdremotecopy) に渡します。`searchOptions` に `nullptr` を渡した場合、フィルタリングなしですべてのファイルがコピーされます。

## 要件

| 要件                   | 値                   |
| -------------------- | ------------------- |
| **ヘッダー**             | WdRemoteIteration.h |
| **ライブラリ**            | wdremoteapi.lib     |
| **サポートされている OS**     | Windows 11 以降       |
| **サポートされているアーキテクチャ** | x64、ARM64           |

## 関連項目

* [WdRemoteCopy](/reference/remoting/functions/wdremotecopy)
* [XBOX PC Remote Iteration API](/reference/remoting/remoteiteration_members)


## Related topics

- [WdRemoteCopy](/ja-jp/reference/remoting/functions/wdremotecopy.md)
- [XBOX PC Remote Iteration API](/ja-jp/reference/remoting/remoteiteration_members.md)
- [WdCopyOptions](/ja-jp/reference/remoting/structs/wdcopyoptions.md)
- [WdCopyDirection](/ja-jp/reference/remoting/enums/wdcopydirection.md)
- [WdCopyErrorCallback](/ja-jp/reference/remoting/callbacks/wdcopyerrorcallback.md)
