YArgument
|
public sealed class YArgumentParser
The YArgumentParser type exposes the following members.
| Name | Description | |
|---|---|---|
| YArgumentParser(String) |
Create a new argument parser engine from an argument string.
C# YArgumentParser argumentParser = new YArgumentParser("\"First value of the main argument\" \"Second value of the main argument\" -s source /d destination -readonly");
| |
| YArgumentParser(String) |
Create a new argument parser engine from an argument list.
C# YArgumentParser argumentParser = new YArgumentParser(new string[] { "First value of the main argument", "Second value of the main argument", "-s", "source", "/d", "destination", "-readonly" });
|
| Name | Description | |
|---|---|---|
| Args | Get the argument list as a list of string. | |
| ArgsLine | Get the argument list as a string line. | |
| Arguments | Get the list of YArgument parsed by the engine. | |
| ItemEnum | Get a YArgument from the argName or null if the given param is not found. | |
| ItemInt32 | Get the string argument at the given index. | |
| ItemString | Get a YArgument from the argName or null if the given param is not found. |
| Name | Description | |
|---|---|---|
| ArgumentIsSet(String) |
Check if the argName is set as a boolean.
C# YArgumentParser argumentParser = new YArgumentParser(new string[] { "First value of the main argument", "Second value of the main argument", "-s", "source", "/d", "destination", "-readonly" });
| |
| ArgumentIsSetT(T) |
Check if the argName is set as a boolean.
C# enum ArumentsTypes { main = 0, s, m, readonly, } YArgumentParser argumentParser = new YArgumentParser(new string[] { "First value of the main argument", "Second value of the main argument", "-s", "source", "/d", "destination", "-readonly" });
| |
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) | |
| GetArgument(String) |
Get a YArgument from the argName. Throw a KeyNotFoundException if the given param is not found.
C# YArgumentParser argumentParser = new YArgumentParser(new string[] { "First value of the main argument", "Second value of the main argument", "-s", "source", "/d", "destination", "-readonly" }); YArgument argument = argumentParser.GetArgument("s"); YArgument mainArgument = argumentParser.GetArgument(string.Empty); YArgument nullArgument = argumentParser.GetArgument("m");
| |
| GetArgumentT(T) |
Get a YArgument from the argName. Throw a KeyNotFoundException if the given param is not found.
C# enum ArumentsTypes { main = 0, s, m, readonly, } YArgumentParser argumentParser = new YArgumentParser(new string[] { "First value of the main argument", "Second value of the main argument", "-s", "source", "/d", "destination", "-readonly" }); YArgument argument = argumentParser.GetArgument(ArumentsTypes.s); YArgument mainArgument = argumentParser.GetArgument(ArumentsTypes.main); YArgument nullArgument = argumentParser.GetArgument(ArumentsTypes.m);
| |
| GetHashCode | Serves as the default hash function. (Inherited from Object) | |
| GetMainArgument | Get the main YArgument or null if not found. | |
| GetType | Gets the Type of the current instance. (Inherited from Object) | |
| HasArgument(String) |
Check if the argName is set.
C# YArgumentParser argumentParser = new YArgumentParser(new string[] { "First value of the main argument", "Second value of the main argument", "-s", "source", "/d", "destination", "-readonly" });
| |
| HasArgumentT(T) |
Check if the enum value argName is set.
C# enum ArumentsTypes { main = 0, s, m, readonly, } YArgumentParser argumentParser = new YArgumentParser(new string[] { "First value of the main argument", "Second value of the main argument", "-s", "source", "/d", "destination", "-readonly" });
| |
| RegisterArgumentNameSet(String) | Register an Argument name set. | |
| RegisterArgumentNameSetT(T) | Register an Argument name set. | |
| ToString | Returns a string that represents the current object. (Inherited from Object) | |
| TryGetArgument(String) |
Try to get a YArgument from the argName or null if the given param is not found.
C# YArgumentParser argumentParser = new YArgumentParser(new string[] { "First value of the main argument", "Second value of the main argument", "-s", "source", "/d", "destination", "-readonly" }); YArgument argument = argumentParser.GetArgument("s"); YArgument mainArgument = argumentParser.GetArgument(string.Empty); YArgument nullArgument = argumentParser.GetArgument("m");
| |
| TryGetArgumentT(T) |
Try to get a YArgument from the argName or null if the given param is not found.
C# enum ArumentsTypes { main = 0, s, m, readonly, } YArgumentParser argumentParser = new YArgumentParser(new string[] { "First value of the main argument", "Second value of the main argument", "-s", "source", "/d", "destination", "-readonly" }); YArgument argument = argumentParser.GetArgument(ArumentsTypes.s); YArgument mainArgument = argumentParser.GetArgument(ArumentsTypes.main); YArgument nullArgument = argumentParser.GetArgument(ArumentsTypes.m);
|
| Name | Description | |
|---|---|---|
| ArgModifiers |
Get the list of argument modifiers :
|
| Name | Description | |
|---|---|---|
| GetMD5HashCode |
Get the MD5 Hash code of an Objectobj as a string.
(Defined by YObjectExtentionMethods) | |
| SerializeObject |
Serialize an ObjecttoSerialize.
(Defined by YSerializationCenter) |