mirror of https://github.com/mono/CppSharp.git
3 changed files with 0 additions and 53 deletions
@ -1,39 +0,0 @@ |
|||||||
using System; |
|
||||||
using System.Linq; |
|
||||||
using System.Xml.Linq; |
|
||||||
using System.Collections.Generic; |
|
||||||
|
|
||||||
namespace Cxxi |
|
||||||
{ |
|
||||||
public enum FilterMode { |
|
||||||
Include, |
|
||||||
Exclude, |
|
||||||
External |
|
||||||
} |
|
||||||
|
|
||||||
public enum ImplementationType { |
|
||||||
@class, |
|
||||||
@struct |
|
||||||
} |
|
||||||
|
|
||||||
public struct Filter { |
|
||||||
|
|
||||||
public string TypeName { get; set; } |
|
||||||
public FilterMode Mode { get; set; } |
|
||||||
public ImplementationType ImplType { get; set; } |
|
||||||
|
|
||||||
public static Dictionary<string, Filter> Load (XDocument doc, out FilterMode @default) |
|
||||||
{ |
|
||||||
string value; |
|
||||||
@default = (value = (string)doc.Root.Attribute ("default")) != null ? (FilterMode)System.Enum.Parse (typeof (FilterMode), value) : FilterMode.Include; |
|
||||||
|
|
||||||
var rules = from rule in doc.Root.Elements () |
|
||||||
let mode = (FilterMode)System.Enum.Parse (typeof (FilterMode), rule.Name.LocalName) |
|
||||||
let impl = (value = (string)rule.Attribute ("implementation")) != null ? (ImplementationType)System.Enum.Parse (typeof (ImplementationType), value) : ImplementationType.@class |
|
||||||
select new Filter { TypeName = rule.Value, Mode = mode, ImplType = impl }; |
|
||||||
|
|
||||||
|
|
||||||
return rules.ToDictionary<Filter,string> (r => r.TypeName); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
@ -1,10 +0,0 @@ |
|||||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||||
<TransformationPropertyValues xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> |
|
||||||
<Values> |
|
||||||
<TransformationPropertyValue> |
|
||||||
<FileName>Templates\CSharpModule.tt</FileName> |
|
||||||
<PropertyName>Host</PropertyName> |
|
||||||
<Value>VisualStudio</Value> |
|
||||||
</TransformationPropertyValue> |
|
||||||
</Values> |
|
||||||
</TransformationPropertyValues> |
|
Loading…
Reference in new issue