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

It contains an instance of type T with parsed values. More...

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

Public Member Functions

bool Equals (Parsed< T > other)
 Returns a value that indicates whether the current instance and a specified CommandLine.Parsed<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

 Parsed (T value, TypeInfo typeInfo)
 
 Parsed (T value)
 
- 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 an instance of type T with parsed values.

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

Definition at line 96 of file ParserResult.cs.

Constructor & Destructor Documentation

◆ Parsed() [1/2]

CommandLine.Parsed< T >.Parsed ( value,
TypeInfo  typeInfo 
)
package

Definition at line 98 of file ParserResult.cs.

99 : base(value, typeInfo) { }

◆ Parsed() [2/2]

CommandLine.Parsed< T >.Parsed ( value)
package

Definition at line 101 of file ParserResult.cs.

102 : this(value, TypeInfo.Create(value.GetType())) { }
static TypeInfo Create(Type current)

Member Function Documentation

◆ Equals() [1/2]

override bool CommandLine.Parsed< 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 141 of file ParserResult.cs.

142 {
143 if (obj is Parsed<T> other)
144 {
145 return Equals(other);
146 }
147
148 return base.Equals(obj);
149 }
bool Equals(Parsed< T > other)
Returns a value that indicates whether the current instance and a specified CommandLine....

◆ Equals() [2/2]

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

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

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

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

false

Definition at line 118 of file ParserResult.cs.

119 {
120 if (other == null)
121 {
122 return false;
123 }
124
125 return Tag.Equals(other.Tag) && Value.Equals(other.Value);
126 }
ParserResultType Tag
Parser result type discriminator, defined as CommandLine.ParserResultType enumeration.
T Value
Gets the instance with parsed values. If one or more errors occures, default is returned.

◆ GetHashCode()

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

Serves as a hash function for a particular type.

A hash code for the current System.Object.

Definition at line 155 of file ParserResult.cs.

156 {
157 return new { Tag, Value }.GetHashCode();
158 }

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