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 CandidateFileContext

Constructors

NameDescription
CandidateFileContext(ReadOnlySpan<char>, ReadOnlySpan<char>, ReadOnlySpan<char>)

CandidateFileContext(ReadOnlySpan<char>, ReadOnlySpan<char>, ReadOnlySpan<char>)

CandidateFileContext.cs
public CandidateFileContext(ReadOnlySpan<char> rootDirectory, ReadOnlySpan<char> directory, ReadOnlySpan<char> fileName)

Parameters

rootDirectory ReadOnlySpan<char>
directory ReadOnlySpan<char>
fileName ReadOnlySpan<char>

No documentation is available.

Properties

NameDescription
DirectoryGets the directory path containing the file.
FileNameGets the file name without the directory path.
RelativeDirectoryGets the directory path relative to the root directory, or an empty span when the directory is not under the root directory.
RootDirectoryGets the root directory path of the scan operation.

Gets the directory path containing the file.

public ReadOnlySpan<char> Directory { get; }

Property value

ReadOnlySpan<char>

Gets the file name without the directory path.

public ReadOnlySpan<char> FileName { get; }

Property value

ReadOnlySpan<char>

RelativeDirectory

CandidateFileContext.cs

Gets 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

ReadOnlySpan<char>

Gets the root directory path of the scan operation.

public ReadOnlySpan<char> RootDirectory { get; }

Property value

ReadOnlySpan<char>

Methods

NameDescription
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.cs

Determines whether the file has any of the specified extensions.

public bool HasExtension(ReadOnlySpan<string> extensions, bool ignoreCase)
Parameters
extensions ReadOnlySpan<string>
The collection of extensions to check (each including the leading dot).
ignoreCase bool
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.cs

Determines whether the file has the specified extension.

public bool HasExtension(string extension, bool ignoreCase)
Parameters
extension string
The extension to check (including the leading dot).
ignoreCase bool
Whether to perform a case-insensitive comparison.
Returns

bool true if the file has the specified extension; otherwise, false.

HasFileName(string, bool)

CandidateFileContext.cs

Determines whether the file name matches the specified value.

public bool HasFileName(string fileName, bool ignoreCase)

Parameters

fileName string
The file name to compare.
ignoreCase bool
Whether to perform a case-insensitive comparison.

Returns

bool true if the file names match; otherwise, false.