forked from ful-stackz/SharpCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStructures.cs
More file actions
165 lines (107 loc) · 4.74 KB
/
Structures.cs
File metadata and controls
165 lines (107 loc) · 4.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
using System.Collections.Generic;
using Optional;
namespace SharpCode
{
/// <summary>
/// Represents the access modifier of a C# structure.
/// </summary>
public enum AccessModifier
{
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
None,
Private,
Internal,
Protected,
Public,
PrivateInternal,
ProtectedInternal,
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
}
internal class Field
{
public AccessModifier AccessModifier { get; set; } = AccessModifier.Private;
public bool IsReadonly { get; set; }
public string? Type { get; set; }
public string? Name { get; set; }
public Option<string?> Summary { get; set; } = Option.None<string?>();
}
internal class Property
{
public AccessModifier AccessModifier { get; set; } = AccessModifier.Public;
public bool IsStatic { get; set; } = false;
public string? Type { get; set; }
public string? Name { get; set; }
public Option<string?> Summary { get; set; } = Option.None<string?>();
public Option<string> DefaultValue { get; set; } = Option.None<string>();
public Option<string?> Getter { get; set; } = Option.Some<string?>(null);
public Option<string?> Setter { get; set; } = Option.Some<string?>(null);
}
internal class Parameter
{
public string? Type { get; set; }
public string? Name { get; set; }
public string? ReceivingMember { get; set; }
}
internal class Constructor
{
public AccessModifier AccessModifier { get; set; } = AccessModifier.Public;
public bool IsStatic { get; set; } = false;
public string? ClassName { get; set; }
public Option<string?> Summary { get; set; } = Option.None<string?>();
public List<Parameter> Parameters { get; } = new List<Parameter>();
public Option<IEnumerable<string>> BaseCallParameters { get; set; } = Option.None<IEnumerable<string>>();
}
internal class Class
{
public AccessModifier AccessModifier { get; set; } = AccessModifier.Public;
public bool IsStatic { get; set; } = false;
public string? Name { get; set; }
public Option<string?> Summary { get; set; } = Option.None<string?>();
public Option<string> InheritedClass { get; set; } = Option.None<string>();
public List<string> ImplementedInterfaces { get; } = new List<string>();
public List<Field> Fields { get; } = new List<Field>();
public List<Property> Properties { get; } = new List<Property>();
public List<Constructor> Constructors { get; } = new List<Constructor>();
}
internal class Struct
{
public AccessModifier AccessModifier { get; set; } = AccessModifier.Public;
public string? Name { get; set; }
public Option<string?> Summary { get; set; } = Option.None<string?>();
public List<string?> ImplementedInterfaces { get; } = new List<string?>();
public List<Constructor> Constructors { get; } = new List<Constructor>();
public List<Field> Fields { get; } = new List<Field>();
public List<Property> Properties { get; } = new List<Property>();
}
internal class Interface
{
public AccessModifier AccessModifier { get; set; } = AccessModifier.Public;
public string? Name { get; set; }
public Option<string?> Summary { get; set; } = Option.None<string?>();
public List<string> ImplementedInterfaces { get; } = new List<string>();
public List<Property> Properties { get; } = new List<Property>();
}
internal class EnumerationMember
{
public string? Name { get; set; }
public Option<int> Value { get; set; } = Option.None<int>();
public Option<string?> Summary { get; set; } = Option.None<string?>();
}
internal class Enumeration
{
public AccessModifier AccessModifier { get; set; } = AccessModifier.Public;
public string? Name { get; set; }
public Option<string?> Summary { get; set; } = Option.None<string?>();
public bool IsFlag { get; set; }
public List<EnumerationMember> Members { get; } = new List<EnumerationMember>();
}
internal class Namespace
{
public string? Name { get; set; }
public List<string> Usings { get; } = new List<string>();
public List<Class> Classes { get; } = new List<Class>();
public List<Struct> Structs { get; } = new List<Struct>();
public List<Interface> Interfaces { get; } = new List<Interface>();
public List<Enumeration> Enums { get; } = new List<Enumeration>();
}
}