Class LocalSpec
- Namespace
- AsmLocator
- Assembly
- AsmLocator.dll
Describes constraints used to match a CIL local variable.
public sealed record LocalSpec : IEquatable<LocalSpec>
- Inheritance
-
LocalSpec
- Implements
- Inherited Members
Constructors
LocalSpec()
public LocalSpec()
Properties
Index
The zero-based index within the parameter or local-variable collection.
public int? Index { get; init; }
Property Value
- int?
VariableType
The local variable type full-name matcher.
public StringMatcher? VariableType { get; init; }
Property Value
Where
An optional custom predicate applied after the built-in constraints.
public Func<CilLocalVariable, bool>? Where { get; init; }
Property Value
Methods
At(int)
Creates a specification constrained by a zero-based index.
public static LocalSpec At(int index)
Parameters
indexintThe zero-based local-variable index.
Returns
- LocalSpec
A new specification with the described constraints.
Equals(LocalSpec?)
public bool Equals(LocalSpec? other)
Parameters
otherLocalSpec
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
Matches(CilLocalVariable)
Returns whether the supplied candidate satisfies all constraints configured in this specification.
public bool Matches(CilLocalVariable local)
Parameters
localCilLocalVariableThe candidate CIL local variable.
Returns
OfType(StringMatcher)
Creates a specification constrained by the full name of a type.
public static LocalSpec OfType(StringMatcher type)
Parameters
typeStringMatcherThe local variable type full-name matcher.
Returns
- LocalSpec
A new specification with the described constraints.
ToString()
Returns a readable representation of this object.
public override string ToString()
Returns
- string
A readable description.
Operators
operator ==(LocalSpec?, LocalSpec?)
public static bool operator ==(LocalSpec? left, LocalSpec? right)
Parameters
Returns
implicit operator LocalSpec(string)
Converts a string into a LocalSpec that matches the local type full name.
public static implicit operator LocalSpec(string type)
Parameters
typestringThe local variable type full-name matcher.
Returns
- LocalSpec
The specification created from the supplied string.
operator !=(LocalSpec?, LocalSpec?)
public static bool operator !=(LocalSpec? left, LocalSpec? right)