BadScript 2
Loading...
Searching...
No Matches
CommandLine.TokenError Class Referenceabstract

Base type of all errors related to bad token detection. More...

Inheritance diagram for CommandLine.TokenError:
CommandLine.Error CommandLine.BadFormatTokenError CommandLine.BadVerbSelectedError CommandLine.UnknownOptionError

Public Member Functions

bool Equals (TokenError other)
 Returns a value that indicates whether the current instance and a specified CommandLine.TokenError 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.
 
- Public Member Functions inherited from CommandLine.Error
bool Equals (Error other)
 Returns a value that indicates whether the current instance and a specified CommandLine.Error 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

 TokenError (ErrorType tag, string token)
 Initializes a new instance of the CommandLine.TokenError class.
 
- Package Functions inherited from CommandLine.Error
 Error (ErrorType tag, bool stopsProcessing)
 Initializes a new instance of the CommandLine.Error class.
 
 Error (ErrorType tag)
 Initializes a new instance of the CommandLine.Error class.
 

Properties

string Token [get]
 The string containing the token text.
 
- Properties inherited from CommandLine.Error
ErrorType Tag [get]
 Error type discriminator, defined as CommandLine.ErrorType enumeration.
 
bool StopsProcessing [get]
 Tells if error stops parsing process. Filtered by CommandLine.ErrorExtensions.OnlyMeaningfulOnes(System.Collections.Generic.IEnumerable<Error>).
 

Detailed Description

Base type of all errors related to bad token detection.

Definition at line 201 of file Error.cs.

Constructor & Destructor Documentation

◆ TokenError()

CommandLine.TokenError.TokenError ( ErrorType  tag,
string  token 
)
package

Initializes a new instance of the CommandLine.TokenError class.

Parameters
tagError type.
tokenProblematic token.

Definition at line 208 of file Error.cs.

209 : base(tag)
210 {
211 if (token == null)
212 {
213 throw new ArgumentNullException("token");
214 }
215
216 Token = token;
217 }
string Token
The string containing the token text.
Definition Error.cs:222

Member Function Documentation

◆ Equals() [1/2]

override bool CommandLine.TokenError.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 260 of file Error.cs.

261 {
262 TokenError other = obj as TokenError;
263
264 if (other != null)
265 {
266 return Equals(other);
267 }
268
269 return base.Equals(obj);
270 }
TokenError(ErrorType tag, string token)
Initializes a new instance of the CommandLine.TokenError class.
Definition Error.cs:208
bool Equals(TokenError other)
Returns a value that indicates whether the current instance and a specified CommandLine....
Definition Error.cs:238

◆ Equals() [2/2]

bool CommandLine.TokenError.Equals ( TokenError  other)

Returns a value that indicates whether the current instance and a specified CommandLine.TokenError have the same value.

Parameters
otherThe CommandLine.TokenError instance to compare.
Returns
true

if this instance of CommandLine.TokenError and other have the same value; otherwise,

false

Definition at line 238 of file Error.cs.

239 {
240 if (other == null)
241 {
242 return false;
243 }
244
245 return Tag.Equals(other.Tag) && Token.Equals(other.Token);
246 }
ErrorType Tag
Error type discriminator, defined as CommandLine.ErrorType enumeration.
Definition Error.cs:132

◆ GetHashCode()

override int CommandLine.TokenError.GetHashCode ( )

Serves as a hash function for a particular type.

A hash code for the current System.Object.

Definition at line 276 of file Error.cs.

277 {
278 return new { Tag, StopsProcessing, Token }.GetHashCode();
279 }
bool StopsProcessing
Tells if error stops parsing process. Filtered by CommandLine.ErrorExtensions.OnlyMeaningfulOnes(Syst...
Definition Error.cs:139

Property Documentation

◆ Token

string CommandLine.TokenError.Token
get

The string containing the token text.

Definition at line 222 of file Error.cs.

222{ get; }

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