- more refactoring.cleanup of the generated XML parsing
- Reworked SemanticVersion to use Sprache parsers since Sprache is already being used in parsing nonconformant XML docs - Added additional tests for SemanticVersion
This commit is contained in:
Родитель
c7476ae3db
Коммит
7cba1becf8
|
@ -57,18 +57,15 @@
|
|||
<Compile Include="Interfaces.cs" />
|
||||
<Compile Include="PackDescription\AlgorithmType.cs" />
|
||||
<Compile Include="PackDescription\ApiType.cs" />
|
||||
<Compile Include="PackDescription\BoardBookCategoryEnum.cs" />
|
||||
<Compile Include="PackDescription\BoardFeatureType.cs" />
|
||||
<Compile Include="PackDescription\BoardReferenceType.cs" />
|
||||
<Compile Include="PackDescription\BoardsBookType.cs" />
|
||||
<Compile Include="PackDescription\BoardsDeviceType.cs" />
|
||||
<Compile Include="PackDescription\BoardType.cs" />
|
||||
<Compile Include="PackDescription\BoardTypeImage.cs" />
|
||||
<Compile Include="PackDescription\BoardFeature.cs" />
|
||||
<Compile Include="PackDescription\BoardReference.cs" />
|
||||
<Compile Include="PackDescription\BoardBook.cs" />
|
||||
<Compile Include="PackDescription\BoardsDevice.cs" />
|
||||
<Compile Include="PackDescription\Board.cs" />
|
||||
<Compile Include="PackDescription\BoardImage.cs" />
|
||||
<Compile Include="PackDescription\BookType.cs" />
|
||||
<Compile Include="PackDescription\Bundle.cs" />
|
||||
<Compile Include="PackDescription\CompatibleDeviceType.cs" />
|
||||
<Compile Include="PackDescription\CompilerEnumType.cs" />
|
||||
<Compile Include="PackDescription\CompilerOutputType.cs" />
|
||||
<Compile Include="PackDescription\CompileType.cs" />
|
||||
<Compile Include="PackDescription\ComponenOrBundleGroup.cs" />
|
||||
<Compile Include="PackDescription\Component.cs" />
|
||||
|
@ -84,6 +81,7 @@
|
|||
<Compile Include="PackDescription\DeviceFeatureType.cs" />
|
||||
<Compile Include="PackDescription\DeviceType.cs" />
|
||||
<Compile Include="PackDescription\DeviceTypeVariant.cs" />
|
||||
<Compile Include="PackDescription\DeviceVendor.cs" />
|
||||
<Compile Include="PackDescription\Enumerations.cs" />
|
||||
<Compile Include="PackDescription\EnvironmentType.cs" />
|
||||
<Compile Include="PackDescription\ExampleAttributesType.cs" />
|
||||
|
|
|
@ -93,23 +93,39 @@ namespace CMSIS.Pack
|
|||
/// <summary>Location of the locally installed packs that updates and new packs are installed into</summary>
|
||||
string LocalPath { get; }
|
||||
|
||||
/// <summary>Last time the repository's index was updated</summary>
|
||||
DateTime LastUpdatedTimeUTC { get; }
|
||||
/// <summary>Full path to the local ".Web" folder containing the pack descriptions cached from the web source</summary>
|
||||
|
||||
/// <summary>Full path to the local '.Web' folder containing the pack descriptions cached from the web source</summary>
|
||||
string WebRoot { get; }
|
||||
|
||||
/// <summary>Full path </summary>
|
||||
/// <summary>Full path to the local '.Download' folder containing pack files downloaded in this local repository</summary>
|
||||
string DownloadRoot { get; }
|
||||
|
||||
/// <summary>Collection of packs described in the index for this repository</summary>
|
||||
IEnumerable<IRepositoryPackage> Packs { get; }
|
||||
|
||||
/// <summary>Event fired when this repository is updated, either by the current application or an external process</summary>
|
||||
event EventHandler<RepositoryUpdateEventArgs> Updated;
|
||||
|
||||
Task UpdateLocalFromSource( );
|
||||
|
||||
Task LoadFromLocal( );
|
||||
|
||||
Task Download( IRepositoryPackage package, IProgress<FileDownloadProgress> progressSink );
|
||||
|
||||
/// <summary>Update the local repository index and cached pack description files from the source</summary>
|
||||
/// <returns><see cref="Task"/></returns>
|
||||
Task UpdateLocalFromSourceAsync( );
|
||||
|
||||
/// <summary>Loads and parser all of the locally cached package description files listed in the packs index</summary>
|
||||
/// <returns><see cref="Task"/></returns>
|
||||
Task LoadFromLocalAsync( );
|
||||
|
||||
/// <summary>Download a package from the <see cref="SourceUri"/></summary>
|
||||
/// <param name="package">Package to download</param>
|
||||
/// <param name="progressSink">progress callback interface</param>
|
||||
/// <returns><see cref="Task"/></returns>
|
||||
Task DownloadAsync( IRepositoryPackage package, IProgress<FileDownloadProgress> progressSink );
|
||||
|
||||
/// <summary>Installs a given package into the repository</summary>
|
||||
/// <param name="package">Package to install</param>
|
||||
/// <param name="progressSink">Progress callback for the installation</param>
|
||||
/// <returns><see cref="Task"/></returns>
|
||||
Task InstallPack( IRepositoryPackage package, IProgress<PackInstallProgress> progressSink );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,106 +2,45 @@ using System;
|
|||
using System.ComponentModel;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using Sprache;
|
||||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
[Serializable( )]
|
||||
public partial class AlgorithmType {
|
||||
|
||||
private string pnameField;
|
||||
|
||||
private string nameField;
|
||||
|
||||
private string startField;
|
||||
|
||||
private string sizeField;
|
||||
|
||||
private string rAMstartField;
|
||||
|
||||
private string rAMsizeField;
|
||||
|
||||
private bool defaultField;
|
||||
|
||||
public AlgorithmType() {
|
||||
defaultField = false;
|
||||
}
|
||||
|
||||
public partial class Algorithm
|
||||
{
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Pname {
|
||||
get {
|
||||
return pnameField;
|
||||
}
|
||||
set {
|
||||
pnameField = value;
|
||||
}
|
||||
[XmlAttribute( "Pname", Form = System.Xml.Schema.XmlSchemaForm.Qualified )]
|
||||
public string ProcessorName
|
||||
{
|
||||
get { return ProcessorName_; }
|
||||
set { ProcessorName_ = Parsers.RestrictedString.Parse( value ); }
|
||||
}
|
||||
|
||||
private string ProcessorName_;
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string name {
|
||||
get {
|
||||
return nameField;
|
||||
}
|
||||
set {
|
||||
nameField = value;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlAttribute( "name", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string start {
|
||||
get {
|
||||
return startField;
|
||||
}
|
||||
set {
|
||||
startField = value;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlAttribute( "start", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Start { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string size {
|
||||
get {
|
||||
return sizeField;
|
||||
}
|
||||
set {
|
||||
sizeField = value;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlAttribute( "size", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Size { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string RAMstart {
|
||||
get {
|
||||
return rAMstartField;
|
||||
}
|
||||
set {
|
||||
rAMstartField = value;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlAttribute( "RAMstart", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string RAMStart { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string RAMsize {
|
||||
get {
|
||||
return rAMsizeField;
|
||||
}
|
||||
set {
|
||||
rAMsizeField = value;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlAttribute( "RAMsize", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string RAMSize { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
[DefaultValue( false)]
|
||||
public bool @default {
|
||||
get {
|
||||
return defaultField;
|
||||
}
|
||||
set {
|
||||
defaultField = value;
|
||||
}
|
||||
}
|
||||
[XmlAttribute( "default", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
[DefaultValue( false )]
|
||||
public bool Default { get; set; }
|
||||
}
|
||||
}
|
|
@ -6,88 +6,47 @@ using System.Xml.Serialization;
|
|||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
[Serializable( )]
|
||||
public partial class ApiType {
|
||||
|
||||
private string descriptionField;
|
||||
|
||||
private FileType[] filesField;
|
||||
|
||||
private string cclassField;
|
||||
|
||||
private string cgroupField;
|
||||
|
||||
private bool exclusiveField;
|
||||
|
||||
private string capiversionField;
|
||||
|
||||
public ApiType() {
|
||||
exclusiveField = true;
|
||||
public partial class ApiType
|
||||
{
|
||||
public ApiType()
|
||||
{
|
||||
Exclusive = true;
|
||||
}
|
||||
|
||||
|
||||
/// <remarks/>
|
||||
public string description {
|
||||
get {
|
||||
return descriptionField;
|
||||
}
|
||||
set {
|
||||
descriptionField = value;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlElement("description")]
|
||||
public string Description { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlArray("files")]
|
||||
[XmlArrayItem( "file", IsNullable=false)]
|
||||
public FileType[] files {
|
||||
get {
|
||||
return filesField;
|
||||
}
|
||||
set {
|
||||
filesField = value;
|
||||
}
|
||||
}
|
||||
|
||||
public FileType[] Files { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Cclass {
|
||||
get {
|
||||
return cclassField;
|
||||
}
|
||||
set {
|
||||
cclassField = value;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlAttribute( "Cclass", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Class { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Cgroup {
|
||||
get {
|
||||
return cgroupField;
|
||||
}
|
||||
set {
|
||||
cgroupField = value;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlAttribute( "Cgroup", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Group { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
[DefaultValue( true)]
|
||||
public bool exclusive {
|
||||
get {
|
||||
return exclusiveField;
|
||||
}
|
||||
set {
|
||||
exclusiveField = value;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlAttribute( "exclusive", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
[DefaultValue( true )]
|
||||
public bool Exclusive { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Capiversion {
|
||||
get {
|
||||
return capiversionField;
|
||||
}
|
||||
set {
|
||||
capiversionField = value;
|
||||
[XmlAttribute( "CapiVersion", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string ApiVersionString
|
||||
{
|
||||
get { return ApiVersion.ToString(); }
|
||||
set
|
||||
{
|
||||
ApiVersion = SemanticVersion.Parse( value, SemanticVersionParseOptions.PatchOptional );
|
||||
}
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public SemanticVersion ApiVersion { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
[Serializable( )]
|
||||
public partial class Board
|
||||
{
|
||||
/// <remarks/>
|
||||
[XmlElement( "description")]
|
||||
public string[] Description { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlElement( "feature")]
|
||||
public BoardFeature[] Feature { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlElement( "mountedDevice")]
|
||||
public BoardsDevice[] MountedDevice { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlElement( "compatibleDevice")]
|
||||
public CompatibleDeviceType[] CompatibleDevice { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlElement( "image")]
|
||||
public BoardImage[] Image { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlElement( "debugInterface")]
|
||||
public DebugInterfaceType[] DebugInterface { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlElement( "book")]
|
||||
public BoardBook[] Book { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "vendor", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Vendor { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "name", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Revision { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "salesContact", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string SalesContact { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "orderForm", Form=System.Xml.Schema.XmlSchemaForm.Qualified, DataType="anyURI")]
|
||||
public string OrderForm { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
[Serializable( )]
|
||||
public partial class BoardBook
|
||||
{
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "category", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public BoardBookCategoryEnum Category { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlIgnore( )]
|
||||
public bool CategorySpecified { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "name", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "title", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Title { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
using System;
|
||||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
[Serializable( )]
|
||||
public enum BoardBookCategoryEnum {
|
||||
|
||||
/// <remarks/>
|
||||
setup,
|
||||
|
||||
/// <remarks/>
|
||||
schematic,
|
||||
|
||||
/// <remarks/>
|
||||
overview,
|
||||
|
||||
/// <remarks/>
|
||||
manual,
|
||||
|
||||
/// <remarks/>
|
||||
other,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using Sprache;
|
||||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
[Serializable( )]
|
||||
public partial class BoardFeature
|
||||
{
|
||||
/// <remarks/>
|
||||
[XmlAttribute("type", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Type { get; set;}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "n", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
[System.ComponentModel.EditorBrowsable( System.ComponentModel.EditorBrowsableState.Never )]
|
||||
public string RawNString {
|
||||
get
|
||||
{
|
||||
return N?.ToString();
|
||||
}
|
||||
set
|
||||
{
|
||||
N = Parsers.ScaledDecimal.Parse( value );
|
||||
}
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public decimal? N { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "m", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
[System.ComponentModel.EditorBrowsable( System.ComponentModel.EditorBrowsableState.Never )]
|
||||
public string RawMString
|
||||
{
|
||||
get
|
||||
{
|
||||
return M?.ToString();
|
||||
}
|
||||
set
|
||||
{
|
||||
M = Parsers.ScaledDecimal.Parse( value );
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlIgnore( )]
|
||||
public decimal? M { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "name", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,88 +0,0 @@
|
|||
using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
[Serializable( )]
|
||||
public partial class BoardFeatureType {
|
||||
|
||||
private string typeField;
|
||||
|
||||
private decimal nField;
|
||||
|
||||
private bool nFieldSpecified;
|
||||
|
||||
private decimal mField;
|
||||
|
||||
private bool mFieldSpecified;
|
||||
|
||||
private string nameField;
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string type {
|
||||
get {
|
||||
return typeField;
|
||||
}
|
||||
set {
|
||||
typeField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public decimal n {
|
||||
get {
|
||||
return nField;
|
||||
}
|
||||
set {
|
||||
nField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlIgnore( )]
|
||||
public bool nSpecified {
|
||||
get {
|
||||
return nFieldSpecified;
|
||||
}
|
||||
set {
|
||||
nFieldSpecified = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public decimal m {
|
||||
get {
|
||||
return mField;
|
||||
}
|
||||
set {
|
||||
mField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlIgnore( )]
|
||||
public bool mSpecified {
|
||||
get {
|
||||
return mFieldSpecified;
|
||||
}
|
||||
set {
|
||||
mFieldSpecified = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string name {
|
||||
get {
|
||||
return nameField;
|
||||
}
|
||||
set {
|
||||
nameField = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
[Serializable( )]
|
||||
[XmlType( AnonymousType=true)]
|
||||
public partial class BoardImage
|
||||
{
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "small", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Small { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "large", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string large { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
/// <remarks/>
|
||||
[Serializable( )]
|
||||
public partial class BoardReference
|
||||
{
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "name", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "vendor", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string BoardVendor { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "DVendor", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
[System.ComponentModel.EditorBrowsable( System.ComponentModel.EditorBrowsableState.Never )]
|
||||
public string RawDeviceVendorString
|
||||
{
|
||||
get { return DeviceVendor.ToString(); }
|
||||
set { DeviceVendor = DeviceVendor.Parse( value ); }
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
DeviceVendor DeviceVendor { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "Dfamily", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string DeviceFamily { get; set;}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "DsubFamily", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string DeviceSubFamily { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "Dname", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string DeviceName { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,102 +0,0 @@
|
|||
using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
/// <remarks/>
|
||||
[Serializable( )]
|
||||
public partial class BoardReferenceType {
|
||||
|
||||
private string nameField;
|
||||
|
||||
private string vendorField;
|
||||
|
||||
private DeviceVendorEnum dvendorField;
|
||||
|
||||
private bool dvendorFieldSpecified;
|
||||
|
||||
private string dfamilyField;
|
||||
|
||||
private string dsubFamilyField;
|
||||
|
||||
private string dnameField;
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string name {
|
||||
get {
|
||||
return nameField;
|
||||
}
|
||||
set {
|
||||
nameField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string vendor {
|
||||
get {
|
||||
return vendorField;
|
||||
}
|
||||
set {
|
||||
vendorField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public DeviceVendorEnum Dvendor {
|
||||
get {
|
||||
return dvendorField;
|
||||
}
|
||||
set {
|
||||
dvendorField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlIgnore( )]
|
||||
public bool DvendorSpecified {
|
||||
get {
|
||||
return dvendorFieldSpecified;
|
||||
}
|
||||
set {
|
||||
dvendorFieldSpecified = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Dfamily {
|
||||
get {
|
||||
return dfamilyField;
|
||||
}
|
||||
set {
|
||||
dfamilyField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string DsubFamily {
|
||||
get {
|
||||
return dsubFamilyField;
|
||||
}
|
||||
set {
|
||||
dsubFamilyField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Dname {
|
||||
get {
|
||||
return dnameField;
|
||||
}
|
||||
set {
|
||||
dnameField = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,166 +0,0 @@
|
|||
using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
[Serializable( )]
|
||||
public partial class BoardType {
|
||||
|
||||
private string[] descriptionField;
|
||||
|
||||
private BoardFeatureType[] featureField;
|
||||
|
||||
private BoardsDeviceType[] mountedDeviceField;
|
||||
|
||||
private CompatibleDeviceType[] compatibleDeviceField;
|
||||
|
||||
private BoardTypeImage[] imageField;
|
||||
|
||||
private DebugInterfaceType[] debugInterfaceField;
|
||||
|
||||
private BoardsBookType[] bookField;
|
||||
|
||||
private string vendorField;
|
||||
|
||||
private string nameField;
|
||||
|
||||
private string revisionField;
|
||||
|
||||
private string salesContactField;
|
||||
|
||||
private string orderFormField;
|
||||
|
||||
/// <remarks/>
|
||||
[XmlElement( "description")]
|
||||
public string[] description {
|
||||
get {
|
||||
return descriptionField;
|
||||
}
|
||||
set {
|
||||
descriptionField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlElement( "feature")]
|
||||
public BoardFeatureType[] feature {
|
||||
get {
|
||||
return featureField;
|
||||
}
|
||||
set {
|
||||
featureField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlElement( "mountedDevice")]
|
||||
public BoardsDeviceType[] mountedDevice {
|
||||
get {
|
||||
return mountedDeviceField;
|
||||
}
|
||||
set {
|
||||
mountedDeviceField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlElement( "compatibleDevice")]
|
||||
public CompatibleDeviceType[] compatibleDevice {
|
||||
get {
|
||||
return compatibleDeviceField;
|
||||
}
|
||||
set {
|
||||
compatibleDeviceField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlElement( "image")]
|
||||
public BoardTypeImage[] image {
|
||||
get {
|
||||
return imageField;
|
||||
}
|
||||
set {
|
||||
imageField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlElement( "debugInterface")]
|
||||
public DebugInterfaceType[] debugInterface {
|
||||
get {
|
||||
return debugInterfaceField;
|
||||
}
|
||||
set {
|
||||
debugInterfaceField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlElement( "book")]
|
||||
public BoardsBookType[] book {
|
||||
get {
|
||||
return bookField;
|
||||
}
|
||||
set {
|
||||
bookField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string vendor {
|
||||
get {
|
||||
return vendorField;
|
||||
}
|
||||
set {
|
||||
vendorField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string name {
|
||||
get {
|
||||
return nameField;
|
||||
}
|
||||
set {
|
||||
nameField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string revision {
|
||||
get {
|
||||
return revisionField;
|
||||
}
|
||||
set {
|
||||
revisionField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string salesContact {
|
||||
get {
|
||||
return salesContactField;
|
||||
}
|
||||
set {
|
||||
salesContactField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified, DataType="anyURI")]
|
||||
public string orderForm {
|
||||
get {
|
||||
return orderFormField;
|
||||
}
|
||||
set {
|
||||
orderFormField = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
[Serializable( )]
|
||||
[XmlType( AnonymousType=true)]
|
||||
public partial class BoardTypeImage {
|
||||
|
||||
private string smallField;
|
||||
|
||||
private string largeField;
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string small {
|
||||
get {
|
||||
return smallField;
|
||||
}
|
||||
set {
|
||||
smallField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string large {
|
||||
get {
|
||||
return largeField;
|
||||
}
|
||||
set {
|
||||
largeField = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
[Serializable( )]
|
||||
public partial class BoardsBookType {
|
||||
|
||||
private BoardBookCategoryEnum categoryField;
|
||||
|
||||
private bool categoryFieldSpecified;
|
||||
|
||||
private string nameField;
|
||||
|
||||
private string titleField;
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public BoardBookCategoryEnum category {
|
||||
get {
|
||||
return categoryField;
|
||||
}
|
||||
set {
|
||||
categoryField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlIgnore( )]
|
||||
public bool categorySpecified {
|
||||
get {
|
||||
return categoryFieldSpecified;
|
||||
}
|
||||
set {
|
||||
categoryFieldSpecified = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string name {
|
||||
get {
|
||||
return nameField;
|
||||
}
|
||||
set {
|
||||
nameField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string title {
|
||||
get {
|
||||
return titleField;
|
||||
}
|
||||
set {
|
||||
titleField = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
[Serializable( )]
|
||||
public partial class BoardsDevice
|
||||
{
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "deviceIndex", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string DeviceIndex { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "DVendor", Form = System.Xml.Schema.XmlSchemaForm.Qualified )]
|
||||
[System.ComponentModel.EditorBrowsable( System.ComponentModel.EditorBrowsableState.Never )]
|
||||
public string RawDeviceVendorString
|
||||
{
|
||||
get { return DeviceVendor.ToString( ); }
|
||||
set { DeviceVendor = DeviceVendor.Parse( value ); }
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
DeviceVendor DeviceVendor { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "Dfamily", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string DeviceFamily { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "DsubFamily", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string DeviceSubFamily { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "Dname", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string DeviceName { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
[Serializable( )]
|
||||
public partial class BoardsDeviceType {
|
||||
|
||||
private string deviceIndexField;
|
||||
|
||||
private DeviceVendorEnum dvendorField;
|
||||
|
||||
private string dfamilyField;
|
||||
|
||||
private string dsubFamilyField;
|
||||
|
||||
private string dnameField;
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string deviceIndex {
|
||||
get {
|
||||
return deviceIndexField;
|
||||
}
|
||||
set {
|
||||
deviceIndexField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public DeviceVendorEnum Dvendor {
|
||||
get {
|
||||
return dvendorField;
|
||||
}
|
||||
set {
|
||||
dvendorField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Dfamily {
|
||||
get {
|
||||
return dfamilyField;
|
||||
}
|
||||
set {
|
||||
dfamilyField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string DsubFamily {
|
||||
get {
|
||||
return dsubFamilyField;
|
||||
}
|
||||
set {
|
||||
dsubFamilyField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Dname {
|
||||
get {
|
||||
return dnameField;
|
||||
}
|
||||
set {
|
||||
dnameField = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,49 +1,27 @@
|
|||
using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using Sprache;
|
||||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
[Serializable( )]
|
||||
public partial class BookType {
|
||||
|
||||
private string pnameField;
|
||||
|
||||
private string nameField;
|
||||
|
||||
private string titleField;
|
||||
public partial class BookType
|
||||
{
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "Pname", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string ProcessorName {
|
||||
get { return ProcessorName_; }
|
||||
set { ProcessorName_ = Parsers.RestrictedString.Parse( value ); }
|
||||
}
|
||||
private string ProcessorName_;
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "name", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Pname {
|
||||
get {
|
||||
return pnameField;
|
||||
}
|
||||
set {
|
||||
pnameField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string name {
|
||||
get {
|
||||
return nameField;
|
||||
}
|
||||
set {
|
||||
nameField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string title {
|
||||
get {
|
||||
return titleField;
|
||||
}
|
||||
set {
|
||||
titleField = value;
|
||||
}
|
||||
}
|
||||
[XmlAttribute( "title", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Title { get; set; }
|
||||
}
|
||||
}
|
|
@ -6,69 +6,23 @@ namespace CMSIS.Pack.PackDescription
|
|||
{
|
||||
[Serializable( )]
|
||||
[XmlType( AnonymousType = true )]
|
||||
public partial class Bundle : ComponenOrBundleGroup
|
||||
public partial class Bundle
|
||||
: ComponenOrBundleGroup
|
||||
{
|
||||
private string docField;
|
||||
|
||||
private Component[] componentField;
|
||||
|
||||
private string cbundleField;
|
||||
|
||||
private string generatorField;
|
||||
|
||||
/// <remarks/>
|
||||
public string doc
|
||||
{
|
||||
get
|
||||
{
|
||||
return docField;
|
||||
}
|
||||
set
|
||||
{
|
||||
docField = value;
|
||||
}
|
||||
}
|
||||
[XmlElement("doc")]
|
||||
public string Document { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlElement( "component" )]
|
||||
public Component[ ] component
|
||||
{
|
||||
get
|
||||
{
|
||||
return componentField;
|
||||
}
|
||||
set
|
||||
{
|
||||
componentField = value;
|
||||
}
|
||||
}
|
||||
public Component[ ] Component { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form = System.Xml.Schema.XmlSchemaForm.Qualified )]
|
||||
public string Cbundle
|
||||
{
|
||||
get
|
||||
{
|
||||
return cbundleField;
|
||||
}
|
||||
set
|
||||
{
|
||||
cbundleField = value;
|
||||
}
|
||||
}
|
||||
[XmlAttribute( "Cbundle", Form = System.Xml.Schema.XmlSchemaForm.Qualified )]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form = System.Xml.Schema.XmlSchemaForm.Qualified )]
|
||||
public string generator
|
||||
{
|
||||
get
|
||||
{
|
||||
return generatorField;
|
||||
}
|
||||
set
|
||||
{
|
||||
generatorField = value;
|
||||
}
|
||||
}
|
||||
[XmlAttribute( "generator", Form = System.Xml.Schema.XmlSchemaForm.Qualified )]
|
||||
public string Generator { get; set; }
|
||||
}
|
||||
}
|
|
@ -5,84 +5,34 @@ using System.Xml.Serialization;
|
|||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
[Serializable( )]
|
||||
public partial class CompatibleDeviceType {
|
||||
|
||||
private string deviceIndexField;
|
||||
|
||||
private DeviceVendorEnum dvendorField;
|
||||
|
||||
private bool dvendorFieldSpecified;
|
||||
|
||||
private string dfamilyField;
|
||||
|
||||
private string dsubFamilyField;
|
||||
|
||||
private string dnameField;
|
||||
public partial class CompatibleDeviceType
|
||||
{
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "deviceIndex", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string DeviceIndex { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "DVendor", Form = System.Xml.Schema.XmlSchemaForm.Qualified )]
|
||||
[System.ComponentModel.EditorBrowsable( System.ComponentModel.EditorBrowsableState.Never )]
|
||||
public string RawDeviceVendorString
|
||||
{
|
||||
get { return DeviceVendor.ToString( ); }
|
||||
set { DeviceVendor = DeviceVendor.Parse( value ); }
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
DeviceVendor DeviceVendor { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "Dfamily", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string DeviceFamily { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string deviceIndex {
|
||||
get {
|
||||
return deviceIndexField;
|
||||
}
|
||||
set {
|
||||
deviceIndexField = value;
|
||||
}
|
||||
}
|
||||
[XmlAttribute( "DsubFamily", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string DeviceSubFamily { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public DeviceVendorEnum Dvendor {
|
||||
get {
|
||||
return dvendorField;
|
||||
}
|
||||
set {
|
||||
dvendorField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlIgnore( )]
|
||||
public bool DvendorSpecified {
|
||||
get {
|
||||
return dvendorFieldSpecified;
|
||||
}
|
||||
set {
|
||||
dvendorFieldSpecified = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Dfamily {
|
||||
get {
|
||||
return dfamilyField;
|
||||
}
|
||||
set {
|
||||
dfamilyField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string DsubFamily {
|
||||
get {
|
||||
return dsubFamilyField;
|
||||
}
|
||||
set {
|
||||
dsubFamilyField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Dname {
|
||||
get {
|
||||
return dnameField;
|
||||
}
|
||||
set {
|
||||
dnameField = value;
|
||||
}
|
||||
}
|
||||
[XmlAttribute( "Dname", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string DeviceName { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,49 +1,28 @@
|
|||
using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using Sprache;
|
||||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
[Serializable( )]
|
||||
public partial class CompileType {
|
||||
|
||||
private string pnameField;
|
||||
|
||||
private string headerField;
|
||||
|
||||
private string defineField;
|
||||
public partial class CompileType
|
||||
{
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "Pname", Form = System.Xml.Schema.XmlSchemaForm.Qualified )]
|
||||
public string ProcessorName
|
||||
{
|
||||
get { return ProcessorName_; }
|
||||
set { ProcessorName_ = Parsers.RestrictedString.Parse( value ); }
|
||||
}
|
||||
private string ProcessorName_;
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "header", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Header { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Pname {
|
||||
get {
|
||||
return pnameField;
|
||||
}
|
||||
set {
|
||||
pnameField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string header {
|
||||
get {
|
||||
return headerField;
|
||||
}
|
||||
set {
|
||||
headerField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string define {
|
||||
get {
|
||||
return defineField;
|
||||
}
|
||||
set {
|
||||
defineField = value;
|
||||
}
|
||||
}
|
||||
[XmlAttribute( "define", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Define { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
using System;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
[Serializable( )]
|
||||
public enum CompilerEnumType {
|
||||
|
||||
/// <remarks/>
|
||||
GCC,
|
||||
|
||||
/// <remarks/>
|
||||
ARMCC,
|
||||
|
||||
/// <remarks/>
|
||||
IAR,
|
||||
|
||||
/// <remarks/>
|
||||
Tasking,
|
||||
|
||||
/// <remarks/>
|
||||
GHS,
|
||||
|
||||
/// <remarks/>
|
||||
Cosmic,
|
||||
|
||||
/// <remarks/>
|
||||
[XmlEnum( "G++")]
|
||||
G,
|
||||
|
||||
/// <remarks/>
|
||||
[XmlEnum( "*")]
|
||||
Item,
|
||||
}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
using System;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
[Serializable( )]
|
||||
public enum CompilerOutputType {
|
||||
|
||||
/// <remarks/>
|
||||
exe,
|
||||
|
||||
/// <remarks/>
|
||||
lib,
|
||||
|
||||
/// <remarks/>
|
||||
[XmlEnum( "*")]
|
||||
Item,
|
||||
}
|
||||
}
|
|
@ -3,7 +3,7 @@ using System.Xml.Serialization;
|
|||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
public partial class ComponenOrBundleGroup
|
||||
public class ComponenOrBundleGroup
|
||||
{
|
||||
[XmlAttribute("Cvendor")]
|
||||
public string Vendor { get; set; }
|
||||
|
@ -14,7 +14,18 @@ namespace CMSIS.Pack.PackDescription
|
|||
[XmlElement("description")]
|
||||
public string Description { get; set; }
|
||||
|
||||
[XmlAttribute( Form = System.Xml.Schema.XmlSchemaForm.Qualified )]
|
||||
public string Cversion { get; set; }
|
||||
[XmlAttribute( "Cversion", Form = System.Xml.Schema.XmlSchemaForm.Qualified )]
|
||||
[System.ComponentModel.EditorBrowsable( System.ComponentModel.EditorBrowsableState.Never )]
|
||||
public string RawVersionString
|
||||
{
|
||||
get { return Version.ToString( ); }
|
||||
set
|
||||
{
|
||||
Version = SemanticVersion.Parse( value, SemanticVersionParseOptions.PatchOptional );
|
||||
}
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public SemanticVersion Version { get; set; }
|
||||
}
|
||||
}
|
|
@ -7,140 +7,59 @@ namespace CMSIS.Pack.PackDescription
|
|||
{
|
||||
[Serializable( )]
|
||||
[XmlType( AnonymousType=true)]
|
||||
public partial class Component : ComponenOrBundleGroup
|
||||
public class Component
|
||||
: ComponenOrBundleGroup
|
||||
{
|
||||
|
||||
private bool deprecatedField;
|
||||
|
||||
private string rTE_Components_hField;
|
||||
|
||||
private FileType[] filesField;
|
||||
|
||||
private string cgroupField;
|
||||
|
||||
private string csubField;
|
||||
|
||||
private string cvariantField;
|
||||
|
||||
private string capiversionField;
|
||||
|
||||
private string conditionField;
|
||||
|
||||
private string maxInstancesField;
|
||||
|
||||
private string generatorField;
|
||||
|
||||
public Component() {
|
||||
deprecatedField = false;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[DefaultValue( false)]
|
||||
public bool deprecated {
|
||||
get {
|
||||
return deprecatedField;
|
||||
}
|
||||
set {
|
||||
deprecatedField = value;
|
||||
}
|
||||
}
|
||||
[DefaultValue( false )]
|
||||
[XmlElement("deprecated")]
|
||||
public bool IsDeprecated { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public string RTE_Components_h {
|
||||
get {
|
||||
return rTE_Components_hField;
|
||||
}
|
||||
set {
|
||||
rTE_Components_hField = value;
|
||||
}
|
||||
}
|
||||
public string RTE_Components_h { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlArray("files")]
|
||||
[XmlArrayItem( "file", IsNullable=false)]
|
||||
public FileType[] files {
|
||||
get {
|
||||
return filesField;
|
||||
}
|
||||
set {
|
||||
filesField = value;
|
||||
public FileType[] Files { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "Cgroup", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Group { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "Csub", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string SubGroup { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "Cvariant", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Variant { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "Capiversion", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
[System.ComponentModel.EditorBrowsable( System.ComponentModel.EditorBrowsableState.Never )]
|
||||
public string RawApiVersionString
|
||||
{
|
||||
get { return Version.ToString( ); }
|
||||
set
|
||||
{
|
||||
Version = SemanticVersion.Parse( value, SemanticVersionParseOptions.PatchOptional );
|
||||
}
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public SemanticVersion ApiVersion { get; set; }
|
||||
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Cgroup {
|
||||
get {
|
||||
return cgroupField;
|
||||
}
|
||||
set {
|
||||
cgroupField = value;
|
||||
}
|
||||
}
|
||||
[XmlAttribute( "condition", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Condition { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Csub {
|
||||
get {
|
||||
return csubField;
|
||||
}
|
||||
set {
|
||||
csubField = value;
|
||||
}
|
||||
}
|
||||
[XmlAttribute( "maxInstances", Form=System.Xml.Schema.XmlSchemaForm.Qualified )]
|
||||
public int MaxInstances { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Cvariant {
|
||||
get {
|
||||
return cvariantField;
|
||||
}
|
||||
set {
|
||||
cvariantField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Capiversion {
|
||||
get {
|
||||
return capiversionField;
|
||||
}
|
||||
set {
|
||||
capiversionField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string condition {
|
||||
get {
|
||||
return conditionField;
|
||||
}
|
||||
set {
|
||||
conditionField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified, DataType="integer")]
|
||||
public string maxInstances {
|
||||
get {
|
||||
return maxInstancesField;
|
||||
}
|
||||
set {
|
||||
maxInstancesField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string generator {
|
||||
get {
|
||||
return generatorField;
|
||||
}
|
||||
set {
|
||||
generatorField = value;
|
||||
}
|
||||
}
|
||||
[XmlAttribute( "generator", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Generator { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using Sprache;
|
||||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
|
@ -19,8 +20,6 @@ namespace CMSIS.Pack.PackDescription
|
|||
|
||||
private string svdField;
|
||||
|
||||
private string pnameField;
|
||||
|
||||
private XmlAttribute[] anyAttrField;
|
||||
|
||||
/// <remarks/>
|
||||
|
@ -88,18 +87,16 @@ namespace CMSIS.Pack.PackDescription
|
|||
svdField = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Pname {
|
||||
get {
|
||||
return pnameField;
|
||||
}
|
||||
set {
|
||||
pnameField = value;
|
||||
}
|
||||
[XmlAttribute( "Pname", Form = System.Xml.Schema.XmlSchemaForm.Qualified )]
|
||||
public string ProcessorName
|
||||
{
|
||||
get { return ProcessorName_; }
|
||||
set { ProcessorName_ = Parsers.RestrictedString.Parse( value ); }
|
||||
}
|
||||
|
||||
private string ProcessorName_;
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAnyAttribute( )]
|
||||
public XmlAttribute[ ] AnyAttr {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using Sprache;
|
||||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
|
@ -11,8 +12,6 @@ namespace CMSIS.Pack.PackDescription
|
|||
|
||||
private string versionField;
|
||||
|
||||
private string pnameField;
|
||||
|
||||
private XmlAttribute[] anyAttrField;
|
||||
|
||||
private string valueField;
|
||||
|
@ -38,18 +37,16 @@ namespace CMSIS.Pack.PackDescription
|
|||
versionField = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Pname {
|
||||
get {
|
||||
return pnameField;
|
||||
}
|
||||
set {
|
||||
pnameField = value;
|
||||
}
|
||||
[XmlAttribute( "Pname", Form = System.Xml.Schema.XmlSchemaForm.Qualified )]
|
||||
public string ProcessorName
|
||||
{
|
||||
get { return ProcessorName_; }
|
||||
set { ProcessorName_ = Parsers.RestrictedString.Parse( value ); }
|
||||
}
|
||||
|
||||
private string ProcessorName_;
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAnyAttribute( )]
|
||||
public XmlAttribute[ ] AnyAttr {
|
||||
|
|
|
@ -1,36 +1,24 @@
|
|||
using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using Sprache;
|
||||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
[Serializable( )]
|
||||
public partial class DescriptionType {
|
||||
|
||||
private string pnameField;
|
||||
|
||||
private string valueField;
|
||||
|
||||
public partial class DescriptionType
|
||||
{
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Pname {
|
||||
get {
|
||||
return pnameField;
|
||||
}
|
||||
set {
|
||||
pnameField = value;
|
||||
}
|
||||
[XmlAttribute( "Pname", Form = System.Xml.Schema.XmlSchemaForm.Qualified )]
|
||||
public string ProcessorName
|
||||
{
|
||||
get { return ProcessorName_; }
|
||||
set { ProcessorName_ = Parsers.RestrictedString.Parse( value ); }
|
||||
}
|
||||
|
||||
private string ProcessorName_;
|
||||
|
||||
/// <remarks/>
|
||||
[XmlText( )]
|
||||
public string Value {
|
||||
get {
|
||||
return valueField;
|
||||
}
|
||||
set {
|
||||
valueField = value;
|
||||
}
|
||||
}
|
||||
public string Value { get; set; }
|
||||
}
|
||||
}
|
|
@ -9,8 +9,6 @@ namespace CMSIS.Pack.PackDescription
|
|||
[Serializable( )]
|
||||
public partial class DeviceFeatureType {
|
||||
|
||||
private string pnameField;
|
||||
|
||||
private string typeField;
|
||||
|
||||
private decimal nField;
|
||||
|
@ -26,18 +24,16 @@ namespace CMSIS.Pack.PackDescription
|
|||
private int countField;
|
||||
|
||||
private bool countFieldSpecified;
|
||||
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Pname {
|
||||
get {
|
||||
return pnameField;
|
||||
}
|
||||
set {
|
||||
pnameField = value;
|
||||
}
|
||||
[XmlAttribute( "Pname", Form = System.Xml.Schema.XmlSchemaForm.Qualified )]
|
||||
public string ProcessorName
|
||||
{
|
||||
get { return ProcessorName_; }
|
||||
set { ProcessorName_ = Parsers.RestrictedString.Parse( value ); }
|
||||
}
|
||||
|
||||
private string ProcessorName_;
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string type {
|
||||
|
@ -51,6 +47,7 @@ namespace CMSIS.Pack.PackDescription
|
|||
|
||||
/// <remarks/>
|
||||
[XmlAttribute("n", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
[System.ComponentModel.EditorBrowsable( System.ComponentModel.EditorBrowsableState.Never )]
|
||||
public string RawNString {
|
||||
get
|
||||
{
|
||||
|
@ -132,7 +129,7 @@ namespace CMSIS.Pack.PackDescription
|
|||
}
|
||||
|
||||
[OnDeserializing]
|
||||
internal void OnDeserializing( StreamingContext ctx )
|
||||
private void OnDeserializing( StreamingContext ctx )
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace CMSIS.Pack.PackDescription
|
|||
|
||||
private MemoryType[] memoryField;
|
||||
|
||||
private AlgorithmType[] algorithmField;
|
||||
private Algorithm[] algorithmField;
|
||||
|
||||
private BookType[] bookField;
|
||||
|
||||
|
@ -84,7 +84,7 @@ namespace CMSIS.Pack.PackDescription
|
|||
|
||||
/// <remarks/>
|
||||
[XmlElement( "algorithm")]
|
||||
public AlgorithmType[] algorithm {
|
||||
public Algorithm[] algorithm {
|
||||
get {
|
||||
return algorithmField;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace CMSIS.Pack.PackDescription
|
|||
|
||||
private MemoryType[] memoryField;
|
||||
|
||||
private AlgorithmType[] algorithmField;
|
||||
private Algorithm[] algorithmField;
|
||||
|
||||
private BookType[] bookField;
|
||||
|
||||
|
@ -83,7 +83,7 @@ namespace CMSIS.Pack.PackDescription
|
|||
|
||||
/// <remarks/>
|
||||
[XmlElement( "algorithm")]
|
||||
public AlgorithmType[] algorithm {
|
||||
public Algorithm[] algorithm {
|
||||
get {
|
||||
return algorithmField;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using Sprache;
|
||||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
/// <summary>Name value pair for enumerated Device vendors</summary>
|
||||
/// <remarks>
|
||||
/// Some officially published and supposedly validated PDSC files,
|
||||
/// Contain strings that don't match the published schema, typically
|
||||
/// case mismatches. Others contain vendors that aren't listed in
|
||||
/// the official schema or public documentation. This gracefully
|
||||
/// handles reading such vendor names without triggering XML parsing
|
||||
/// errors. Unfortunately, vendors not listed in the official schema
|
||||
/// will still fail to validate once written back. This is not something
|
||||
/// that can be fixed with a transform. At best the validator could be
|
||||
/// enhanced to add the known offending vendor,id pairs before performing
|
||||
/// the validation, either at runtime or by using a modified XSD for
|
||||
/// validations
|
||||
/// </remarks>
|
||||
public class DeviceVendor
|
||||
: IEquatable<DeviceVendor>
|
||||
{
|
||||
public DeviceVendor( string name, DeviceVendorEnum id )
|
||||
{
|
||||
// NOTE: the name and value are intentionally not
|
||||
// validated against the enumeration since some
|
||||
// real world PDSC files contain names that don't
|
||||
// match exactly.
|
||||
Name = name;
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public string Name { get; }
|
||||
public DeviceVendorEnum Id { get; }
|
||||
|
||||
public override string ToString( ) => $"{Name}:{( int )Id}";
|
||||
|
||||
public bool Equals( DeviceVendor other )
|
||||
{
|
||||
if( other == null )
|
||||
return false;
|
||||
|
||||
if( 0 != string.Compare( Name, other.Name, StringComparison.InvariantCultureIgnoreCase ) )
|
||||
return false;
|
||||
|
||||
return Id == other.Id;
|
||||
}
|
||||
|
||||
public override bool Equals( object obj )
|
||||
{
|
||||
var dv = obj as DeviceVendor;
|
||||
if( dv == null )
|
||||
return base.Equals( obj );
|
||||
else
|
||||
return Equals( dv );
|
||||
}
|
||||
|
||||
public override int GetHashCode( )
|
||||
{
|
||||
if( !HashCode.HasValue )
|
||||
HashCode = Name.ToLowerInvariant().GetHashCode() ^ Id.GetHashCode();
|
||||
|
||||
return HashCode.Value;
|
||||
}
|
||||
|
||||
private int? HashCode;
|
||||
|
||||
public static DeviceVendor Parse( string txt ) => Parser.Parse( txt );
|
||||
|
||||
private static Parser<DeviceVendor> Parser = from name in Sprache.Parse.CharExcept(':').AtLeastOnce().Token().Text()
|
||||
from colon in Sprache.Parse.Char(':')
|
||||
from value in Sprache.Parse.Digit.Repeat( 1, 8 ).Token().Text()
|
||||
select new DeviceVendor( name, (DeviceVendorEnum)int.Parse(value));
|
||||
}
|
||||
}
|
|
@ -4,6 +4,70 @@ using System.Xml.Serialization;
|
|||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
[Serializable( )]
|
||||
public enum CompilerOutputType
|
||||
{
|
||||
/// <remarks/>
|
||||
[XmlEnum( "*" )]
|
||||
Other = 0,
|
||||
|
||||
/// <remarks/>
|
||||
exe,
|
||||
|
||||
/// <remarks/>
|
||||
lib
|
||||
}
|
||||
|
||||
[Serializable( )]
|
||||
public enum CompilerEnumType
|
||||
{
|
||||
/// <remarks/>
|
||||
[XmlEnum( "*" )]
|
||||
Other = 0,
|
||||
|
||||
/// <remarks/>
|
||||
GCC,
|
||||
|
||||
/// <remarks/>
|
||||
ARMCC,
|
||||
|
||||
/// <remarks/>
|
||||
IAR,
|
||||
|
||||
/// <remarks/>
|
||||
Tasking,
|
||||
|
||||
/// <remarks/>
|
||||
GHS,
|
||||
|
||||
/// <remarks/>
|
||||
Cosmic,
|
||||
|
||||
/// <remarks/>
|
||||
[XmlEnum( "G++" )]
|
||||
Gpp
|
||||
}
|
||||
|
||||
[Serializable( )]
|
||||
public enum BoardBookCategoryEnum
|
||||
{
|
||||
|
||||
/// <remarks/>
|
||||
setup,
|
||||
|
||||
/// <remarks/>
|
||||
schematic,
|
||||
|
||||
/// <remarks/>
|
||||
overview,
|
||||
|
||||
/// <remarks/>
|
||||
manual,
|
||||
|
||||
/// <remarks/>
|
||||
other,
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[Serializable( )]
|
||||
public enum DeviceVendorEnum
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using Sprache;
|
||||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
|
@ -11,8 +12,6 @@ namespace CMSIS.Pack.PackDescription
|
|||
|
||||
private string nameField;
|
||||
|
||||
private string pnameField;
|
||||
|
||||
private XmlAttribute[] anyAttrField;
|
||||
|
||||
/// <remarks/>
|
||||
|
@ -36,18 +35,16 @@ namespace CMSIS.Pack.PackDescription
|
|||
nameField = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Pname {
|
||||
get {
|
||||
return pnameField;
|
||||
}
|
||||
set {
|
||||
pnameField = value;
|
||||
}
|
||||
[XmlAttribute( "Pname", Form = System.Xml.Schema.XmlSchemaForm.Qualified )]
|
||||
public string ProcessorName
|
||||
{
|
||||
get { return ProcessorName_; }
|
||||
set { ProcessorName_ = Parsers.RestrictedString.Parse( value ); }
|
||||
}
|
||||
|
||||
private string ProcessorName_;
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAnyAttribute( )]
|
||||
public XmlAttribute[ ] AnyAttr {
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace CMSIS.Pack.PackDescription
|
|||
|
||||
private string descriptionField;
|
||||
|
||||
private BoardReferenceType[] boardField;
|
||||
private BoardReference[] boardField;
|
||||
|
||||
private ExampleProjectTypeEnvironment[] projectField;
|
||||
|
||||
|
@ -44,7 +44,7 @@ namespace CMSIS.Pack.PackDescription
|
|||
|
||||
/// <remarks/>
|
||||
[XmlElement( "board")]
|
||||
public BoardReferenceType[] board {
|
||||
public BoardReference[] board {
|
||||
get {
|
||||
return boardField;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace CMSIS.Pack.PackDescription
|
|||
|
||||
private MemoryType[] memoryField;
|
||||
|
||||
private AlgorithmType[] algorithmField;
|
||||
private Algorithm[] algorithmField;
|
||||
|
||||
private BookType[] bookField;
|
||||
|
||||
|
@ -89,7 +89,7 @@ namespace CMSIS.Pack.PackDescription
|
|||
|
||||
/// <remarks/>
|
||||
[XmlElement( "algorithm")]
|
||||
public AlgorithmType[] algorithm {
|
||||
public Algorithm[] algorithm {
|
||||
get {
|
||||
return algorithmField;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using Sprache;
|
||||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
|
@ -35,8 +36,6 @@ namespace CMSIS.Pack.PackDescription
|
|||
|
||||
private bool dendianFieldSpecified;
|
||||
|
||||
private string pnameField;
|
||||
|
||||
private string cvendorField;
|
||||
|
||||
private string cbundleField;
|
||||
|
@ -216,18 +215,16 @@ namespace CMSIS.Pack.PackDescription
|
|||
dendianFieldSpecified = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Pname {
|
||||
get {
|
||||
return pnameField;
|
||||
}
|
||||
set {
|
||||
pnameField = value;
|
||||
}
|
||||
[XmlAttribute( "Pname", Form = System.Xml.Schema.XmlSchemaForm.Qualified )]
|
||||
public string ProcessorName
|
||||
{
|
||||
get { return ProcessorName_; }
|
||||
set { ProcessorName_ = Parsers.RestrictedString.Parse( value ); }
|
||||
}
|
||||
|
||||
private string ProcessorName_;
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Cvendor {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using Sprache;
|
||||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
|
@ -13,8 +14,6 @@ namespace CMSIS.Pack.PackDescription
|
|||
|
||||
private string dvariantField;
|
||||
|
||||
private string pnameField;
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public DeviceVendorEnum Dvendor {
|
||||
|
@ -47,16 +46,14 @@ namespace CMSIS.Pack.PackDescription
|
|||
dvariantField = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Pname {
|
||||
get {
|
||||
return pnameField;
|
||||
}
|
||||
set {
|
||||
pnameField = value;
|
||||
}
|
||||
[XmlAttribute( "Pname", Form = System.Xml.Schema.XmlSchemaForm.Qualified )]
|
||||
public string ProcessorName
|
||||
{
|
||||
get { return ProcessorName_; }
|
||||
set { ProcessorName_ = Parsers.RestrictedString.Parse( value ); }
|
||||
}
|
||||
private string ProcessorName_;
|
||||
}
|
||||
}
|
|
@ -2,14 +2,13 @@ using System;
|
|||
using System.ComponentModel;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using Sprache;
|
||||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
[Serializable( )]
|
||||
public partial class MemoryType {
|
||||
|
||||
private string pnameField;
|
||||
|
||||
private MemoryIDTypeEnum idField;
|
||||
|
||||
private string startField;
|
||||
|
@ -27,18 +26,16 @@ namespace CMSIS.Pack.PackDescription
|
|||
defaultField = false;
|
||||
startupField = false;
|
||||
}
|
||||
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Pname {
|
||||
get {
|
||||
return pnameField;
|
||||
}
|
||||
set {
|
||||
pnameField = value;
|
||||
}
|
||||
[XmlAttribute( "Pname", Form = System.Xml.Schema.XmlSchemaForm.Qualified )]
|
||||
public string ProcessorName
|
||||
{
|
||||
get { return ProcessorName_; }
|
||||
set { ProcessorName_ = Parsers.RestrictedString.Parse( value ); }
|
||||
}
|
||||
|
||||
private string ProcessorName_;
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public MemoryIDTypeEnum id {
|
||||
|
|
|
@ -57,7 +57,7 @@ namespace CMSIS.Pack.PackDescription
|
|||
/// <remarks/>
|
||||
[XmlArrayItem( "board", IsNullable=false)]
|
||||
[XmlArray( "boards" )]
|
||||
public BoardType[] Boards { get; set; }
|
||||
public Board[] Boards { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlArrayItem( "description", IsNullable=false)]
|
||||
|
@ -112,7 +112,11 @@ namespace CMSIS.Pack.PackDescription
|
|||
// locations that the serializer can't handle
|
||||
using( var rdr = XmlReader.Create( textReader, new XmlReaderSettings( ) { IgnoreComments = true } ) )
|
||||
{
|
||||
return await Task.Run( ( ) => ( Package )ser.Deserialize( rdr ) );
|
||||
return await Task.Run( ( ) =>
|
||||
{
|
||||
var pkg = ( Package )ser.Deserialize( rdr );
|
||||
return pkg;
|
||||
} );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,36 +1,37 @@
|
|||
using System;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Linq;
|
||||
using Sprache;
|
||||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
/// <summary>Parser to aid in gracefully handling invalid real world PDSC files</summary>
|
||||
/// <remarks>
|
||||
/// Many real world PDSC files fail a proper schema validation due to various issues. These
|
||||
/// parsers help to ensure that these files are still usable and that any files saved by
|
||||
/// this library will properly conform. (e.g. An invalid file loaded by this library, then
|
||||
/// saved again should pass a proper schema validation.)
|
||||
/// </remarks>
|
||||
internal static class Parsers
|
||||
{
|
||||
internal static Parser<int> Integer( int minDigits, int maxDigitis )
|
||||
{
|
||||
return from value in Parse.Digit.Repeat( minDigits, maxDigitis ).Text( )
|
||||
select int.Parse( value );
|
||||
}
|
||||
|
||||
internal static Parser<decimal> Double = from value in Parse.Decimal
|
||||
select decimal.Parse( value, CultureInfo.CurrentCulture );
|
||||
internal static Parser<string> RestrictedString = Parse.LetterOrDigit
|
||||
.Or( Parse.Chars('-','_'))
|
||||
.AtLeastOnce()
|
||||
.Token()
|
||||
.Text();
|
||||
|
||||
// The official XSD and documentation for the PSDC schema lists the decimal type for many values
|
||||
// (in particular the m and n values of the 'feature' element), however some existing and supposedly
|
||||
// validated PDSC files in the real world use scaled values like '512K', which obviously won't pass
|
||||
// as a standard XSD decimal type. This simple parser will parse the numeric part and the units part
|
||||
// then scale the numeric part accordingly. The result is a valid decimal that represents the original
|
||||
// (i.e. 512K will become 524288)
|
||||
internal static Parser<decimal> ScaledDecimal = from signMul in Parse.Char('-').Return(-1).Or( Parse.Return( 1 ))
|
||||
from value in Parse.Digit.AtLeastOnce( ).Text( )
|
||||
from scale in ScaledIntMultiplier
|
||||
select signMul * decimal.Parse( value ) * scale;
|
||||
|
||||
internal static Parser<int> ScaledIntMultiplier = Parse.Chars( 'k', 'K' ).Return( 1024 )
|
||||
.Or( Parse.Chars( 'm', 'M' ).Return( 1024 * 1024 ) )
|
||||
.Or( Parse.Return( 1 ) );
|
||||
private static Parser<int> ScaledIntMultiplier = Parse.Chars( 'k', 'K' ).Return( 1024 )
|
||||
.Or( Parse.Chars( 'm', 'M' ).Return( 1024 * 1024 ) )
|
||||
.Or( Parse.Return( 1 ) );
|
||||
|
||||
internal static bool IsIntegerScaleChar( char arg )
|
||||
{
|
||||
return arg == 'k'
|
||||
|| arg == 'K'
|
||||
|| arg == 'm'
|
||||
|| arg == 'M';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using Sprache;
|
||||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
[Serializable( )]
|
||||
public partial class ProcessorType {
|
||||
|
||||
private string pnameField;
|
||||
|
||||
private DcoreEnum dcoreField;
|
||||
|
||||
private bool dcoreFieldSpecified;
|
||||
|
@ -30,18 +29,16 @@ namespace CMSIS.Pack.PackDescription
|
|||
private bool dclockFieldSpecified;
|
||||
|
||||
private string dcoreVersionField;
|
||||
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Pname {
|
||||
get {
|
||||
return pnameField;
|
||||
}
|
||||
set {
|
||||
pnameField = value;
|
||||
}
|
||||
[XmlAttribute( "Pname", Form = System.Xml.Schema.XmlSchemaForm.Qualified )]
|
||||
public string ProcessorName
|
||||
{
|
||||
get { return ProcessorName_; }
|
||||
set { ProcessorName_ = Parsers.RestrictedString.Parse( value ); }
|
||||
}
|
||||
|
||||
private string ProcessorName_;
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public DcoreEnum Dcore {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using Sprache;
|
||||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
|
@ -11,8 +10,19 @@ namespace CMSIS.Pack.PackDescription
|
|||
{
|
||||
/// <remarks/>
|
||||
[XmlAttribute( "version", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Version { get; set; }
|
||||
|
||||
[System.ComponentModel.EditorBrowsable( System.ComponentModel.EditorBrowsableState.Never )]
|
||||
public string RawVersionString
|
||||
{
|
||||
get { return Version.ToString( ); }
|
||||
set
|
||||
{
|
||||
Version = SemanticVersion.Parse( value, SemanticVersionParseOptions.PatchOptional );
|
||||
}
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public SemanticVersion Version { get; set; }
|
||||
|
||||
[XmlIgnore]
|
||||
public DateTime? Date { get; set; }
|
||||
|
||||
|
@ -23,11 +33,12 @@ namespace CMSIS.Pack.PackDescription
|
|||
/// the <see cref="Date"/> property.
|
||||
/// </remarks>
|
||||
[XmlAttribute("date", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
[System.ComponentModel.EditorBrowsable( System.ComponentModel.EditorBrowsableState.Never )]
|
||||
public string RawDateString
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.Date?.ToString("yyyy-MM-dd");
|
||||
return Date?.ToString("yyyy-MM-dd");
|
||||
}
|
||||
|
||||
set
|
||||
|
@ -46,6 +57,7 @@ namespace CMSIS.Pack.PackDescription
|
|||
/// the <see cref="Date"/> property.
|
||||
/// </remarks>
|
||||
[XmlAttribute( "deprecated", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
[System.ComponentModel.EditorBrowsable( System.ComponentModel.EditorBrowsableState.Never )]
|
||||
public string RawDeprecatedString
|
||||
{
|
||||
get
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using Sprache;
|
||||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
|
@ -13,8 +14,6 @@ namespace CMSIS.Pack.PackDescription
|
|||
|
||||
private string nameField;
|
||||
|
||||
private string pnameField;
|
||||
|
||||
private bool disableField;
|
||||
|
||||
private bool disableFieldSpecified;
|
||||
|
@ -55,18 +54,16 @@ namespace CMSIS.Pack.PackDescription
|
|||
nameField = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Pname {
|
||||
get {
|
||||
return pnameField;
|
||||
}
|
||||
set {
|
||||
pnameField = value;
|
||||
}
|
||||
[XmlAttribute( "Pname", Form = System.Xml.Schema.XmlSchemaForm.Qualified )]
|
||||
public string ProcessorName
|
||||
{
|
||||
get { return ProcessorName_; }
|
||||
set { ProcessorName_ = Parsers.RestrictedString.Parse( value ); }
|
||||
}
|
||||
|
||||
private string ProcessorName_;
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public bool disable {
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace CMSIS.Pack.PackDescription
|
|||
|
||||
private MemoryType[] memoryField;
|
||||
|
||||
private AlgorithmType[] algorithmField;
|
||||
private Algorithm[] algorithmField;
|
||||
|
||||
private BookType[] bookField;
|
||||
|
||||
|
@ -85,7 +85,7 @@ namespace CMSIS.Pack.PackDescription
|
|||
|
||||
/// <remarks/>
|
||||
[XmlElement( "algorithm")]
|
||||
public AlgorithmType[] algorithm {
|
||||
public Algorithm[] algorithm {
|
||||
get {
|
||||
return algorithmField;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using Sprache;
|
||||
|
||||
namespace CMSIS.Pack.PackDescription
|
||||
{
|
||||
|
@ -13,8 +14,6 @@ namespace CMSIS.Pack.PackDescription
|
|||
|
||||
private TraceBufferType[] tracebufferField;
|
||||
|
||||
private string pnameField;
|
||||
|
||||
private XmlAttribute[] anyAttrField;
|
||||
|
||||
/// <remarks/>
|
||||
|
@ -49,18 +48,16 @@ namespace CMSIS.Pack.PackDescription
|
|||
tracebufferField = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAttribute( Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
|
||||
public string Pname {
|
||||
get {
|
||||
return pnameField;
|
||||
}
|
||||
set {
|
||||
pnameField = value;
|
||||
}
|
||||
[XmlAttribute( "Pname", Form = System.Xml.Schema.XmlSchemaForm.Qualified )]
|
||||
public string ProcessorName
|
||||
{
|
||||
get { return ProcessorName_; }
|
||||
set { ProcessorName_ = Parsers.RestrictedString.Parse( value ); }
|
||||
}
|
||||
|
||||
private string ProcessorName_;
|
||||
|
||||
/// <remarks/>
|
||||
[XmlAnyAttribute( )]
|
||||
public XmlAttribute[ ] AnyAttr {
|
||||
|
|
|
@ -43,7 +43,7 @@ namespace CMSIS.Pack
|
|||
Vendor = parts[ 0 ];
|
||||
Name = parts[ 1 ];
|
||||
SemanticVersion version;
|
||||
if( !SemanticVersion.TryParse( packVersion, out version ) )
|
||||
if( !SemanticVersion.TryParse( packVersion, SemanticVersionParseOptions.PatchOptional, out version ) )
|
||||
throw new ArgumentException( "Invalid semantic version provided", nameof( packVersion ) );
|
||||
Version = version;
|
||||
LocalPath = Path.Combine( Vendor, Name, Version.ToString( ) );
|
||||
|
|
|
@ -6,9 +6,20 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace CMSIS.Pack
|
||||
{
|
||||
/// <summary>CMSIS-Pack repository</summary>
|
||||
/// <remarks>
|
||||
/// <para>A repository consists of a local cache and source URI to download
|
||||
/// new packages from. Packs are installed into the Local cache after
|
||||
/// they are downloaded.</para>
|
||||
/// <para>The repository contains an index of all available packs, which is
|
||||
/// downloaded from the source and parsed.</para>
|
||||
/// </remarks>
|
||||
public class PackRepository
|
||||
: IRepository
|
||||
{
|
||||
/// <summary>Constructs a new <see cref="PackRepository"/></summary>
|
||||
/// <param name="source">Uri of the source repository to download files from</param>
|
||||
/// <param name="localPath">Full path of the local repository</param>
|
||||
public PackRepository( Uri source, string localPath )
|
||||
{
|
||||
SourceUri = source;
|
||||
|
@ -18,12 +29,15 @@ namespace CMSIS.Pack
|
|||
PackIdxWatcher = new FileSystemWatcher( LocalPath, "pack.idx" );
|
||||
PackIdxWatcher.Changed += ( s, e ) => Updated( this, new RepositoryUpdateEventArgs( ) );
|
||||
}
|
||||
|
||||
|
||||
/// <summary>Constructs a new repository backed by the specified local path and downloading from the <see cref="PackIndex.DefaultIndexUriPath"/> source Uri</summary>
|
||||
/// <param name="localPath">Full path of the local repository</param>
|
||||
public PackRepository( string localPath )
|
||||
: this( new Uri( PackIndex.DefaultIndexUriPath ), localPath )
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Last time the repository's index was updated</summary>
|
||||
public DateTime LastUpdatedTimeUTC => File.GetLastWriteTimeUtc( Path.Combine( LocalPath, "pack.idx" ) );
|
||||
|
||||
public string WebRoot { get; }
|
||||
|
@ -39,17 +53,18 @@ namespace CMSIS.Pack
|
|||
public IEnumerable<IRepositoryPackage> Packs => Packs_.AsEnumerable( );
|
||||
private List<IRepositoryPackage> Packs_;
|
||||
|
||||
public Task Download( IRepositoryPackage package, IProgress<FileDownloadProgress> progressSink )
|
||||
public Task DownloadAsync( IRepositoryPackage package, IProgress<FileDownloadProgress> progressSink )
|
||||
{
|
||||
throw new NotImplementedException( );
|
||||
}
|
||||
|
||||
public Task InstallPack( IRepositoryPackage package, IProgress<PackInstallProgress> progressSink )
|
||||
{
|
||||
// unzip the package into the appropriate location in the local path
|
||||
throw new NotImplementedException( );
|
||||
}
|
||||
|
||||
public async Task LoadFromLocal()
|
||||
public async Task LoadFromLocalAsync()
|
||||
{
|
||||
Updated( this, new RepositoryUpdateEventArgs( RepositoryState.DownloadingIndex, null ) );
|
||||
Packs_ = new List<IRepositoryPackage>( );
|
||||
|
@ -62,7 +77,7 @@ namespace CMSIS.Pack
|
|||
}
|
||||
}
|
||||
|
||||
public Task UpdateLocalFromSource( ) => Task.FromResult<object>( null );
|
||||
public Task UpdateLocalFromSourceAsync( ) => Task.FromResult<object>( null );
|
||||
|
||||
private Task<PackInstallState> GetInstallState( IPackIndexEntry pack )
|
||||
{
|
||||
|
|
|
@ -62,7 +62,7 @@ namespace CMSIS.Pack
|
|||
InstallState = PackInstallState.Downloading;
|
||||
try
|
||||
{
|
||||
await Repository.Download( this, progressSink );
|
||||
await Repository.DownloadAsync( this, progressSink );
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
|
@ -3,10 +3,18 @@ using System.Collections.Generic;
|
|||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Sprache;
|
||||
|
||||
namespace CMSIS.Pack
|
||||
{
|
||||
[Flags]
|
||||
public enum SemanticVersionParseOptions
|
||||
{
|
||||
None = 0,
|
||||
PatchOptional = 1,
|
||||
//...
|
||||
}
|
||||
|
||||
/// <summary>Version structure for versions based on Semantic Versioning v2.0 as defined by http://semver.org </summary>
|
||||
/// <remarks>
|
||||
/// This class implements creating, parsing and comparing semantic version values. In
|
||||
|
@ -26,7 +34,7 @@ namespace CMSIS.Pack
|
|||
/// <param name="patch">Patch version number</param>
|
||||
/// <param name="preReleaseParts">Array of individual pre-release parts (not including the separating '.')</param>
|
||||
/// <param name="metadataParts">Array of individual Build Metadata parts (not including the separating '.')</param>
|
||||
public SemanticVersion( int major, int minor, int patch, string[] preReleaseParts, string[] metadataParts)
|
||||
public SemanticVersion( int major, int minor, int patch, string[ ] preReleaseParts, string[ ] metadataParts )
|
||||
{
|
||||
if( major < 0 )
|
||||
throw new ArgumentOutOfRangeException( nameof( major ) );
|
||||
|
@ -37,14 +45,14 @@ namespace CMSIS.Pack
|
|||
if( patch < 0 )
|
||||
throw new ArgumentOutOfRangeException( nameof( patch ) );
|
||||
|
||||
Major_ = major;
|
||||
Minor_ = minor;
|
||||
Patch_ = patch;
|
||||
PreReleaseParts_ = preReleaseParts ?? new string[0];
|
||||
BuildMetadata_ = metadataParts ?? new string[0];
|
||||
|
||||
Major = major;
|
||||
Minor = minor;
|
||||
Patch = patch;
|
||||
PreReleaseParts_ = preReleaseParts ?? new string[ 0 ];
|
||||
BuildMetadata_ = metadataParts ?? new string[ 0 ];
|
||||
|
||||
// Validate each part conforms to an "identifier" as defined by the spec
|
||||
if(!ValidateIdentifierParts( PreReleaseParts_ ) )
|
||||
if( !ValidateIdentifierParts( PreReleaseParts_ ) )
|
||||
throw new ArgumentException( "Invalid identifier for pre-release part", nameof( preReleaseParts ) );
|
||||
|
||||
if( !ValidateIdentifierParts( BuildMetadata_ ) )
|
||||
|
@ -67,6 +75,24 @@ namespace CMSIS.Pack
|
|||
{
|
||||
}
|
||||
|
||||
/// <summary>Indicates if this version is a development version (e.g. Major Version == 0 )</summary>
|
||||
public bool IsDevelopment => Major == 0;
|
||||
|
||||
/// <summary>Indicates if this version is a pre-release version (e.g. IsDevelopment or Has pre-release parts following the Patch)</summary>
|
||||
public bool IsPrerelease => IsDevelopment || PreReleaseParts.Count > 0;
|
||||
|
||||
/// <summary>Indicates if this is a valid version</summary>
|
||||
public bool IsValid => Major >= 0 && Minor >= 0 && Patch >= 0;
|
||||
|
||||
/// <summary>Major version number</summary>
|
||||
public int Major { get; }
|
||||
|
||||
/// <summary>Minor version number</summary>
|
||||
public int Minor { get; }
|
||||
|
||||
/// <summary>Patch version number</summary>
|
||||
public int Patch { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode( )
|
||||
{
|
||||
|
@ -89,7 +115,7 @@ namespace CMSIS.Pack
|
|||
if( !( obj is SemanticVersion ) )
|
||||
return false;
|
||||
|
||||
return Equals( (SemanticVersion)obj );
|
||||
return Equals( ( SemanticVersion )obj );
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
@ -102,7 +128,7 @@ namespace CMSIS.Pack
|
|||
public int CompareTo( object obj )
|
||||
{
|
||||
if( !( obj is SemanticVersion ) )
|
||||
throw new ArgumentException();
|
||||
throw new ArgumentException( );
|
||||
|
||||
return CompareTo( ( SemanticVersion )obj );
|
||||
}
|
||||
|
@ -147,13 +173,13 @@ namespace CMSIS.Pack
|
|||
|
||||
if( PreReleaseParts.Count == 0 )
|
||||
return 1;
|
||||
|
||||
|
||||
if( other.PreReleaseParts.Count == 0 )
|
||||
return -1;
|
||||
|
||||
// Rules 3.a-c
|
||||
var partCount = Math.Min( PreReleaseParts.Count, other.PreReleaseParts.Count );
|
||||
for( var i =0; i< partCount; ++i )
|
||||
for( var i = 0; i < partCount; ++i )
|
||||
{
|
||||
// rule 3.c
|
||||
retVal = string.Compare( PreReleaseParts[ i ], other.PreReleaseParts[ i ], StringComparison.Ordinal );
|
||||
|
@ -161,57 +187,27 @@ namespace CMSIS.Pack
|
|||
continue;
|
||||
|
||||
// Rule 3.a
|
||||
int left,right;
|
||||
if( !int.TryParse( PreReleaseParts[i], out left )
|
||||
int left, right;
|
||||
if( !int.TryParse( PreReleaseParts[ i ], out left )
|
||||
|| !int.TryParse( other.PreReleaseParts[ i ], out right )
|
||||
)
|
||||
{
|
||||
{
|
||||
return retVal;
|
||||
}
|
||||
return left.CompareTo( right );
|
||||
}
|
||||
|
||||
|
||||
// Rule #3.d
|
||||
return PreReleaseParts.Count.CompareTo( other.PreReleaseParts.Count );
|
||||
}
|
||||
|
||||
/// <summary>Indicates if this version is a development version (e.g. Major Version == 0 )</summary>
|
||||
public bool IsDevelopment { get { return Major_ == 0; } }
|
||||
|
||||
/// <summary>Indicates if this version is a pre-release version (e.g. IsDevelopment or Has pre-release parts following the Patch)</summary>
|
||||
public bool IsPrerelease { get { return IsDevelopment || PreReleaseParts.Count > 0; } }
|
||||
|
||||
/// <summary>Indicates if this is a valid version</summary>
|
||||
public bool IsValid { get { return Major_ >= 0 && Minor_ >=0 && Patch_ >= 0; } }
|
||||
|
||||
/// <summary>Major version number</summary>
|
||||
public int Major { get { return Major_; } }
|
||||
private readonly int Major_;
|
||||
|
||||
/// <summary>Minor version number</summary>
|
||||
public int Minor { get { return Minor_; } }
|
||||
private readonly int Minor_;
|
||||
|
||||
/// <summary>Patch version number</summary>
|
||||
public int Patch { get { return Patch_; } }
|
||||
private readonly int Patch_;
|
||||
|
||||
/// <summary>List of identifier parts forming the pre-release value</summary>
|
||||
/// <remarks>
|
||||
/// Pre-release values are optional and follow the patch with a '-'. The pre-release
|
||||
/// value can consist of multiple parts separated by a '.', this list contains the
|
||||
/// individual parts without the leading '-' or separating '.'.
|
||||
/// </remarks>
|
||||
public IReadOnlyList<string> PreReleaseParts
|
||||
{
|
||||
get
|
||||
{
|
||||
if( PreReleaseParts_ == null )
|
||||
return new string[ 0 ];
|
||||
|
||||
return Array.AsReadOnly( PreReleaseParts_ );
|
||||
}
|
||||
}
|
||||
public IReadOnlyList<string> PreReleaseParts => Array.AsReadOnly( PreReleaseParts_ ?? EmptyStringArray );
|
||||
private readonly string[ ] PreReleaseParts_;
|
||||
|
||||
/// <summary>List of identifier parts forming the build Metadata value</summary>
|
||||
|
@ -220,23 +216,11 @@ namespace CMSIS.Pack
|
|||
/// value can consist of multiple parts separated by a '.', this list contains
|
||||
/// the individual parts without the leading '+' or separating '.'.
|
||||
/// </remarks>
|
||||
public IReadOnlyList<string> BuildMetadata
|
||||
{
|
||||
get
|
||||
{
|
||||
if( BuildMetadata_ == null )
|
||||
return new string[ 0 ];
|
||||
|
||||
return Array.AsReadOnly( BuildMetadata_ );
|
||||
}
|
||||
}
|
||||
public IReadOnlyList<string> BuildMetadata => Array.AsReadOnly( BuildMetadata_ ?? EmptyStringArray );
|
||||
private readonly string[ ] BuildMetadata_;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override string ToString( )
|
||||
{
|
||||
return ToString( true );
|
||||
}
|
||||
public override string ToString( ) => ToString( true );
|
||||
|
||||
/// <summary>Creates a valid semantic version string from the component values of this version</summary>
|
||||
/// <param name="includeBuildMetadata">Flag to indicate if the Build Metadata should be included</param>
|
||||
|
@ -254,23 +238,20 @@ namespace CMSIS.Pack
|
|||
bldr.Append( '-' );
|
||||
bldr.Append( string.Join( ".", PreReleaseParts ) );
|
||||
}
|
||||
|
||||
if( BuildMetadata.Count > 0 && includeBuildMetadata)
|
||||
|
||||
if( BuildMetadata.Count > 0 && includeBuildMetadata )
|
||||
{
|
||||
bldr.Append( '+' );
|
||||
bldr.Append( string.Join( ".", BuildMetadata ) );
|
||||
}
|
||||
|
||||
return bldr.ToString();
|
||||
return bldr.ToString( );
|
||||
}
|
||||
|
||||
/// <summary>Parse a semantic version string into it's component parts</summary>
|
||||
/// <param name="versionString">String containing the version to parse</param>
|
||||
/// <returns>Parsed version details</returns>
|
||||
public static SemanticVersion Parse( string versionString )
|
||||
{
|
||||
return Parse( versionString, false );
|
||||
}
|
||||
public static SemanticVersion Parse( string versionString ) => Parse( versionString, SemanticVersionParseOptions.None );
|
||||
|
||||
/// <summary>Parse a semantic version string into it's component parts</summary>
|
||||
/// <param name="versionString">String containing the version to parse</param>
|
||||
|
@ -280,65 +261,42 @@ namespace CMSIS.Pack
|
|||
/// This overload of Parse allows for a non-standard version where the Patch value
|
||||
/// defaults to 0 if not present, instead of triggering an exception.
|
||||
/// </remarks>
|
||||
public static SemanticVersion Parse( string versionString, bool patchOptional )
|
||||
public static SemanticVersion Parse( string versionString, SemanticVersionParseOptions options )
|
||||
{
|
||||
var match = SemVersionRegEx.Match( versionString );
|
||||
if( !match.Success )
|
||||
throw new FormatException();
|
||||
|
||||
var major = int.Parse( match.Groups["Major"].Value );
|
||||
var minor = int.Parse( match.Groups["Minor"].Value );
|
||||
int patch = 0;
|
||||
var patchGroup = match.Groups["Patch"];
|
||||
if( !patchOptional || patchGroup.Success )
|
||||
patch = int.Parse( patchGroup.Value );
|
||||
|
||||
var preReleaseGroup = match.Groups["PreRelease"];
|
||||
var preReleaseParts = new string[ 0 ];
|
||||
if( preReleaseGroup.Success )
|
||||
preReleaseParts = preReleaseGroup.Value.Split( '.' );
|
||||
|
||||
var metadataGroup = match.Groups["Metadata"];
|
||||
var metadataParts = new string[ 0 ];
|
||||
if( metadataGroup.Success )
|
||||
metadataParts = metadataGroup.Value.Split( '.' );
|
||||
|
||||
return new SemanticVersion( major, minor, patch, preReleaseParts, metadataParts );
|
||||
try
|
||||
{
|
||||
var parser = SemanticVersionParser( options.HasFlag( SemanticVersionParseOptions.PatchOptional ) );
|
||||
return parser.Parse( versionString );
|
||||
}
|
||||
catch( ParseException ex )
|
||||
{
|
||||
throw new FormatException("Invalid SemanticVersion", ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Attempts to parse a version string into a new SemanticVersion instance</summary>
|
||||
/// <param name="versionString">String to parse</param>
|
||||
/// <param name="version">Version instance to construct</param>
|
||||
/// <returns>true if the string is a valid semantic version string that was successfully parsed into <paramref name="version"/></returns>
|
||||
public static bool TryParse( string versionString, out SemanticVersion version )
|
||||
public static bool TryParse( string versionString, out SemanticVersion version)
|
||||
{
|
||||
return TryParse( versionString, SemanticVersionParseOptions.None, out version );
|
||||
}
|
||||
|
||||
/// <summary>Attempts to parse a version string into a new SemanticVersion instance</summary>
|
||||
/// <param name="versionString">String to parse</param>
|
||||
/// <param name="options">Options flags to control parsing variants and ambiguities in the spec</param>
|
||||
/// <param name="version">Version instance to construct</param>
|
||||
/// <returns>true if the string is a valid semantic version string that was successfully parsed into <paramref name="version"/></returns>
|
||||
public static bool TryParse( string versionString, SemanticVersionParseOptions options, out SemanticVersion version )
|
||||
{
|
||||
version = new SemanticVersion();
|
||||
var match = SemVersionRegEx.Match( versionString );
|
||||
if( !match.Success )
|
||||
return false;
|
||||
|
||||
int major,minor,patch;
|
||||
|
||||
if( !int.TryParse( match.Groups["Major"].Value, out major ) )
|
||||
var parser = SemanticVersionParser( options.HasFlag( SemanticVersionParseOptions.PatchOptional ) );
|
||||
var result = parser.TryParse( versionString );
|
||||
if( !result.WasSuccessful )
|
||||
return false;
|
||||
|
||||
if( !int.TryParse( match.Groups["Minor"].Value, out minor ) )
|
||||
return false;
|
||||
|
||||
if( !int.TryParse( match.Groups["Patch"].Value, out patch ) )
|
||||
return false;
|
||||
|
||||
var preReleaseGroup = match.Groups[ "PreRelease" ];
|
||||
var preReleaseParts = new string[ 0 ];
|
||||
if( preReleaseGroup.Success )
|
||||
preReleaseParts = preReleaseGroup.Value.Split( '.' );
|
||||
|
||||
var metadataGroup = match.Groups[ "Metadata" ];
|
||||
var metadataParts = new string[ 0 ];
|
||||
if( metadataGroup.Success )
|
||||
metadataParts = metadataGroup.Value.Split( '.' );
|
||||
|
||||
version = new SemanticVersion(major, minor, patch, preReleaseParts, metadataParts );
|
||||
version = result.Value;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -346,7 +304,7 @@ namespace CMSIS.Pack
|
|||
/// <param name="lhs">Left hand side of the comparison</param>
|
||||
/// <param name="rhs">Right hand side of the comparison</param>
|
||||
/// <returns><see langword="true"/> if the two versions are equivalent</returns>
|
||||
public static bool operator==(SemanticVersion lhs, SemanticVersion rhs)
|
||||
public static bool operator ==( SemanticVersion lhs, SemanticVersion rhs )
|
||||
{
|
||||
return lhs.Equals( rhs );
|
||||
}
|
||||
|
@ -360,40 +318,107 @@ namespace CMSIS.Pack
|
|||
return !lhs.Equals( rhs );
|
||||
}
|
||||
|
||||
private static bool ValidateIdentifierParts( IEnumerable< string > metadataParts )
|
||||
private static bool ValidateIdentifierParts( IEnumerable<string> metadataParts )
|
||||
{
|
||||
var q = from part in metadataParts
|
||||
let match = IdentifierRegEx.Match( part )
|
||||
where !match.Success || match.Index != 0 || match.Length != part.Length
|
||||
let result = Identifier.End().TryParse( part )
|
||||
where !result.WasSuccessful
|
||||
select part;
|
||||
return !q.Any();
|
||||
return !q.Any( );
|
||||
}
|
||||
|
||||
private int ComputeHashCode()
|
||||
{
|
||||
return ToString( false ).GetHashCode( );
|
||||
}
|
||||
|
||||
private int ComputeHashCode( ) => ToString( false ).GetHashCode( );
|
||||
|
||||
// this is intentionally not a read-only field
|
||||
// its a private field and used like a C++ mutable.
|
||||
// It caches the HashCode that's expensive to compute
|
||||
// so it is only done once.
|
||||
private int? HashCode;
|
||||
|
||||
private static readonly Regex IdentifierRegEx = new Regex("[1-9A-Za-z-][0-9A-Za-z-]*");
|
||||
// When using the default constructor the pre-release and build meta arrays will be null
|
||||
// The property accessors for those arrays will test for null and use this singleton empty
|
||||
// array if null to prevent null reference issues.
|
||||
static readonly string[] EmptyStringArray = new string [0];
|
||||
|
||||
// see: http://semver.org/
|
||||
// Semantic version is:
|
||||
// Major'.'Minor'.'Patch('-'Identifier('.'Identifier)*)?('+'Identifier('.'Identifier)*)?
|
||||
// Where Major,Minor and Patch match 0|[1-9][0-9]* (0 or a non-leading zero sequence of digits)
|
||||
// Identifier is a sequence of ASCII alphanumerics or '-' without a leading 0
|
||||
// the - signifies the pre-release information and impacts precedence if present
|
||||
// the + signifies the build meta data and has no impact on precedence
|
||||
private const string SemVerRegExPattern = "(?<Major>(0|[1-9][0-9]*))"
|
||||
+ @"\.(?<Minor>(0|[1-9][0-9]*))"
|
||||
+ @"(\.(?<Patch>(0|[1-9][0-9]*)))?"
|
||||
+ @"(-(?<PreRelease>[1-9A-Za-z-][0-9A-Za-z-]*(\.[1-9A-Za-z-][0-9A-Za-z-]*)*))?"
|
||||
+ @"(\+(?<Metadata>[1-9A-Za-z-][0-9A-Za-z-]*(\.[1-9A-Za-z-][0-9A-Za-z-]*)*))?";
|
||||
private static readonly Regex SemVersionRegEx = new Regex(SemVerRegExPattern);
|
||||
#region static parsers
|
||||
private static bool IsAnyIdentifierChar( char c ) => ( char.IsLetterOrDigit( c ) && c < 127) || c == '-';
|
||||
private static bool IsNonDigitIdentifierChar( char c ) => ( char.IsLetter( c ) && c < 127 ) || c== '-';
|
||||
|
||||
private static Parser<char> NonZeroDigit = Sprache.Parse.Chars('1','2','3','4','5','6','7','8','9');
|
||||
|
||||
private static Parser<IEnumerable<char>> NonLeadingZeroDigits = NonZeroDigit.AtLeastOnce().Concat( Sprache.Parse.Digit.Many() );
|
||||
|
||||
private static Parser<int> NonLeadingZeroInteger = from value in NonLeadingZeroDigits.Text()
|
||||
select int.Parse(value);
|
||||
|
||||
private static Parser<int> ZeroOrNonLeadingZeroInteger = Sprache.Parse.Char('0').Return( 0 )
|
||||
.Or( NonLeadingZeroInteger );
|
||||
|
||||
private static Parser<char> IdentifierChar = Sprache.Parse.Char( IsAnyIdentifierChar, "ASCII alphanumeric or hyphen");
|
||||
private static Parser<char> NonDigitIdentifierChar = Sprache.Parse.Char( IsNonDigitIdentifierChar, "Non digit alphanumeric ASCII or hyphen");
|
||||
|
||||
private static Parser<char> Dot = Sprache.Parse.Char('.');
|
||||
|
||||
// SPEC AMBIGUITY: Rule 9 states "Numeric identifiers MUST NOT include leading zeroes" but fails to specify
|
||||
// a definition of NumericIdentifier. It's reasonable to presume that it is intended to mean an all numeric
|
||||
// identifier thus '01234' is invalid, but what about '0abcd'?
|
||||
// This implementation presumes that an identifier that is not all digits can contain a leading 0 as that
|
||||
// is the most literal interpretation of the spec and also is a fairly reasonable one. Especially, given the
|
||||
// precedence rule 11 where it effectively defines a Numeric Identifier as one that is all digits for the
|
||||
// purposes of establishing precedence.
|
||||
private static Parser<string> NumericIdentifier = NonLeadingZeroDigits.Text();
|
||||
private static Parser<string> AlphaNumericIdentifier = NonDigitIdentifierChar.AtLeastOnce().Concat( IdentifierChar.Many() ).Text();
|
||||
|
||||
private static Parser<string> Identifier = NumericIdentifier.Or( AlphaNumericIdentifier );
|
||||
private static Parser<string[]> IdentifierSequence = from seq in Identifier.DelimitedBy( Dot )
|
||||
select seq.ToArray();
|
||||
|
||||
private static Parser<string[]> PreRelease = from sep in Sprache.Parse.Char('-').Once()
|
||||
from ident in IdentifierSequence
|
||||
select ident;
|
||||
|
||||
private static Parser<string[]> BuildMeta = from sep in Sprache.Parse.Char('+').Once()
|
||||
from ident in IdentifierSequence
|
||||
select ident;
|
||||
|
||||
private static Parser<int> BuildIntegerWithSep = from sep in Dot
|
||||
from patch in ZeroOrNonLeadingZeroInteger
|
||||
select patch;
|
||||
|
||||
private static Parser<int> BuildInteger( bool optional )
|
||||
{
|
||||
if( !optional )
|
||||
{
|
||||
return BuildIntegerWithSep;
|
||||
}
|
||||
else
|
||||
{
|
||||
return i =>
|
||||
{
|
||||
if( i.AtEnd )
|
||||
return Result.Success( 0, i );
|
||||
|
||||
var parser = BuildIntegerWithSep.Optional( );
|
||||
var result = parser( i );
|
||||
return Result.Success( result.Value.GetOrDefault(), result.Remainder );
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private static Parser<SemanticVersion> SemanticVersionParser( bool patchOptional )
|
||||
{
|
||||
return from major in ZeroOrNonLeadingZeroInteger
|
||||
from minor in BuildInteger( optional: false )
|
||||
from patch in BuildInteger( optional: patchOptional )
|
||||
from preRelease in PreRelease.Optional()
|
||||
from buildMetadata in BuildMeta.Optional()
|
||||
select new SemanticVersion( major
|
||||
, minor
|
||||
, patch
|
||||
, preRelease.GetOrDefault()
|
||||
, buildMetadata.GetOrDefault()
|
||||
);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -31,7 +31,7 @@ namespace NetmfPackInstaller
|
|||
|
||||
internal async Task LoadAsync( )
|
||||
{
|
||||
await Repository.LoadFromLocal( );
|
||||
await Repository.LoadFromLocalAsync( );
|
||||
|
||||
State = LoadState.ParsingDescriptions;
|
||||
foreach( var pack in Repository.Packs )
|
||||
|
@ -72,7 +72,7 @@ namespace NetmfPackInstaller
|
|||
|
||||
private async void RefreshIndexAsync( )
|
||||
{
|
||||
await Repository.UpdateLocalFromSource( );
|
||||
await Repository.UpdateLocalFromSourceAsync( );
|
||||
}
|
||||
|
||||
private readonly PackRepository Repository;
|
||||
|
|
|
@ -129,7 +129,7 @@ namespace UnitTests
|
|||
[TestMethod]
|
||||
public void StaticParseDefaultPatchTest()
|
||||
{
|
||||
var ver = SemanticVersion.Parse( "0.1-alpha.beta+foo-bar.baz", patchOptional:true );
|
||||
var ver = SemanticVersion.Parse( "0.1-alpha.beta+foo-bar.baz", SemanticVersionParseOptions.PatchOptional );
|
||||
Assert.AreEqual( 0, ver.Major );
|
||||
Assert.AreEqual( 1, ver.Minor );
|
||||
Assert.AreEqual( 0, ver.Patch );
|
||||
|
@ -146,6 +146,37 @@ namespace UnitTests
|
|||
VerifyToStringReverseParse( ver );
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void StaticParseSimpleMajorMinorOnlyTest( )
|
||||
{
|
||||
var ver = SemanticVersion.Parse( "2.1", SemanticVersionParseOptions.PatchOptional );
|
||||
Assert.AreEqual( 2, ver.Major );
|
||||
Assert.AreEqual( 1, ver.Minor );
|
||||
Assert.AreEqual( 0, ver.Patch );
|
||||
Assert.IsTrue( ver.IsValid );
|
||||
Assert.IsFalse( ver.IsDevelopment );
|
||||
Assert.IsFalse( ver.IsPrerelease );
|
||||
Assert.AreEqual( 0, ver.PreReleaseParts.Count );
|
||||
VerifyToStringReverseParse( ver );
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void StaticParseNumericIdentifier()
|
||||
{
|
||||
var ver = SemanticVersion.Parse( "2.0.1-2.alpha", SemanticVersionParseOptions.PatchOptional );
|
||||
Assert.AreEqual( 2, ver.Major );
|
||||
Assert.AreEqual( 0, ver.Minor );
|
||||
Assert.AreEqual( 1, ver.Patch );
|
||||
Assert.IsTrue( ver.IsValid );
|
||||
Assert.IsFalse( ver.IsDevelopment );
|
||||
Assert.IsTrue( ver.IsPrerelease );
|
||||
Assert.AreEqual( 2, ver.PreReleaseParts.Count );
|
||||
Assert.AreEqual( "2", ver.PreReleaseParts[ 0 ] );
|
||||
Assert.AreEqual( "alpha", ver.PreReleaseParts[ 1 ] );
|
||||
Assert.AreEqual( 0, ver.BuildMetadata.Count );
|
||||
Assert.AreEqual( "2.0.1-2.alpha", ver.ToString( ) );
|
||||
VerifyToStringReverseParse( ver );
|
||||
}
|
||||
[TestMethod]
|
||||
[ExpectedException(typeof(FormatException))]
|
||||
public void StaticParseDefaultPatchExceptionTest()
|
||||
|
|
Загрузка…
Ссылка в новой задаче