|
| Option (string prototype, string description) |
|
| Option (string prototype, string description, int maxValueCount) |
|
| Option (string prototype, string description, int maxValueCount, bool hidden) |
|
abstract void | OnParseComplete (OptionContext c) |
|
|
static void | AddSeparators (string name, int end, ICollection< string > seps) |
|
Definition at line 450 of file Options.cs.
Ntp.Common.IO.Option.Option |
( |
string |
prototype, |
|
|
string |
description |
|
) |
| |
|
inlineprotected |
Definition at line 452 of file Options.cs.
453 :
this(prototype, description, 1,
false)
Ntp.Common.IO.Option.Option |
( |
string |
prototype, |
|
|
string |
description, |
|
|
int |
maxValueCount |
|
) |
| |
|
inlineprotected |
Definition at line 457 of file Options.cs.
458 :
this(prototype, description, maxValueCount,
false)
Ntp.Common.IO.Option.Option |
( |
string |
prototype, |
|
|
string |
description, |
|
|
int |
maxValueCount, |
|
|
bool |
hidden |
|
) |
| |
|
inlineprotected |
Definition at line 463 of file Options.cs.
465 if (prototype == null)
466 throw new ArgumentNullException(nameof(prototype));
467 if (prototype.Length == 0)
468 throw new ArgumentException(
"Cannot be the empty string.", nameof(prototype));
469 if (maxValueCount < 0)
470 throw new ArgumentOutOfRangeException(nameof(maxValueCount));
475 Names =
this is OptionSet.Category
479 ?
new[] {prototype + GetHashCode()}
480 : prototype.Split(
'|');
482 if (
this is OptionSet.Category)
489 throw new ArgumentException(
490 "Cannot provide maxValueCount of 0 for OptionValueType.Required or " +
491 "OptionValueType.Optional.",
492 nameof(maxValueCount));
495 throw new ArgumentException(
496 $
"Cannot provide maxValueCount of {maxValueCount} for OptionValueType.None.",
497 nameof(maxValueCount));
499 if (Array.IndexOf(
Names,
"<>") >= 0 &&
502 throw new ArgumentException(
503 "The default option handler '<>' cannot require values.",
OptionValueType ParsePrototype()
OptionValueType OptionValueType
static void Ntp.Common.IO.Option.AddSeparators |
( |
string |
name, |
|
|
int |
end, |
|
|
ICollection< string > |
seps |
|
) |
| |
|
inlinestaticprivate |
Definition at line 582 of file Options.cs.
585 for (var i = end + 1; i < name.Length; ++i)
591 throw new ArgumentException($
"Ill-formed name/value separator found in \"{name}\".");
596 throw new ArgumentException($
"Ill-formed name/value separator found in \"{name}\".");
597 seps.Add(name.Substring(start, i - start));
608 throw new ArgumentException($
"Ill-formed name/value separator found in \"{name}\".");
override string ToString()
string [] Ntp.Common.IO.Option.GetNames |
( |
| ) |
|
|
inline |
string [] Ntp.Common.IO.Option.GetValueSeparators |
( |
| ) |
|
|
inline |
Definition at line 528 of file Options.cs.
531 return new string[0];
abstract void Ntp.Common.IO.Option.OnParseComplete |
( |
OptionContext |
c | ) |
|
|
protectedpure virtual |
static T Ntp.Common.IO.Option.Parse< T > |
( |
string |
value, |
|
|
OptionContext |
c |
|
) |
| |
|
inlinestaticprotected |
Definition at line 611 of file Options.cs.
614 var seps =
new List<string>();
616 for (var i = 0; i <
Names.Length; ++i)
619 if (name.Length == 0)
620 throw new ArgumentException(
"Empty option names are not supported.");
625 Names[i] = name.Substring(0, end);
626 if (type ==
'\0' || type == name[end])
629 throw new ArgumentException($
"Conflicting option types: '{type}' vs. '{name[end]}'.");
637 throw new ArgumentException(
638 $
"Cannot provide key/value separators for Options taking {MaxValueCount} value(s).");
644 else if (seps.Count == 1 && seps[0].Length == 0)
static readonly char[] NameTerminator
OptionValueType OptionValueType
static void AddSeparators(string name, int end, ICollection< string > seps)
override string Ntp.Common.IO.Option.ToString |
( |
| ) |
|
|
inline |
readonly char [] Ntp.Common.IO.Option.NameTerminator = {'=', ':'} |
|
staticprivate |
string Ntp.Common.IO.Option.Description |
|
get |
bool Ntp.Common.IO.Option.Hidden |
|
get |
int Ntp.Common.IO.Option.MaxValueCount |
|
get |
string [] Ntp.Common.IO.Option.Names |
|
getpackage |
string Ntp.Common.IO.Option.Prototype |
|
get |
string [] Ntp.Common.IO.Option.ValueSeparators |
|
getprivate setpackage |
The documentation for this class was generated from the following file: