仿真平台内核初版 -tlib库 包含<sparc arm riscv powerPC>
This commit is contained in:
25
lib/options-parser/Description/AliasAttribute.cs
Normal file
25
lib/options-parser/Description/AliasAttribute.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
|
||||
namespace Antmicro.OptionsParser
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = true)]
|
||||
public class AliasAttribute : Attribute
|
||||
{
|
||||
public AliasAttribute(string longName)
|
||||
{
|
||||
LongName = longName;
|
||||
}
|
||||
|
||||
// This is needed to enable the reflection api to return all instances of the attribute
|
||||
public override object TypeId
|
||||
{
|
||||
get
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public string LongName { get; private set; }
|
||||
}
|
||||
}
|
||||
|
||||
15
lib/options-parser/Description/DelimiterAttribute.cs
Normal file
15
lib/options-parser/Description/DelimiterAttribute.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
|
||||
namespace Antmicro.OptionsParser
|
||||
{
|
||||
public class DelimiterAttribute : Attribute
|
||||
{
|
||||
public DelimiterAttribute(char delimiter)
|
||||
{
|
||||
Delimiter = delimiter;
|
||||
}
|
||||
|
||||
public char Delimiter { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
16
lib/options-parser/Description/DescriptionAttribute.cs
Normal file
16
lib/options-parser/Description/DescriptionAttribute.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
|
||||
namespace Antmicro.OptionsParser
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
|
||||
public class DescriptionAttribute : Attribute
|
||||
{
|
||||
public DescriptionAttribute(string description)
|
||||
{
|
||||
Value = description;
|
||||
}
|
||||
|
||||
public string Value { get; private set; }
|
||||
}
|
||||
}
|
||||
|
||||
9
lib/options-parser/Description/HideAttribute.cs
Normal file
9
lib/options-parser/Description/HideAttribute.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
|
||||
namespace Antmicro.OptionsParser
|
||||
{
|
||||
public class HideAttribute : Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
26
lib/options-parser/Description/NameAttribute.cs
Normal file
26
lib/options-parser/Description/NameAttribute.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
|
||||
namespace Antmicro.OptionsParser
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
|
||||
public class NameAttribute : Attribute
|
||||
{
|
||||
public NameAttribute(char shortName) : this (shortName, null)
|
||||
{
|
||||
}
|
||||
|
||||
public NameAttribute(string longName) : this(Tokenizer.NullCharacter, longName)
|
||||
{
|
||||
}
|
||||
|
||||
public NameAttribute(char shortName, string longName)
|
||||
{
|
||||
ShortName = shortName;
|
||||
LongName = longName;
|
||||
}
|
||||
|
||||
public char ShortName { get; private set; }
|
||||
public string LongName { get; private set; }
|
||||
}
|
||||
}
|
||||
|
||||
15
lib/options-parser/Description/NumberOfElementsAttribute.cs
Normal file
15
lib/options-parser/Description/NumberOfElementsAttribute.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
|
||||
namespace Antmicro.OptionsParser
|
||||
{
|
||||
public class NumberOfElementsAttribute : Attribute
|
||||
{
|
||||
public NumberOfElementsAttribute(int max)
|
||||
{
|
||||
Max = max;
|
||||
}
|
||||
|
||||
public int Max { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
|
||||
namespace Antmicro.OptionsParser
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
|
||||
public class PositionalArgumentAttribute : Attribute
|
||||
{
|
||||
public PositionalArgumentAttribute(int position)
|
||||
{
|
||||
Position = position;
|
||||
}
|
||||
|
||||
public int Position { get; private set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user