[csdoc-patches] CVS: csdoc/src/csdoc/MCSDoc ChangeLog,1.9,1.10 ClassDoc.cs,1.3,1.4 RootDoc.cs,1.5,1.
Status: Planning
Brought to you by:
mastergaurav
|
From: Gaurav V. <mas...@us...> - 2003-03-28 15:30:34
|
Update of /cvsroot/csdoc/csdoc/src/csdoc/MCSDoc
In directory sc8-pr-cvs1:/tmp/cvs-serv6202
Modified Files:
ChangeLog ClassDoc.cs RootDoc.cs
Log Message:
2003-03-28
* RootDoc.cs : Populated all. Will take a second
look sometime later, especially for PopulateInners.
Have to take of if class is an attribute.
* AttributeDoc.cs : Initial implementation
* ClassDoc.cs : Class { get; } - Added.
: Accessibility - internal.
Index: ChangeLog
===================================================================
RCS file: /cvsroot/csdoc/csdoc/src/csdoc/MCSDoc/ChangeLog,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ChangeLog 28 Mar 2003 14:23:53 -0000 1.9
+++ ChangeLog 28 Mar 2003 15:30:17 -0000 1.10
@@ -1,6 +1,15 @@
2003-03-28 Gaurav Vaish <mastergaurav AT users DOT sf DOT net>
+ * RootDoc.cs : Populated all. Will take a second
+ look sometime later, especially for PopulateInners.
+ Have to take of if class is an attribute.
+ * AttributeDoc.cs : Initial implementation
+ * ClassDoc.cs : Class { get; } - Added.
+ : Accessibility - internal.
+
+2003-03-28 Gaurav Vaish <mastergaurav AT users DOT sf DOT net>
+
* ClassDoc.cs : Parse() - Some impl.
* RootDoc.cs : PopulateTypeContainers - Init Impl.
* NamespaceDoc.cs : Initial implementation.
Index: ClassDoc.cs
===================================================================
RCS file: /cvsroot/csdoc/csdoc/src/csdoc/MCSDoc/ClassDoc.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ClassDoc.cs 28 Mar 2003 14:23:55 -0000 1.3
+++ ClassDoc.cs 28 Mar 2003 15:30:22 -0000 1.4
@@ -13,7 +13,7 @@
namespace MCSDoc
{
- public class ClassDoc : IClassDoc
+ internal class ClassDoc : IClassDoc
{
private Class klass;
private string name;
@@ -42,8 +42,16 @@
*/
if(klass.BaseType != null)
{
- isAttribute = klass.BaseType.IsSubclassOf(typeof(Attribute));
- isException = klass.BaseType.IsSubclassOf(typeof(Exception));
+ isAttribute = (klass.BaseType.ToString() == "System.Attribute");
+ isException = (klass.BaseType.ToString() == "System.Exception");
+ }
+ }
+
+ protected Class Class
+ {
+ get
+ {
+ return this.klass;
}
}
Index: RootDoc.cs
===================================================================
RCS file: /cvsroot/csdoc/csdoc/src/csdoc/MCSDoc/RootDoc.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- RootDoc.cs 28 Mar 2003 14:23:57 -0000 1.5
+++ RootDoc.cs 28 Mar 2003 15:30:24 -0000 1.6
@@ -49,13 +49,23 @@
{
ArrayList classes = new ArrayList();
ArrayList structs = new ArrayList();
-
+
foreach(TypeContainer tc in containers)
{
if(tc is Class)
{
Class c = (Class)tc;
- ClassDoc cd = new ClassDoc(c);
+ ClassDoc cd = null;
+ if(c.BaseType != null)
+ {
+ if(c.BaseType.ToString() == "System.Attribute")
+ {
+ cd = new AttributeDoc(c);
+ }
+ } else
+ {
+ cd = new ClassDoc(c);
+ }
if(c.Namespace != null && c.Namespace.Name.Length > 0)
{
HandleNamespaceClass(c, cd);
@@ -76,36 +86,48 @@
}
PopulateInners(tc.Types);
}
+
+ if(classes.Count > 0)
+ {
+ this.classes = (IClassDoc[]) classes.ToArray(typeof(IClassDoc));
+ }
+
+ if(structs.Count > 0)
+ {
+ this.structs = (IClassDoc[]) classes.ToArray(typeof(IStructDoc));
+ }
}
}
private NamespaceDoc NamespaceLookup(string name)
{
+ NamespaceDoc retVal = null;
foreach(NamespaceDoc current in namespaceList)
{
if(current.Name == name)
- return current;
+ {
+ return retVal = current;
+ break;
+ }
+ }
+
+ if(retVal == null)
+ {
+ retVal = new NamespaceDoc(name);
+ namespaceList.Add(nsd);
}
- return null;
+ return retVal;
}
private void HandleNamespaceClass(Class klass, ClassDoc doc)
{
NamespaceDoc nsd = NamespaceLookup(klass.Namespace.Name);
- if(nsd == null)
- {
- nsd = new NamespaceDoc(klass.Namespace.Name);
- }
nsd.AddClassDoc(doc);
}
private void HandleNamespaceStruct(Struct esstruct, StructDoc doc)
{
NamespaceDoc nsd = NamespaceLookup(esstruct.Namespace.Name);
- if(nsd == null)
- {
- nsd = new NamespaceDoc(esstruct.Namespace.Name);
- }
nsd.AddStructDoc(doc);
}
@@ -116,17 +138,59 @@
private void PopulateEnums(ArrayList enums)
{
- throw new NotImplementedException();
+ if(enums != null && enums.Count > 0)
+ {
+ ArrayList enumDocs = new ArrayList();
+ EnumDoc doc;
+ foreach(Mono.CSharp.Enum current in enums)
+ {
+ doc = new EnumDoc(current);
+ enumDocs.Add(doc);
+ }
+
+ if(enumDocs.Count > 0)
+ {
+ this.enums = (IEnumDoc[]) enumDocs.ToArray(typeof(IEnumDoc));
+ }
+ }
}
private void PopulateDelegates(ArrayList delegates)
{
- throw new NotImplementedException();
+ if(delegates != null && delegates.Count > 0)
+ {
+ ArrayList delegateDocs = new ArrayList();
+ DelegateDoc doc;
+ foreach(Delegate current in delegates)
+ {
+ doc = new DelegateDoc(current);
+ delegateDocs.Add(doc);
+ }
+
+ if(delegateDocs.Count > 0)
+ {
+ this.delegates = (IDelegateDoc[]) enumDocs.ToArray(typeof(IDelegateDoc));
+ }
+ }
}
private void PopulateInterfaces(ArrayList interfaces)
{
- throw new NotImplementedException();
+ if(interfaces != null && interfaces.Count > 0)
+ {
+ ArrayList interfaceDocs = new ArrayList();
+ InterfaceDoc doc;
+ foreach(Interface current in interfaces)
+ {
+ doc = new DelegateDoc(current);
+ interfaceDocs.Add(doc);
+ }
+
+ if(interfaceDocs.Count > 0)
+ {
+ this.interfaces = (IInterfaceDoc[]) enumDocs.ToArray(typeof(IInterfaceDoc));
+ }
+ }
}
}
}
|