CandidateFileContext Struct
- Obsolete: Types with embedded references are not supported in this version of your compiler.
Provides context information about a candidate file during the scanning process.
[Obsolete("Types with embedded references are not supported in this version of your compiler.", true)]
public readonly ref struct CandidateFileContextConstructors
| Name | Description |
|---|---|
| CandidateFileContext(ReadOnlySpan<char>, ReadOnlySpan<char>, ReadOnlySpan<char>) |
CandidateFileContext(ReadOnlySpan<char>, ReadOnlySpan<char>, ReadOnlySpan<char>)
CandidateFileContext.cspublic CandidateFileContext(ReadOnlySpan<char> rootDirectory, ReadOnlySpan<char> directory, ReadOnlySpan<char> fileName)Parameters
rootDirectoryReadOnlySpan<char>directoryReadOnlySpan<char>fileNameReadOnlySpan<char>
No documentation is available.
Properties
| Name | Description |
|---|---|
| Directory | Gets the directory path containing the file. |
| FileName | Gets the file name without the directory path. |
| RelativeDirectory | Gets the directory path relative to the root directory, or an empty span when the directory is not under the root directory. |
| RootDirectory | Gets the root directory path of the scan operation. |
Directory
CandidateFileContext.csGets the directory path containing the file.
public ReadOnlySpan<char> Directory { get; }Property value
FileName
CandidateFileContext.csGets the file name without the directory path.
public ReadOnlySpan<char> FileName { get; }Property value
RelativeDirectory
CandidateFileContext.csGets the directory path relative to the root directory, or an empty span when the directory is not under the root directory.
public ReadOnlySpan<char> RelativeDirectory { get; }Property value
RootDirectory
CandidateFileContext.csGets the root directory path of the scan operation.
public ReadOnlySpan<char> RootDirectory { get; }Property value
Methods
| Name | Description |
|---|---|
| HasExtension(ReadOnlySpan<string>, bool) | Determines whether the file has any of the specified extensions. |
| HasExtension(string, bool) | Determines whether the file has the specified extension. |
| HasFileName(string, bool) | Determines whether the file name matches the specified value. |
HasExtension overloads
HasExtension(ReadOnlySpan<string>, bool)
CandidateFileContext.csDetermines whether the file has any of the specified extensions.
public bool HasExtension(ReadOnlySpan<string> extensions, bool ignoreCase)Parameters
extensionsReadOnlySpan<string>- The collection of extensions to check (each including the leading dot).
ignoreCasebool- Whether to perform a case-insensitive comparison.
Returns
bool true if the file has any of the specified extensions; otherwise, false.
HasExtension(string, bool)
CandidateFileContext.csDetermines whether the file has the specified extension.