Table of Contents

Class FilePathGuard

Namespace
ProjGraph.Lib.Core.Abstractions
Assembly
ProjGraph.Lib.Core.dll

Provides common file path validation methods.

public static class FilePathGuard
Inheritance
FilePathGuard
Inherited Members

Fields

CSharpExtension

The .cs file extension.

public const string CSharpExtension = ".cs"

Field Value

string

CSharpFilesPattern

The glob pattern for C# source files (*.cs).

public const string CSharpFilesPattern = "*.cs"

Field Value

string

Methods

RequireCsFile(string, string)

Validates that the given path has a .cs file extension (case-insensitive).

public static void RequireCsFile(string path, string paramName = "path")

Parameters

path string

The file path to validate.

paramName string

The parameter name to include in the exception.

Exceptions

ArgumentException

Thrown when path does not end with .cs.