Added documentation to Attribute builder. Added Inheritance methods. Added a base DNA attribute to GenerateTypeDeclarations method.
This commit is contained in:
@@ -21,6 +21,7 @@ namespace CodeGenerator {
|
||||
private const string OutPath = @"GeneratedOutput";
|
||||
private const string Namespace = "BlendFile";
|
||||
private static HashSet<string> _customTypes;
|
||||
|
||||
private static readonly string[] ListLenghtStr = {"count", "length", "size"};
|
||||
|
||||
private static void Log(string message) {
|
||||
@@ -142,12 +143,18 @@ namespace CodeGenerator {
|
||||
var attributeBuilder = new AttributeBuilder();
|
||||
|
||||
var typeDeclarations = new CodeTypeDeclaration[] {
|
||||
attributeBuilder.New().SetName("DNAAttribute")
|
||||
.SetAttributeUsage(new (new CodeSnippetExpression("AttributeTargets.All")))
|
||||
.AddAutoProperty(typeof(int), "OriginalIndex")
|
||||
.AddAutoProperty(typeof(string), "OriginalName")
|
||||
.AddPropertiesConstructor()
|
||||
.Build(),
|
||||
attributeBuilder.New().SetName("DNAFieldAttribute")
|
||||
.SetAttributeUsage(new (new CodeSnippetExpression("AttributeTargets.Field")))
|
||||
.AddAutoProperty(typeof(int), "Size")
|
||||
.AddAutoProperty(typeof(string), "OriginalType")
|
||||
.AddAutoProperty(typeof(string), "OriginalName")
|
||||
.AddAutoProperty(typeof(int), "OriginalIndex")
|
||||
.AddAutoProperty(typeof(string), "OriginalName")
|
||||
.AddAutoProperty(typeof(string), "UnderlyingType")
|
||||
.AddAutoProperty(typeof(bool), "IsPointer")
|
||||
.AddAutoProperty(typeof(int), "MemoryOffset")
|
||||
@@ -155,9 +162,21 @@ namespace CodeGenerator {
|
||||
.Build(),
|
||||
attributeBuilder.New().SetName("DNAClassAttribute")
|
||||
.SetAttributeUsage(new (new CodeSnippetExpression("AttributeTargets.Class | AttributeTargets.Struct")))
|
||||
.AddAutoProperty(typeof(int), "Size")
|
||||
.AddAutoProperty(typeof(int), "OriginalIndex")
|
||||
.AddAutoProperty(typeof(string), "OriginalName")
|
||||
.AddPropertiesConstructor()
|
||||
.Build(),
|
||||
attributeBuilder.New().SetName("DNAListAttribute")
|
||||
.SetAttributeUsage(new (new CodeSnippetExpression("AttributeTargets.Property | AttributeTargets.Field")))
|
||||
.AddAutoProperty(typeof(int), "Size")
|
||||
.AddAutoProperty(typeof(string), "OriginalType")
|
||||
.AddAutoProperty(typeof(string), "OriginalName")
|
||||
.AddAutoProperty(typeof(int), "OriginalIndex")
|
||||
.AddAutoProperty(typeof(string), "UnderlyingType")
|
||||
.AddAutoProperty(typeof(string), "CountFieldName")
|
||||
.AddAutoProperty(typeof(int), "CountFieldIndex")
|
||||
.AddAutoProperty(typeof(int), "MemoryOffset")
|
||||
.AddPropertiesConstructor()
|
||||
.Build()
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user