仿真平台内核初版 -tlib库 包含<sparc arm riscv powerPC>
This commit is contained in:
16
lib/options-parser/Validation/DefaultValueAttribute.cs
Normal file
16
lib/options-parser/Validation/DefaultValueAttribute.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
|
||||
namespace Antmicro.OptionsParser
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
|
||||
public class DefaultValueAttribute : Attribute
|
||||
{
|
||||
public DefaultValueAttribute(object value)
|
||||
{
|
||||
DefaultValue = value;
|
||||
}
|
||||
|
||||
public object DefaultValue { get; private set; }
|
||||
}
|
||||
}
|
||||
|
||||
10
lib/options-parser/Validation/IValidatedOptions.cs
Normal file
10
lib/options-parser/Validation/IValidatedOptions.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
|
||||
namespace Antmicro.OptionsParser
|
||||
{
|
||||
public interface IValidatedOptions
|
||||
{
|
||||
bool Validate(out string error);
|
||||
}
|
||||
}
|
||||
|
||||
10
lib/options-parser/Validation/RequiredAttribute.cs
Normal file
10
lib/options-parser/Validation/RequiredAttribute.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
|
||||
namespace Antmicro.OptionsParser
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
|
||||
public class RequiredAttribute : Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
16
lib/options-parser/Validation/ValidationException.cs
Normal file
16
lib/options-parser/Validation/ValidationException.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
|
||||
namespace Antmicro.OptionsParser
|
||||
{
|
||||
public class ValidationException : Exception
|
||||
{
|
||||
public ValidationException()
|
||||
{
|
||||
}
|
||||
|
||||
public ValidationException(string errorMessage) : base(errorMessage)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user