Click or drag to resize

Parser Class

Parser for command line arguments. The parser specification is infered from the instance fields of the object specified as the destination of the parse. Valid argument types are: int, uint, string, bool, enums Also argument types of Array of the above types are also valid. Error checking options can be controlled by adding a ArgumentAttribute to the instance fields of the destination object. At most one field may be marked with the DefaultArgumentAttribute indicating that arguments without a '-' or '/' prefix will be parsed as that argument. If not specified then the parser will infer default options for parsing each instance field. The default long name of the argument is the field name. The default short name is the first character of the long name. Long names and explicitly specified short names must be unique. Default short names will be used provided that the default short name does not conflict with a long name or an explicitly specified short name. Arguments which are array types are collection arguments. Collection arguments can be specified multiple times.
Inheritance Hierarchy
SystemObject
  PDTec.IceNet.Sdk.Utils.CommandLineParser

Namespace:  PDTec.IceNet.Sdk.Utils.CommandLine
Assembly:  PDTec.IceNet.Sdk (in PDTec.IceNet.Sdk.dll) Version: 7.2.0.0 (7.2.7583.15464)
Syntax
C#
public sealed class Parser

The Parser type exposes the following members.

Constructors
  NameDescription
Public methodParser
Creates a new command line argument parser.
Top
Properties
  NameDescription
Public propertyHasDefaultArgument
Does this parser have a default argument.
Top
Methods
  NameDescription
Public methodStatic memberArgumentsUsage(Type)
Returns a Usage string for command line argument parsing. Use ArgumentAttributes to control parsing behaviour. Formats the output to the width of the current console window.
Public methodStatic memberArgumentsUsage(Type, Int32)
Returns a Usage string for command line argument parsing. Use ArgumentAttributes to control parsing behaviour.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodStatic memberGetConsoleWindowWidth
Returns the number of columns in the current console window
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetUsageString
A user firendly usage string describing the command line argument syntax.
Public methodStatic memberIndexOf
Searches a StringBuilder for a character
Public methodStatic memberLastIndexOf
Searches a StringBuilder for a character in reverse
Public methodParse
Parses an argument list.
Public methodStatic memberParseArguments(String, Object)
Parses Command Line Arguments. Errors are output on Console.Error. Use ArgumentAttributes to control parsing behaviour.
Public methodStatic memberParseArguments(String, Object, ErrorReporter)
Parses Command Line Arguments. Use ArgumentAttributes to control parsing behaviour.
Public methodStatic memberParseArgumentsWithUsage
Parses Command Line Arguments. Displays usage message to Console.Out if /?, /help or invalid arguments are encounterd. Errors are output on Console.Error. Use ArgumentAttributes to control parsing behaviour.
Public methodStatic memberParseHelp
Checks if a set of arguments asks for help.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Fields
  NameDescription
Public fieldStatic memberNewLine
The System Defined new line string.
Top
See Also