Update of /cvsroot/csdoc/csdoc/src/csdoc/MCSDoc
In directory sc8-pr-cvs1:/tmp/cvs-serv13525
Modified Files:
ChangeLog NamespaceDoc.cs
Log Message:
2003-04-01
* NamespaceDoc.cs : Name { get; } - Added,
CreateHierarchy(ArrayList) - Init impl,
IsNamespaceAdded(string, ArrayList),
IsNamespaceAdded(string, NamespaceDoc),
GetSubnames(string) - Added.
Index: ChangeLog
===================================================================
RCS file: /cvsroot/csdoc/csdoc/src/csdoc/MCSDoc/ChangeLog,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- ChangeLog 1 Apr 2003 16:36:47 -0000 1.12
+++ ChangeLog 1 Apr 2003 16:53:47 -0000 1.13
@@ -1,6 +1,14 @@
2003-04-01 Gaurav Vaish <mastergaurav AT users DOT sf DOT net>
+ * NamespaceDoc.cs : Name { get; } - Added,
+ CreateHierarchy(ArrayList) - Init impl,
+ IsNamespaceAdded(string, ArrayList),
+ IsNamespaceAdded(string, NamespaceDoc),
+ GetSubnames(string) - Added.
+
+2003-04-01 Gaurav Vaish <mastergaurav AT users DOT sf DOT net>
+
* INamespaceDoc.cs : Namespaces { get; } - Sub-namespaces.
* DocTreeGenerator.cs : Parsing done. Generation to start.
* NamespaceDoc.cs : CreateHierarchy(ArrayList) - Stubbed.
Index: NamespaceDoc.cs
===================================================================
RCS file: /cvsroot/csdoc/csdoc/src/csdoc/MCSDoc/NamespaceDoc.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- NamespaceDoc.cs 1 Apr 2003 16:36:48 -0000 1.2
+++ NamespaceDoc.cs 1 Apr 2003 16:53:47 -0000 1.3
@@ -40,12 +40,84 @@
public static ArrayList CreateHierarchy(ArrayList namespaceDocs)
{
ArrayList retVal = new ArrayList();
+ string name;
+ string[] subNames;
if(namespaceDocs != null && namespaceDocs.Count > 0)
{
+ foreach(NamespaceDoc nd in namespaces)
+ {
+ name = nd.Name;
+ // is this namespace is not added,
+ // check for its parent ones
+ bool isAdded = IsNamespaceAdded(name, retVal);
+ if(!isAdded)
+ {
+ subNames = GetSubnames(name);
+ if(subNames != null)
+ {
+ foreach(string subName in subNames)
+ {
+ isAdded &= IsNamespaceAdded(subName,
+ retVal);
+ if(isAdded)
+ break;
+ }
+ }
+ }
+ throw new NotImplementedException();
+ //if(!isAdded)
+ // AddNamespaceInHierarchy(name,
+
+ }
throw new NotImplementedException();
}
}
+ private static bool IsNamespaceAdded(string name, ArrayList namespaces)
+ {
+ foreach(NamespaceDoc nsd in namespaces)
+ {
+ if(IsNamespaceAdded(name, nsd)
+ return true;
+ }
+ return false;
+ }
+
+ private static bool IsNamespaceAdded(string name, NamespaceDoc doc)
+ {
+ throw new NotImplementedException();
+ }
+
+ private static string[] GetSubnames(string name)
+ {
+ int dotCount = 0;
+ foreach(char c in name)
+ {
+ if(c == '.')
+ dotCount++;
+ }
+
+ if(dotCount == 0)
+ return null;
+
+ int[] dotIndices = new int[dotCount];
+ int cIndex = 0;
+ int cPos = 0;
+
+ for(cPos = 0; cPos < name.Length; cPos++)
+ {
+ if(name[cPos] == '.')
+ dotIndices[cIndex++] = cPos;
+ }
+
+ string retVal[] = new string[dotCount];
+ for(cIndex = 0; cIndex < dotCount; cIndex++)
+ {
+ retVal[cIndex] = name.Substring(0, dotIndices[cIndex] - 1);
+ }
+ return retVal;
+ }
+
public void AddClassDoc(IClassDoc doc)
{
classes.Add(doc);
@@ -69,6 +141,14 @@
public void AddInterfaceDoc(IInterfaceDoc doc)
{
interfaces.Add(doc);
+ }
+
+ public string Name
+ {
+ get
+ {
+ return this.name;
+ }
}
public string Comments
|