BadScript 2
Loading...
Searching...
No Matches
CommandLine.NotParsed< T > Class Template Referencesealed

It contains a sequence of CommandLine.Error. More...

Inheritance diagram for CommandLine.NotParsed< T >:
CommandLine.ParserResult< T >

Public Member Functions

bool Equals (NotParsed< T > other)
 Returns a value that indicates whether the current instance and a specified CommandLine.NotParsed<T> have the same value.
 
override bool Equals (object obj)
 Determines whether the specified System.Object is equal to the current System.Object.
 
override int GetHashCode ()
 Serves as a hash function for a particular type.
 

Package Functions

 NotParsed (TypeInfo typeInfo, IEnumerable< Error > errors)
 
- Package Functions inherited from CommandLine.ParserResult< T >
 ParserResult (IEnumerable< Error > errors, TypeInfo typeInfo)
 
 ParserResult (T value, TypeInfo typeInfo)
 

Additional Inherited Members

- Properties inherited from CommandLine.ParserResult< T >
ParserResultType Tag [get]
 Parser result type discriminator, defined as CommandLine.ParserResultType enumeration.
 
TypeInfo TypeInfo [get]
 
Value [get]
 Gets the instance with parsed values. If one or more errors occures, default is returned.
 
IEnumerable< ErrorErrors [get]
 Gets the sequence of parsing errors. If there are no errors, then an empty IEnumerable is returned.
 

Detailed Description

It contains a sequence of CommandLine.Error.

Template Parameters
TThe type with attributes that define the syntax of parsing rules.

Definition at line 165 of file ParserResult.cs.

Constructor & Destructor Documentation

◆ NotParsed()

CommandLine.NotParsed< T >.NotParsed ( TypeInfo  typeInfo,
IEnumerable< Error errors 
)
package

Definition at line 167 of file ParserResult.cs.

168 : base(errors, typeInfo) { }

Member Function Documentation

◆ Equals() [1/2]

bool CommandLine.NotParsed< T >.Equals ( NotParsed< T >  other)

Returns a value that indicates whether the current instance and a specified CommandLine.NotParsed<T> have the same value.

Parameters
otherThe CommandLine.NotParsed<T> instance to compare.
Returns
true

if this instance of CommandLine.NotParsed<T> and other have the same value; otherwise,

false

Definition at line 184 of file ParserResult.cs.

185 {
186 if (other == null)
187 {
188 return false;
189 }
190
191 return Tag.Equals(other.Tag) && Errors.SequenceEqual(other.Errors);
192 }
IEnumerable< Error > Errors
Gets the sequence of parsing errors. If there are no errors, then an empty IEnumerable is returned.
ParserResultType Tag
Parser result type discriminator, defined as CommandLine.ParserResultType enumeration.

◆ Equals() [2/2]

override bool CommandLine.NotParsed< T >.Equals ( object  obj)

Determines whether the specified System.Object is equal to the current System.Object.

Parameters
objThe System.Object to compare with the current System.Object.
Returns
true

if the specified System.Object is equal to the current System.Object; otherwise,

false

Definition at line 207 of file ParserResult.cs.

208 {
209 if (obj is NotParsed<T> other)
210 {
211 return Equals(other);
212 }
213
214 return base.Equals(obj);
215 }
bool Equals(NotParsed< T > other)
Returns a value that indicates whether the current instance and a specified CommandLine....

◆ GetHashCode()

override int CommandLine.NotParsed< T >.GetHashCode ( )

Serves as a hash function for a particular type.

A hash code for the current System.Object.

Definition at line 221 of file ParserResult.cs.

222 {
223 return new { Tag, Errors }.GetHashCode();
224 }

The documentation for this class was generated from the following file: