jedidotnet-commits Mailing List for JEDI.NET (Page 3)
Status: Pre-Alpha
Brought to you by:
jedi_mbe
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(81) |
Jul
(7) |
Aug
(8) |
Sep
(2) |
Oct
|
Nov
(47) |
Dec
(30) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(32) |
Feb
|
Mar
(86) |
Apr
|
May
(1) |
Jun
(24) |
Jul
(4) |
Aug
(5) |
Sep
(4) |
Oct
|
Nov
|
Dec
(9) |
From: Marcel B. <jed...@us...> - 2005-03-29 18:31:24
|
Update of /cvsroot/jedidotnet/main/run In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18565/main/run Modified Files: Jedi.IO.FileOfRec.pas Jedi.IO.IniFiles.pas Jedi.IO.Paths.pas Jedi.Windows.Forms.Graphics.ShapeControl.pas Log Message: * Removed alias trick to mimic uses <namespace>.* only results in more problems * Minor clean ups (I was going through the files anyway) Index: Jedi.Windows.Forms.Graphics.ShapeControl.pas =================================================================== RCS file: /cvsroot/jedidotnet/main/run/Jedi.Windows.Forms.Graphics.ShapeControl.pas,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Jedi.Windows.Forms.Graphics.ShapeControl.pas 14 Mar 2005 17:07:30 -0000 1.2 --- Jedi.Windows.Forms.Graphics.ShapeControl.pas 29 Mar 2005 18:31:15 -0000 1.3 *************** *** 27,31 **** interface ! {$REGION 'interface uses'} uses Jedi.System.SourceVersioning, --- 27,31 ---- interface ! {$REGION 'uses'} uses Jedi.System.SourceVersioning, *************** *** 98,102 **** implementation ! {$REGION 'Shape control'} constructor Shape.Create; begin --- 98,102 ---- implementation ! {$REGION 'Shape'} constructor Shape.Create; begin Index: Jedi.IO.IniFiles.pas =================================================================== RCS file: /cvsroot/jedidotnet/main/run/Jedi.IO.IniFiles.pas,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Jedi.IO.IniFiles.pas 14 Mar 2005 12:53:07 -0000 1.4 --- Jedi.IO.IniFiles.pas 29 Mar 2005 18:31:15 -0000 1.5 *************** *** 26,37 **** interface ! {$REGION 'interface uses'} uses System.Collections, System.Collections.Specialized, System.IO, System.Resources, System.Threading, ! Jedi.System, Jedi.Timers.EventScheduler; {$ENDREGION} --- 26,40 ---- interface ! {$REGION 'uses'} uses System.Collections, System.Collections.Specialized, System.IO, + System.Globalization, System.Resources, System.Threading, ! Jedi.System.FrameworkResources, ! Jedi.System.SourceVersioning, ! Jedi.System.Strings, Jedi.Timers.EventScheduler; {$ENDREGION} *************** *** 549,557 **** {$AUTOBOX ON} - {$REGION 'implementation uses'} - uses - System.Globalization; - {$ENDREGION} - {$REGION 'protected classes'} type --- 552,555 ---- Index: Jedi.IO.FileOfRec.pas =================================================================== RCS file: /cvsroot/jedidotnet/main/run/Jedi.IO.FileOfRec.pas,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Jedi.IO.FileOfRec.pas 13 Mar 2005 11:52:20 -0000 1.4 --- Jedi.IO.FileOfRec.pas 29 Mar 2005 18:31:14 -0000 1.5 *************** *** 26,38 **** interface ! {$REGION 'Interface uses'} uses System.IO, System.Reflection, ! Jedi.System; {$ENDREGION} - type {$REGION 'StoredExtended record'} [JediSourceInfo('$Header$')] StoredExtended = record --- 26,38 ---- interface ! {$REGION 'uses'} uses System.IO, System.Reflection, ! Jedi.System.SourceVersioning; {$ENDREGION} {$REGION 'StoredExtended record'} + type [JediSourceInfo('$Header$')] StoredExtended = record *************** *** 79,82 **** --- 79,83 ---- {$REGION 'StreamOfValueType exception'} + type [JediSourceInfo('$Header$')] StreamOfValueTypeException = class(Exception); *************** *** 84,87 **** --- 85,89 ---- {$REGION 'StreamOfValueType base class'} + type [JediSourceInfo('$Header$')] StreamOfValueTypeBase = class(System.Object) Index: Jedi.IO.Paths.pas =================================================================== RCS file: /cvsroot/jedidotnet/main/run/Jedi.IO.Paths.pas,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Jedi.IO.Paths.pas 29 Mar 2005 10:49:56 -0000 1.5 --- Jedi.IO.Paths.pas 29 Mar 2005 18:31:15 -0000 1.6 *************** *** 26,29 **** --- 26,30 ---- interface + {$REGION 'uses'} uses Jedi.System.SourceVersioning, *************** *** 32,35 **** --- 33,37 ---- System.IO, System.Text; + {$ENDREGION} {$REGION 'Path manipulations'} |
From: Marcel B. <jed...@us...> - 2005-03-29 18:30:29
|
Update of /cvsroot/jedidotnet/main/assemblies In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18062/main/assemblies Modified Files: Jedi.IO.bdsproj Jedi.Windows.Forms.Graphics.bdsproj Log Message: Removed alias trick to mimic uses <namespace>.* only results in more problems Index: Jedi.Windows.Forms.Graphics.bdsproj =================================================================== RCS file: /cvsroot/jedidotnet/main/assemblies/Jedi.Windows.Forms.Graphics.bdsproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Jedi.Windows.Forms.Graphics.bdsproj 7 Mar 2005 18:03:58 -0000 1.1 --- Jedi.Windows.Forms.Graphics.bdsproj 29 Mar 2005 18:30:20 -0000 1.2 *************** *** 45,49 **** <Compiler Name="ShowHints">True</Compiler> <Compiler Name="ShowWarnings">True</Compiler> ! <Compiler Name="UnitAliases">WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;Jedi.System=Jedi.System.Attributes, Jedi.System.Strings;Jedi.Collections=Jedi.Collections.InlineEditable</Compiler> <Compiler Name="NamespacePrefix"></Compiler> <Compiler Name="GenerateDocumentation">False</Compiler> --- 45,49 ---- <Compiler Name="ShowHints">True</Compiler> <Compiler Name="ShowWarnings">True</Compiler> ! <Compiler Name="UnitAliases">WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;</Compiler> <Compiler Name="NamespacePrefix"></Compiler> <Compiler Name="GenerateDocumentation">False</Compiler> Index: Jedi.IO.bdsproj =================================================================== RCS file: /cvsroot/jedidotnet/main/assemblies/Jedi.IO.bdsproj,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Jedi.IO.bdsproj 25 Jan 2005 10:27:35 -0000 1.6 --- Jedi.IO.bdsproj 29 Mar 2005 18:30:20 -0000 1.7 *************** *** 45,49 **** <Compiler Name="ShowHints">True</Compiler> <Compiler Name="ShowWarnings">True</Compiler> ! <Compiler Name="UnitAliases">WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;Jedi.System=Jedi.System.Attributes, Jedi.System.FrameworkResources, Jedi.System.Strings, Jedi.System.SourceVersioning;Jedi.Collections=Jedi.Collections.InlineEditable;Jedi.Timers=Jedi.Timers.EventScheduler</Compiler> <Compiler Name="NamespacePrefix"></Compiler> <Compiler Name="GenerateDocumentation">True</Compiler> --- 45,49 ---- <Compiler Name="ShowHints">True</Compiler> <Compiler Name="ShowWarnings">True</Compiler> ! <Compiler Name="UnitAliases">WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;</Compiler> <Compiler Name="NamespacePrefix"></Compiler> <Compiler Name="GenerateDocumentation">True</Compiler> |
From: Marcel B. <jed...@us...> - 2005-03-29 10:50:06
|
Update of /cvsroot/jedidotnet/main/run In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25218/main/run Modified Files: Jedi.IO.Paths.pas Log Message: Fixed bug in MakeRelativeFrom with two paths having no common base path Index: Jedi.IO.Paths.pas =================================================================== RCS file: /cvsroot/jedidotnet/main/run/Jedi.IO.Paths.pas,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Jedi.IO.Paths.pas 28 Mar 2005 18:13:19 -0000 1.4 --- Jedi.IO.Paths.pas 29 Mar 2005 10:49:56 -0000 1.5 *************** *** 347,351 **** commonElements := CommonBaseImpl([basePath, inPath], config); relativeElements := ArrayList.Create; ! upLevelCount := basePathElementCount - commonElements.Count; while upLevelCount > 0 do begin --- 347,354 ---- commonElements := CommonBaseImpl([basePath, inPath], config); relativeElements := ArrayList.Create; ! if commonElements.Count > 0 then ! upLevelCount := basePathElementCount - commonElements.Count ! else ! upLevelCount := 0; while upLevelCount > 0 do begin |
From: Marcel B. <jed...@us...> - 2005-03-29 10:49:26
|
Update of /cvsroot/jedidotnet/nunit/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24908/nunit/source Modified Files: Jedi.IO.NUnit.pas Jedi.IO.Paths.Nunit.pas Log Message: Added test-cases to prove bug in either CommonBaseOf or MakeRelativeFrom with two paths having no common base at all. Index: Jedi.IO.Paths.Nunit.pas =================================================================== RCS file: /cvsroot/jedidotnet/nunit/source/Jedi.IO.Paths.Nunit.pas,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Jedi.IO.Paths.Nunit.pas 28 Mar 2005 18:14:27 -0000 1.2 --- Jedi.IO.Paths.Nunit.pas 29 Mar 2005 10:49:12 -0000 1.3 *************** *** 50,56 **** [Test] procedure CombineTwo; [Test] procedure CombineTwoAbsolutePaths; [Test] procedure CommonBaseOfFour; [Test] procedure CommonBaseOfTwo; ! [Test] procedure MakeRelativeFrom; end; --- 50,60 ---- [Test] procedure CombineTwo; [Test] procedure CombineTwoAbsolutePaths; + [Test] procedure CommonBaseOfFive; [Test] procedure CommonBaseOfFour; [Test] procedure CommonBaseOfTwo; ! [Test] procedure MakeRelativeFromNoCommonBase; ! [Test] procedure MakeRelativeFromOneLevelUp; ! [Test] procedure MakeRelativeFromSameLevel; ! [Test] procedure MakeRelativeFromTwoLevelsUp; end; *************** *** 246,252 **** end; procedure Manipulations.CommonBaseOfFour; begin ! Assert.AreEqual(PathTestCases.sCommonPathOfAll4, Path.CommonBase([PathTestCases.sCommonPath1, PathTestCases.sCommonPath2, PathTestCases.sCommonPath3, PathTestCases.sCommonPath4])); end; --- 250,262 ---- end; + procedure Manipulations.CommonBaseOfFive; + begin + Assert.AreEqual(PathTestCases.sCommonPathOfAll5, Path.CommonBase([PathTestCases.sCommonPath1, + PathTestCases.sCommonPath2, PathTestCases.sCommonPath3, PathTestCases.sCommonPath4, PathTestCases.sCommonPath5])); + end; + procedure Manipulations.CommonBaseOfFour; begin ! Assert.AreEqual(PathTestCases.sCommonPathOfFirst4, Path.CommonBase([PathTestCases.sCommonPath1, PathTestCases.sCommonPath2, PathTestCases.sCommonPath3, PathTestCases.sCommonPath4])); end; *************** *** 260,266 **** Assert.AreEqual(PathTestCases.sCommonPathOf1And4, Path.CommonBase(PathTestCases.sCommonPath1, PathTestCases.sCommonPath4), 'Paths 1 and 4'); end; ! procedure Manipulations.MakeRelativeFrom; begin Assert.AreEqual(PathTestCases.sRelativePath1, Path.MakeRelativeFrom(PathTestCases.sCommonPath1, --- 270,290 ---- Assert.AreEqual(PathTestCases.sCommonPathOf1And4, Path.CommonBase(PathTestCases.sCommonPath1, PathTestCases.sCommonPath4), 'Paths 1 and 4'); + Assert.AreEqual(PathTestCases.sCommonPathOf1And5, Path.CommonBase(PathTestCases.sCommonPath1, + PathTestCases.sCommonPath5), 'Paths 1 and 5'); end; ! procedure Manipulations.MakeRelativeFromOneLevelUp; ! begin ! Assert.AreEqual(PathTestCases.sRelativePath3, Path.MakeRelativeFrom(PathTestCases.sCommonPath3, ! PathTestCases.sRelativeBasePath)); ! end; ! ! procedure Manipulations.MakeRelativeFromNoCommonBase; ! begin ! Assert.AreEqual(PathTestCases.sRelativePath5, Path.MakeRelativeFrom(PathTestCases.sCommonPath5, ! PathTestCases.sRelativeBasePath)); ! end; ! ! procedure Manipulations.MakeRelativeFromSameLevel; begin Assert.AreEqual(PathTestCases.sRelativePath1, Path.MakeRelativeFrom(PathTestCases.sCommonPath1, *************** *** 268,275 **** Assert.AreEqual(PathTestCases.sRelativePath2, Path.MakeRelativeFrom(PathTestCases.sCommonPath2, PathTestCases.sRelativeBasePath), 'Path 2'); ! Assert.AreEqual(PathTestCases.sRelativePath3, Path.MakeRelativeFrom(PathTestCases.sCommonPath3, ! PathTestCases.sRelativeBasePath), 'Path 3'); Assert.AreEqual(PathTestCases.sRelativePath4, Path.MakeRelativeFrom(PathTestCases.sCommonPath4, ! PathTestCases.sRelativeBasePath), 'Path 4'); end; {$ENDREGION} --- 292,301 ---- Assert.AreEqual(PathTestCases.sRelativePath2, Path.MakeRelativeFrom(PathTestCases.sCommonPath2, PathTestCases.sRelativeBasePath), 'Path 2'); ! end; ! ! procedure Manipulations.MakeRelativeFromTwoLevelsUp; ! begin Assert.AreEqual(PathTestCases.sRelativePath4, Path.MakeRelativeFrom(PathTestCases.sCommonPath4, ! PathTestCases.sRelativeBasePath)); end; {$ENDREGION} Index: Jedi.IO.NUnit.pas =================================================================== RCS file: /cvsroot/jedidotnet/nunit/source/Jedi.IO.NUnit.pas,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Jedi.IO.NUnit.pas 28 Mar 2005 18:13:44 -0000 1.2 --- Jedi.IO.NUnit.pas 29 Mar 2005 10:49:11 -0000 1.3 *************** *** 37,41 **** const sNormCommonPathOf1And3 = 'c{0}{1}My Documents'; const sNormCommonPathOf1And4 = 'c{0}'; ! const sNormCommonPathOfAll4 = 'c{0}'; strict protected const sNormRelativePath1 = 'First folder{1}test1.txt'; --- 37,43 ---- const sNormCommonPathOf1And3 = 'c{0}{1}My Documents'; const sNormCommonPathOf1And4 = 'c{0}'; ! const sNormCommonPathOf1And5 = ''; ! const sNormCommonPathOfFirst4 = 'c{0}'; ! const sNormCommonPathOfAll5 = ''; strict protected const sNormRelativePath1 = 'First folder{1}test1.txt'; *************** *** 43,46 **** --- 45,49 ---- const sNormRelativePath3 = '..{1}Secondary group{1}First folder{1}test 2.txt'; const sNormRelativePath4 = '..{1}..{1}My Music{1}test1.mp3'; + const sNormRelativePath5 = 'd{0}{1}No common{1}base{1}path.txt'; public const sVolumeRoot = 'volume:\'; *************** *** 64,67 **** --- 67,71 ---- const sCommonPath3 = 'c:\My Documents\Secondary group\First folder\test 2.txt'; const sCommonPath4 = 'c:\My Music\test1.mp3'; + const sCommonPath5 = 'd:/No common\base\path.txt'; public const sRelativeBasePath = 'c:\My Documents\Testing'; *************** *** 94,98 **** sCommonPathOf1And3: string; sCommonPathOf1And4: string; ! sCommonPathOfAll4: string; public class var --- 98,104 ---- sCommonPathOf1And3: string; sCommonPathOf1And4: string; ! sCommonPathOf1And5: string; ! sCommonPathOfFirst4: string; ! sCommonPathOfAll5: string; public class var *************** *** 101,104 **** --- 107,111 ---- sRelativePath3: string; sRelativePath4: string; + sRelativePath5: string; end; |
From: Marcel B. <jed...@us...> - 2005-03-28 18:14:36
|
Update of /cvsroot/jedidotnet/nunit/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13675/nunit/source Modified Files: Jedi.IO.Paths.Nunit.pas Log Message: * Added: test cases for Jedi.IO.Path.CommonBase * Added: test cases for Jedi.IO.Path.MakeRelativeFrom Index: Jedi.IO.Paths.Nunit.pas =================================================================== RCS file: /cvsroot/jedidotnet/nunit/source/Jedi.IO.Paths.Nunit.pas,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Jedi.IO.Paths.Nunit.pas 6 Dec 2004 11:44:09 -0000 1.1 --- Jedi.IO.Paths.Nunit.pas 28 Mar 2005 18:14:27 -0000 1.2 *************** *** 50,53 **** --- 50,56 ---- [Test] procedure CombineTwo; [Test] procedure CombineTwoAbsolutePaths; + [Test] procedure CommonBaseOfFour; + [Test] procedure CommonBaseOfTwo; + [Test] procedure MakeRelativeFrom; end; *************** *** 242,245 **** --- 245,276 ---- 'Combine(sRelativePath, sDeepRootedPath)'); end; + + procedure Manipulations.CommonBaseOfFour; + begin + Assert.AreEqual(PathTestCases.sCommonPathOfAll4, Path.CommonBase([PathTestCases.sCommonPath1, + PathTestCases.sCommonPath2, PathTestCases.sCommonPath3, PathTestCases.sCommonPath4])); + end; + + procedure Manipulations.CommonBaseOfTwo; + begin + Assert.AreEqual(PathTestCases.sCommonPathOf1And2, Path.CommonBase(PathTestCases.sCommonPath1, + PathTestCases.sCommonPath2), 'Paths 1 and 2'); + Assert.AreEqual(PathTestCases.sCommonPathOf1And3, Path.CommonBase(PathTestCases.sCommonPath1, + PathTestCases.sCommonPath3), 'Paths 1 and 3'); + Assert.AreEqual(PathTestCases.sCommonPathOf1And4, Path.CommonBase(PathTestCases.sCommonPath1, + PathTestCases.sCommonPath4), 'Paths 1 and 4'); + end; + + procedure Manipulations.MakeRelativeFrom; + begin + Assert.AreEqual(PathTestCases.sRelativePath1, Path.MakeRelativeFrom(PathTestCases.sCommonPath1, + PathTestCases.sRelativeBasePath), 'Path 1'); + Assert.AreEqual(PathTestCases.sRelativePath2, Path.MakeRelativeFrom(PathTestCases.sCommonPath2, + PathTestCases.sRelativeBasePath), 'Path 2'); + Assert.AreEqual(PathTestCases.sRelativePath3, Path.MakeRelativeFrom(PathTestCases.sCommonPath3, + PathTestCases.sRelativeBasePath), 'Path 3'); + Assert.AreEqual(PathTestCases.sRelativePath4, Path.MakeRelativeFrom(PathTestCases.sCommonPath4, + PathTestCases.sRelativeBasePath), 'Path 4'); + end; {$ENDREGION} |
From: Marcel B. <jed...@us...> - 2005-03-28 18:14:18
|
Update of /cvsroot/jedidotnet/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13938/docs Modified Files: Jedi.IO.Paths.xml Log Message: * Updated missing docs for Combine method * Added docs for CommonBase, CommonBaseImpl, MakeRelativeFrom and PathElements Index: Jedi.IO.Paths.xml =================================================================== RCS file: /cvsroot/jedidotnet/docs/Jedi.IO.Paths.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Jedi.IO.Paths.xml 8 Mar 2005 10:47:33 -0000 1.3 --- Jedi.IO.Paths.xml 28 Mar 2005 18:14:07 -0000 1.4 *************** *** 1,3 **** --- 1,4 ---- <?xml version="1.0" encoding="utf-8"?> + <!--Timestamp most recent auto generation: 2005-03-28 14:53:01 UTC--> <members> <member name="T:Jedi.IO.Path"> *************** *** 104,107 **** --- 105,109 ---- </summary> <param name="paths"> + The list of the paths to be combined. </param> <returns> *************** *** 139,142 **** --- 141,145 ---- </summary> <param name="paths"> + <include file='Jedi.IO.Paths.xml' path='/members/member[@name="M:Jedi.IO.Path.Combine(System.String[])"]/param[@name="paths"]' /> </param> <param name="config"> *************** *** 172,175 **** --- 175,233 ---- </exception> </member> + <member name="M:Jedi.IO.Path.CommonBase(System.String,System.String)"> + <overloads> + Determines the common base path of two or more paths. + </overloads> + <summary> + Determines the common base path of two paths. + </summary> + <param name="path1"> + The first path. + </param> + <param name="path2"> + The second path. + </param> + <returns> + A <see cref="T:System.String" /> representing the base path that both paths have in common. This can be an + <see cref="F:System.String.Empty">empty string</see> if the paths have no common base. + </returns> + </member> + <member name="M:Jedi.IO.Path.CommonBase(System.String,System.String,Jedi.IO.Path.PathConfig)"> + <summary> + Determines the common base path of two paths, using a specific path configuration. + </summary> + <include file='Jedi.IO.Paths.xml' path='/members/member[@name="M:Jedi.IO.Path.CommonBase(System.String,System.String)"]/param[@name="path1"]' /> + <include file='Jedi.IO.Paths.xml' path='/members/member[@name="M:Jedi.IO.Path.CommonBase(System.String,System.String)"]/param[@name="path2"]' /> + <include file='Jedi.IO.Paths.xml' path='/members/member[@name="M:Jedi.IO.Path.Combine(System.String,System.String,Jedi.IO.Path.PathConfig)"]/param[@name="config"]' /> + <include file='Jedi.IO.Paths.xml' path='/members/member[@name="M:Jedi.IO.Path.CommonBase(System.String,System.String)"]/returns' /> + </member> + <member name="M:Jedi.IO.Path.CommonBase(System.String[])"> + <summary> + Determines the common base path of two or more paths. + </summary> + <param name="paths"> + The list of paths to detemine the common path of. + </param> + <returns> + A <see cref="T:System.String" /> representing the base path that all paths have in common. This can be an + <see cref="F:System.String.Empty">empty string</see> if the paths have no common base. + </returns> + </member> + <member name="M:Jedi.IO.Path.CommonBase(System.String[],Jedi.IO.Path.PathConfig)"> + <summary> + Determines the common base path of two or more paths, using a specific path configuration. + </summary> + <include file='Jedi.IO.Paths.xml' path='/members/member[@name="M:Jedi.IO.Path.CommonBase(System.String[])"]/param[@name="paths"]' /> + <include file='Jedi.IO.Paths.xml' path='/members/member[@name="M:Jedi.IO.Path.Combine(System.String,System.String,Jedi.IO.Path.PathConfig)"]/param[@name="config"]' /> + <include file='Jedi.IO.Paths.xml' path='/members/member[@name="M:Jedi.IO.Path.CommonBase(System.String[])"]/returns' /> + </member> + <member name="M:Jedi.IO.Path.CommonBaseImpl(System.String[],Jedi.IO.Path.PathConfig)"> + <include file='Jedi.IO.Paths.xml' path='/members/member[@name="M:Jedi.IO.Path.CommonBase(System.String[])"]/summary' /> + <include file='Jedi.IO.Paths.xml' path='/members/member[@name="M:Jedi.IO.Path.CommonBase(System.String[])"]/param[@name="paths"]' /> + <include file='Jedi.IO.Paths.xml' path='/members/member[@name="M:Jedi.IO.Path.Combine(System.String,System.String,Jedi.IO.Path.PathConfig)"]/param[@name="config"]' /> + <returns> + An <see cref="T:System.Collections.ArrayList" /> containing the individual path elements that all paths have in common. + </returns> + </member> <member name="M:Jedi.IO.Path.EnsureEndingDirectorySeparator(System.String)"> <summary> *************** *** 345,348 **** --- 403,433 ---- </returns> </member> + <member name="M:Jedi.IO.Path.MakeRelativeFrom(System.String,System.String)"> + <overloads> + Determines the relative path from a base path to a given path. + </overloads> + <summary> + Determines the relative path from a base path to a given path. + </summary> + <param name="inPath"> + The path to make relative. + </param> + <param name="basePath"> + The path from which <paramref name="inPath" /> should be made relative from. + </param> + <returns> + A <see cref="T:System.String" /> equivalent to the path specified in the <paramref name="inPath" /> parameter, but + relative to the path specified by the <paramref name="basePath" /> parameter. + </returns> + </member> + <member name="M:Jedi.IO.Path.MakeRelativeFrom(System.String,System.String,Jedi.IO.Path.PathConfig)"> + <summary> + Determines the relative path from a base path to a given path using a specific configuration. + </summary> + <include file='Jedi.IO.Paths.xml' path='/members/member[@name="M:Jedi.IO.Path.MakeRelativeFrom(System.String,System.String)"]/param[@name="inPath"]' /> + <include file='Jedi.IO.Paths.xml' path='/members/member[@name="M:Jedi.IO.Path.MakeRelativeFrom(System.String,System.String)"]/param[@name="basePath"]' /> + <include file='Jedi.IO.Paths.xml' path='/members/member[@name="M:Jedi.IO.Path.Combine(System.String,System.String,Jedi.IO.Path.PathConfig)"]/param[@name="config"]' /> + <include file='Jedi.IO.Paths.xml' path='/members/member[@name="M:Jedi.IO.Path.MakeRelativeFrom(System.String,System.String)"]/returns' /> + </member> <member name="M:Jedi.IO.Path.Normalize(System.String)"> <overloads> *************** *** 494,497 **** --- 579,612 ---- </returns> </member> + <member name="M:Jedi.IO.Path.PathElements(System.String)"> + <overloads> + Returns a list of path elements. + </overloads> + <summary> + Returns a list of path elements. + </summary> + <param name="path"> + The path to retrieve the individual volume, directories and file elements from. + </param> + <returns> + An <see cref="T:System.Array">array</see> of <see cref="T:System.String" /> with each element being either a + volume, directory or file. + </returns> + <remarks> + The given path is first normalized after which the resulting path string is split at the + <see cref="M:Jedi.IO.Path.PathConfig.DirectorySeparator" /> character. This method is functionally equivalent to a + call to the <see cref="M:Jedi.IO.Path.Normalize(System.String,Jedi.IO.Path.PathConfig)" /> and then calling + <see cref="T:System.String.Split(System.Char[])" />. + </remarks> + </member> + <member name="M:Jedi.IO.Path.PathElements(System.String,Jedi.IO.Path.PathConfig)"> + <summary> + Returns a list of path elements using a specific path configuration. + </summary> + <include file='Jedi.IO.Paths.xml' path='/members/member[@name="M:Jedi.IO.Path.PathElements(System.String)"]/param[@name="path"]' /> + <include file='Jedi.IO.Paths.xml' path='/members/member[@name="M:Jedi.IO.Path.Combine(System.String,System.String,Jedi.IO.Path.PathConfig)"]/param[@name="config"]' /> + <include file='Jedi.IO.Paths.xml' path='/members/member[@name="M:Jedi.IO.Path.PathElements(System.String)"]/returns' /> + <include file='Jedi.IO.Paths.xml' path='/members/member[@name="M:Jedi.IO.Path.PathElements(System.String)"]/remarks' /> + </member> <member name="F:Jedi.IO.Path.SysConfig"> <exclude /> |
From: Marcel B. <jed...@us...> - 2005-03-28 18:14:17
|
Update of /cvsroot/jedidotnet/nunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13835/nunit Modified Files: Nunit.Jedi.Results.xml Log Message: Results of 121 test cases: all succesful Index: Nunit.Jedi.Results.xml =================================================================== RCS file: /cvsroot/jedidotnet/nunit/Nunit.Jedi.Results.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Nunit.Jedi.Results.xml 14 Mar 2005 13:44:49 -0000 1.3 --- Nunit.Jedi.Results.xml 28 Mar 2005 18:14:03 -0000 1.4 *************** *** 1,19 **** <?xml version="1.0" encoding="utf-8" standalone="no"?> <!--This file represents the results of running a test suite--> ! <test-results name="F:\Programming\JEDI\JediDotNet\nunit\Nunit.Jedi.nunit" total="112" failures="0" not-run="0" date="14-3-2005" time="14:33"> ! <test-suite name="F:\Programming\JEDI\JediDotNet\nunit\Nunit.Jedi.nunit" success="True" time="4.203125" asserts="0"> <results> ! <test-suite name="F:\Programming\JEDI\JediDotNet\nunit\bin\Nunit.Jedi.IO.dll" success="True" time="1.328125" asserts="0"> <results> ! <test-suite name="Jedi" success="True" time="1.3125" asserts="0"> <results> ! <test-suite name="IO" success="True" time="1.3125" asserts="0"> <results> ! <test-suite name="IniFiles" success="True" time="0.859375" asserts="0"> <results> ! <test-suite name="BufferedFile" success="True" time="0.78125" asserts="0"> <results> ! <test-case name="Jedi.IO.IniFiles.BufferedFile.AutoFlush" executed="True" success="True" time="0.422" asserts="4" /> ! <test-case name="Jedi.IO.IniFiles.BufferedFile.AutoReload" executed="True" success="True" time="0.250" asserts="6" /> <test-case name="Jedi.IO.IniFiles.BufferedFile.LoadSaveLoad" executed="True" success="True" time="0.000" asserts="9" /> </results> --- 1,19 ---- <?xml version="1.0" encoding="utf-8" standalone="no"?> <!--This file represents the results of running a test suite--> ! <test-results name="F:\Programming\JEDI\JediDotNet\nunit\Nunit.Jedi.nunit" total="121" failures="0" not-run="0" date="28-3-2005" time="20:05"> ! <test-suite name="F:\Programming\JEDI\JediDotNet\nunit\Nunit.Jedi.nunit" success="True" time="4.4375" asserts="0"> <results> ! <test-suite name="F:\Programming\JEDI\JediDotNet\nunit\bin\Nunit.Jedi.IO.dll" success="True" time="1.390625" asserts="0"> <results> ! <test-suite name="Jedi" success="True" time="1.390625" asserts="0"> <results> ! <test-suite name="IO" success="True" time="1.375" asserts="0"> <results> ! <test-suite name="IniFiles" success="True" time="0.8125" asserts="0"> <results> ! <test-suite name="BufferedFile" success="True" time="0.703125" asserts="0"> <results> ! <test-case name="Jedi.IO.IniFiles.BufferedFile.AutoFlush" executed="True" success="True" time="0.391" asserts="4" /> ! <test-case name="Jedi.IO.IniFiles.BufferedFile.AutoReload" executed="True" success="True" time="0.234" asserts="6" /> <test-case name="Jedi.IO.IniFiles.BufferedFile.LoadSaveLoad" executed="True" success="True" time="0.000" asserts="9" /> </results> *************** *** 24,42 **** <test-case name="Jedi.IO.IniFiles.MemoryBased.Loading" executed="True" success="True" time="0.000" asserts="3" /> <test-case name="Jedi.IO.IniFiles.MemoryBased.SectionCollection" executed="True" success="True" time="0.000" asserts="5" /> ! <test-case name="Jedi.IO.IniFiles.MemoryBased.SectionKeyCollection" executed="True" success="True" time="0.000" asserts="24" /> </results> </test-suite> </results> </test-suite> ! <test-suite name="Paths" success="True" time="0.453125" asserts="0"> <results> ! <test-suite name="Manipulations" success="True" time="0.0625" asserts="0"> <results> <test-case name="Jedi.IO.Paths.Manipulations.CombineTenPaths" executed="True" success="True" time="0.000" asserts="1" /> ! <test-case name="Jedi.IO.Paths.Manipulations.CombineTwo" executed="True" success="True" time="0.000" asserts="3" /> <test-case name="Jedi.IO.Paths.Manipulations.CombineTwoAbsolutePaths" executed="True" success="True" time="0.000" asserts="3" /> </results> </test-suite> ! <test-suite name="Normalize" success="True" time="0.171875" asserts="0"> <results> <test-case name="Jedi.IO.Paths.Normalize.DeepRootedPath" executed="True" success="True" time="0.000" asserts="1" /> --- 24,45 ---- <test-case name="Jedi.IO.IniFiles.MemoryBased.Loading" executed="True" success="True" time="0.000" asserts="3" /> <test-case name="Jedi.IO.IniFiles.MemoryBased.SectionCollection" executed="True" success="True" time="0.000" asserts="5" /> ! <test-case name="Jedi.IO.IniFiles.MemoryBased.SectionKeyCollection" executed="True" success="True" time="0.016" asserts="24" /> </results> </test-suite> </results> </test-suite> ! <test-suite name="Paths" success="True" time="0.5625" asserts="0"> <results> ! <test-suite name="Manipulations" success="True" time="0.140625" asserts="0"> <results> <test-case name="Jedi.IO.Paths.Manipulations.CombineTenPaths" executed="True" success="True" time="0.000" asserts="1" /> ! <test-case name="Jedi.IO.Paths.Manipulations.CombineTwo" executed="True" success="True" time="0.016" asserts="3" /> <test-case name="Jedi.IO.Paths.Manipulations.CombineTwoAbsolutePaths" executed="True" success="True" time="0.000" asserts="3" /> + <test-case name="Jedi.IO.Paths.Manipulations.CommonBaseOfFour" executed="True" success="True" time="0.016" asserts="1" /> + <test-case name="Jedi.IO.Paths.Manipulations.CommonBaseOfTwo" executed="True" success="True" time="0.000" asserts="3" /> + <test-case name="Jedi.IO.Paths.Manipulations.MakeRelativeFrom" executed="True" success="True" time="0.000" asserts="4" /> </results> </test-suite> ! <test-suite name="Normalize" success="True" time="0.1875" asserts="0"> <results> <test-case name="Jedi.IO.Paths.Normalize.DeepRootedPath" executed="True" success="True" time="0.000" asserts="1" /> *************** *** 59,63 **** </results> </test-suite> ! <test-suite name="ValidityChecks" success="True" time="0.171875" asserts="0"> <results> <test-case name="Jedi.IO.Paths.ValidityChecks.DeepRootedPath" executed="True" success="True" time="0.000" asserts="1" /> --- 62,66 ---- </results> </test-suite> ! <test-suite name="ValidityChecks" success="True" time="0.1875" asserts="0"> <results> <test-case name="Jedi.IO.Paths.ValidityChecks.DeepRootedPath" executed="True" success="True" time="0.000" asserts="1" /> *************** *** 83,91 **** </results> </test-suite> ! <test-suite name="F:\Programming\JEDI\JediDotNet\nunit\bin\Nunit.Jedi.System.dll" success="True" time="2.828125" asserts="0"> <results> ! <test-suite name="Jedi" success="True" time="2.828125" asserts="0"> <results> ! <test-suite name="System" success="True" time="1.3125" asserts="0"> <results> <test-suite name="Attributes" success="True" time="0.09375" asserts="0"> --- 86,124 ---- </results> </test-suite> ! <test-suite name="F:\Programming\JEDI\JediDotNet\nunit\bin\Nunit.Jedi.Storage.dll" success="True" time="0.140625" asserts="0"> <results> ! <test-suite name="Jedi" success="True" time="0.140625" asserts="0"> <results> ! <test-suite name="IO" success="True" time="0.125" asserts="0"> ! <results> ! <test-suite name="DataStorage" success="True" time="0.125" asserts="0"> ! <results> ! <test-suite name="RootStorage" success="True" time="0.109375" asserts="0"> ! <results> ! <test-case name="Jedi.IO.DataStorage.RootStorage.AddOneStorage" executed="True" success="True" time="0.000" asserts="4" /> ! <test-case name="Jedi.IO.DataStorage.RootStorage.AddOneStorageAndClear" executed="True" success="True" time="0.000" asserts="6" /> ! <test-case name="Jedi.IO.DataStorage.RootStorage.AddTwoStoragesAndRemoveFirst" executed="True" success="True" time="0.000" asserts="9" /> ! <test-case name="Jedi.IO.DataStorage.RootStorage.CheckStorageForWithTwoStorages" executed="True" success="True" time="0.000" asserts="6" /> ! <test-case name="Jedi.IO.DataStorage.RootStorage.EmptyStorage" executed="True" success="True" time="0.000" asserts="3" /> ! </results> ! </test-suite> ! <test-suite name="Utilities" success="True" time="0.015625" asserts="0"> ! <results> ! <test-case name="Jedi.IO.DataStorage.Utilities.PathNormalization" executed="True" success="True" time="0.000" asserts="0" /> ! </results> ! </test-suite> ! </results> ! </test-suite> ! </results> ! </test-suite> ! </results> ! </test-suite> ! </results> ! </test-suite> ! <test-suite name="F:\Programming\JEDI\JediDotNet\nunit\bin\Nunit.Jedi.System.dll" success="True" time="2.875" asserts="0"> ! <results> ! <test-suite name="Jedi" success="True" time="2.875" asserts="0"> ! <results> ! <test-suite name="System" success="True" time="1.375" asserts="0"> <results> <test-suite name="Attributes" success="True" time="0.09375" asserts="0"> *************** *** 107,127 **** </results> </test-suite> ! <test-suite name="CommandLine" success="True" time="0.328125" asserts="0"> <results> ! <test-suite name="Errors" success="True" time="0.078125" asserts="0"> <results> ! <test-case name="Jedi.System.CommandLine.Errors.DoubleOptions" executed="True" success="True" time="0.031" asserts="0" /> <test-case name="Jedi.System.CommandLine.Errors.NoCompilerSettings" executed="True" success="True" time="0.000" asserts="0" /> ! <test-case name="Jedi.System.CommandLine.Errors.UnknownArgument" executed="True" success="True" time="0.016" asserts="0" /> </results> </test-suite> ! <test-suite name="SpecialCases" success="True" time="0.046875" asserts="0"> <results> ! <test-case name="Jedi.System.CommandLine.SpecialCases.CaseSensitive" executed="True" success="True" time="0.000" asserts="2" /> <test-case name="Jedi.System.CommandLine.SpecialCases.CustomProcessing" executed="True" success="True" time="0.000" asserts="2" /> <test-case name="Jedi.System.CommandLine.SpecialCases.MixedNormalAndCustom" executed="True" success="True" time="0.000" asserts="2" /> </results> </test-suite> ! <test-suite name="ToInstance" success="True" time="0.09375" asserts="0"> <results> <test-case name="Jedi.System.CommandLine.ToInstance.OptionNotSpecified" executed="True" success="True" time="0.000" asserts="6" /> --- 140,160 ---- </results> </test-suite> ! <test-suite name="CommandLine" success="True" time="0.34375" asserts="0"> <results> ! <test-suite name="Errors" success="True" time="0.046875" asserts="0"> <results> ! <test-case name="Jedi.System.CommandLine.Errors.DoubleOptions" executed="True" success="True" time="0.000" asserts="0" /> <test-case name="Jedi.System.CommandLine.Errors.NoCompilerSettings" executed="True" success="True" time="0.000" asserts="0" /> ! <test-case name="Jedi.System.CommandLine.Errors.UnknownArgument" executed="True" success="True" time="0.000" asserts="0" /> </results> </test-suite> ! <test-suite name="SpecialCases" success="True" time="0.078125" asserts="0"> <results> ! <test-case name="Jedi.System.CommandLine.SpecialCases.CaseSensitive" executed="True" success="True" time="0.031" asserts="2" /> <test-case name="Jedi.System.CommandLine.SpecialCases.CustomProcessing" executed="True" success="True" time="0.000" asserts="2" /> <test-case name="Jedi.System.CommandLine.SpecialCases.MixedNormalAndCustom" executed="True" success="True" time="0.000" asserts="2" /> </results> </test-suite> ! <test-suite name="ToInstance" success="True" time="0.125" asserts="0"> <results> <test-case name="Jedi.System.CommandLine.ToInstance.OptionNotSpecified" executed="True" success="True" time="0.000" asserts="6" /> *************** *** 143,153 **** </results> </test-suite> ! <test-suite name="SourceVersioning" success="True" time="0.15625" asserts="0"> <results> <test-suite name="Attributes" success="True" time="0.0625" asserts="0"> <results> ! <test-case name="Jedi.System.SourceVersioning.Attributes.BaseAttribute" executed="True" success="True" time="0.016" asserts="6" /> <test-case name="Jedi.System.SourceVersioning.Attributes.CVSBasedAttribute" executed="True" success="True" time="0.016" asserts="16" /> ! <test-case name="Jedi.System.SourceVersioning.Attributes.JediBasedAttribute" executed="True" success="True" time="0.000" asserts="6" /> </results> </test-suite> --- 176,186 ---- </results> </test-suite> ! <test-suite name="SourceVersioning" success="True" time="0.1875" asserts="0"> <results> <test-suite name="Attributes" success="True" time="0.0625" asserts="0"> <results> ! <test-case name="Jedi.System.SourceVersioning.Attributes.BaseAttribute" executed="True" success="True" time="0.000" asserts="6" /> <test-case name="Jedi.System.SourceVersioning.Attributes.CVSBasedAttribute" executed="True" success="True" time="0.016" asserts="16" /> ! <test-case name="Jedi.System.SourceVersioning.Attributes.JediBasedAttribute" executed="True" success="True" time="0.016" asserts="6" /> </results> </test-suite> *************** *** 160,175 **** <test-suite name="SourceInfoClass" success="True" time="0.03125" asserts="0"> <results> ! <test-case name="Jedi.System.SourceVersioning.SourceInfoClass.AtLeast" executed="True" success="True" time="0.000" asserts="4" /> ! <test-case name="Jedi.System.SourceVersioning.SourceInfoClass.Retrieval" executed="True" success="True" time="0.000" asserts="8" /> </results> </test-suite> </results> </test-suite> ! <test-suite name="Strings" success="True" time="0.734375" asserts="0"> <results> <test-suite name="EscapedStrings" success="True" time="0.03125" asserts="0"> <results> ! <test-case name="Jedi.System.Strings.EscapedStrings.Escape" executed="True" success="True" time="0.016" asserts="5" /> ! <test-case name="Jedi.System.Strings.EscapedStrings.ParseEscapedString" executed="True" success="True" time="0.016" asserts="5" /> </results> </test-suite> --- 193,208 ---- <test-suite name="SourceInfoClass" success="True" time="0.03125" asserts="0"> <results> ! <test-case name="Jedi.System.SourceVersioning.SourceInfoClass.AtLeast" executed="True" success="True" time="0.016" asserts="4" /> ! <test-case name="Jedi.System.SourceVersioning.SourceInfoClass.Retrieval" executed="True" success="True" time="0.016" asserts="8" /> </results> </test-suite> </results> </test-suite> ! <test-suite name="Strings" success="True" time="0.71875" asserts="0"> <results> <test-suite name="EscapedStrings" success="True" time="0.03125" asserts="0"> <results> ! <test-case name="Jedi.System.Strings.EscapedStrings.Escape" executed="True" success="True" time="0.000" asserts="5" /> ! <test-case name="Jedi.System.Strings.EscapedStrings.ParseEscapedString" executed="True" success="True" time="0.000" asserts="5" /> </results> </test-suite> *************** *** 191,197 **** </results> </test-suite> ! <test-suite name="QuotedStrings" success="True" time="0.25" asserts="0"> <results> ! <test-case name="Jedi.System.Strings.QuotedStrings.DequoteNonQuotedString" executed="True" success="True" time="0.000" asserts="2" /> <test-case name="Jedi.System.Strings.QuotedStrings.DequoteStringAllowedMissingEndQuote" executed="True" success="True" time="0.000" asserts="2" /> <test-case name="Jedi.System.Strings.QuotedStrings.DequoteStringCheckEndQuote" executed="True" success="True" time="0.000" asserts="2" /> --- 224,230 ---- </results> </test-suite> ! <test-suite name="QuotedStrings" success="True" time="0.265625" asserts="0"> <results> ! <test-case name="Jedi.System.Strings.QuotedStrings.DequoteNonQuotedString" executed="True" success="True" time="0.016" asserts="2" /> <test-case name="Jedi.System.Strings.QuotedStrings.DequoteStringAllowedMissingEndQuote" executed="True" success="True" time="0.000" asserts="2" /> <test-case name="Jedi.System.Strings.QuotedStrings.DequoteStringCheckEndQuote" executed="True" success="True" time="0.000" asserts="2" /> *************** *** 212,216 **** </results> </test-suite> ! <test-suite name="Substrings" success="True" time="0.15625" asserts="0"> <results> <test-case name="Jedi.System.Strings.Substrings.AfterLastMultipleDelimiters" executed="True" success="True" time="0.000" asserts="4" /> --- 245,249 ---- </results> </test-suite> ! <test-suite name="Substrings" success="True" time="0.171875" asserts="0"> <results> <test-case name="Jedi.System.Strings.Substrings.AfterLastMultipleDelimiters" executed="True" success="True" time="0.000" asserts="4" /> *************** *** 242,251 **** </results> </test-suite> ! <test-suite name="Timers" success="True" time="1.5" asserts="0"> <results> ! <test-suite name="EventScheduler" success="True" time="1.484375" asserts="0"> <results> <test-case name="Jedi.Timers.EventScheduler.SingleScheduleEveryPointTwoSeconds" executed="True" success="True" time="0.844" asserts="5" /> ! <test-case name="Jedi.Timers.EventScheduler.SingleScheduleEveryPointTwoSecondsNoSleep" executed="True" success="True" time="0.641" asserts="5" /> </results> </test-suite> --- 275,284 ---- </results> </test-suite> ! <test-suite name="Timers" success="True" time="1.484375" asserts="0"> <results> ! <test-suite name="EventScheduler" success="True" time="1.46875" asserts="0"> <results> <test-case name="Jedi.Timers.EventScheduler.SingleScheduleEveryPointTwoSeconds" executed="True" success="True" time="0.844" asserts="5" /> ! <test-case name="Jedi.Timers.EventScheduler.SingleScheduleEveryPointTwoSecondsNoSleep" executed="True" success="True" time="0.625" asserts="5" /> </results> </test-suite> |
From: Marcel B. <jed...@us...> - 2005-03-28 18:14:04
|
Update of /cvsroot/jedidotnet/nunit/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13643/nunit/source Modified Files: Jedi.IO.NUnit.pas Log Message: * Generalized calculation of system dependant result strings. * Added test cases for Jedi.IO.Path.CommonBase and Jedi.IO.Path.MakeRelativeFrom Index: Jedi.IO.NUnit.pas =================================================================== RCS file: /cvsroot/jedidotnet/nunit/source/Jedi.IO.NUnit.pas,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Jedi.IO.NUnit.pas 6 Dec 2004 11:44:09 -0000 1.1 --- Jedi.IO.NUnit.pas 28 Mar 2005 18:13:44 -0000 1.2 *************** *** 3,6 **** --- 3,10 ---- interface + uses + System.IO, + System.Reflection; + type PathTestCases = class *************** *** 8,26 **** class constructor Create; strict protected ! const sNormVolumeRoot = 'volume{0}{1}'; ! const sNormVolumeRoot2 = 'secondvolume{0}'; ! const sNormVolumeRootNoSlash = 'volume{0}'; ! const sNormInvalidVolumeRoot = '{1}path{1}volume{0}{1}'; ! const sNormInvalidRelativePathUpLevel = '..SubFolder2.2'; ! const sNormDeepVolumeRootedPath = 'volume{0}{1}MyRootFolder{1}SubFolder1{1}SubFolder1.1{1}SubFolder1.1.1'; ! const sNormVolumePath = 'primary{0}{1}PrimaryRoot{1}My Folder'; ! const sNormDeepRootedPath = '{1}MyRootFolder{1}SubFolder1{1}SubFolder1.1{1}SubFolder1.1.1'; ! const sNormRelativePath = 'SubFolder2{1}SubFolder2.1'; ! const sNormRelativePathUpLevel = '..{1}SubFolder2.2'; ! const sNormRelativePathUpTwoLevels = '..{1}..{1}SubFolder3{1}SubFolder3.1{1}SubFolder3.1.1{1}SubFolder3.1.4'; ! const sNormRelativePathUpTwoLevelsSep = '..{1}..{1}SubFolder4{1}SubFolder4.1{1}SubFolder4.1.1{1}SubFolder4.1.4'; ! const sNormStartWithThisPath = 'My Folder'; ! const sNormHasDottedFolderName = 'SubFolder5{1}.HiddenStuff'; ! const sNormWildcardedFile = '*.txt'; const sNormCombinedVolRootAndRelativePath = 'volume{0}{1}SubFolder2{1}SubFolder2.1'; --- 12,30 ---- class constructor Create; strict protected ! const sNormVolumeRootNormalized = 'volume{0}{1}'; ! const sNormVolumeRoot2Normalized = 'secondvolume{0}'; ! const sNormVolumeRootNoSlashNormalized = 'volume{0}'; ! const sNormInvalidVolumeRootNormalized = '{1}path{1}volume{0}{1}'; ! const sNormInvalidRelativePathUpLevelNormalized = '..SubFolder2.2'; ! const sNormDeepVolumeRootedPathNormalized = 'volume{0}{1}MyRootFolder{1}SubFolder1{1}SubFolder1.1{1}SubFolder1.1.1'; ! const sNormVolumePathNormalized = 'primary{0}{1}PrimaryRoot{1}My Folder'; ! const sNormDeepRootedPathNormalized = '{1}MyRootFolder{1}SubFolder1{1}SubFolder1.1{1}SubFolder1.1.1'; ! const sNormRelativePathNormalized = 'SubFolder2{1}SubFolder2.1'; ! const sNormRelativePathUpLevelNormalized = '..{1}SubFolder2.2'; ! const sNormRelativePathUpTwoLevelsNormalized = '..{1}..{1}SubFolder3{1}SubFolder3.1{1}SubFolder3.1.1{1}SubFolder3.1.4'; ! const sNormRelativePathUpTwoLevelsSepNormalized = '..{1}..{1}SubFolder4{1}SubFolder4.1{1}SubFolder4.1.1{1}SubFolder4.1.4'; ! const sNormStartWithThisPathNormalized = 'My Folder'; ! const sNormHasDottedFolderNameNormalized = 'SubFolder5{1}.HiddenStuff'; ! const sNormWildcardedFileNormalized = '*.txt'; const sNormCombinedVolRootAndRelativePath = 'volume{0}{1}SubFolder2{1}SubFolder2.1'; *************** *** 29,32 **** --- 33,46 ---- const sNormCombinedVolPathAndDeepRooted = 'primary{0}{1}MyRootFolder{1}SubFolder1{1}SubFolder1.1{1}SubFolder1.1.1'; const sNormCombinedRelAndRelPathUp = 'SubFolder2{1}SubFolder2.2'; + strict protected + const sNormCommonPathOf1And2 = 'c{0}{1}My Documents{1}Testing'; + const sNormCommonPathOf1And3 = 'c{0}{1}My Documents'; + const sNormCommonPathOf1And4 = 'c{0}'; + const sNormCommonPathOfAll4 = 'c{0}'; + strict protected + const sNormRelativePath1 = 'First folder{1}test1.txt'; + const sNormRelativePath2 = 'Second folder{1}test1.txt'; + const sNormRelativePath3 = '..{1}Secondary group{1}First folder{1}test 2.txt'; + const sNormRelativePath4 = '..{1}..{1}My Music{1}test1.mp3'; public const sVolumeRoot = 'volume:\'; *************** *** 45,49 **** const sHasDottedFolderName = 'SubFolder5\.HiddenStuff'; const sWildcardedFile = '*.txt'; ! class var sVolumeRootNormalized: string; --- 59,70 ---- const sHasDottedFolderName = 'SubFolder5\.HiddenStuff'; const sWildcardedFile = '*.txt'; ! public ! const sCommonPath1 = 'c:/My Documents\Testing\First folder/test1.txt'; ! const sCommonPath2 = 'c:\My Documents/Testing\Second folder/test1.txt'; ! const sCommonPath3 = 'c:\My Documents\Secondary group\First folder\test 2.txt'; ! const sCommonPath4 = 'c:\My Music\test1.mp3'; ! public ! const sRelativeBasePath = 'c:\My Documents\Testing'; ! public class var sVolumeRootNormalized: string; *************** *** 68,101 **** sCombinedVolPathAndDeepRooted: string; sCombinedRelAndRelPathUp: string; end; implementation - uses - System.IO; - class constructor PathTestCases.Create; begin ! sVolumeRootNormalized := System.String.Format(sNormVolumeRoot, Path.VolumeSeparatorChar, Path.DirectorySeparatorChar); ! sVolumeRoot2Normalized := System.String.Format(sNormVolumeRoot2, Path.VolumeSeparatorChar, Path.DirectorySeparatorChar); ! sVolumeRootNoSlashNormalized := System.String.Format(sNormVolumeRootNoSlash, Path.VolumeSeparatorChar, Path.DirectorySeparatorChar); ! sInvalidVolumeRootNormalized := System.String.Format(sNormInvalidVolumeRoot, Path.VolumeSeparatorChar, Path.DirectorySeparatorChar); ! sInvalidRelativePathUpLevelNormalized := System.String.Format(sNormInvalidRelativePathUpLevel, Path.VolumeSeparatorChar, Path.DirectorySeparatorChar); ! sDeepVolumeRootedPathNormalized := System.String.Format(sNormDeepVolumeRootedPath, Path.VolumeSeparatorChar, Path.DirectorySeparatorChar); ! sDeepRootedPathNormalized := System.String.Format(sNormDeepRootedPath, Path.VolumeSeparatorChar, Path.DirectorySeparatorChar); ! sVolumePathNormalized := System.String.Format(sNormVolumePath, Path.VolumeSeparatorChar, Path.DirectorySeparatorChar); ! sRelativePathNormalized := System.String.Format(sNormRelativePath, Path.VolumeSeparatorChar, Path.DirectorySeparatorChar); ! sRelativePathUpLevelNormalized := System.String.Format(sNormRelativePathUpLevel, Path.VolumeSeparatorChar, Path.DirectorySeparatorChar); ! sRelativePathUpTwoLevelsNormalized := System.String.Format(sNormRelativePathUpTwoLevels, Path.VolumeSeparatorChar, Path.DirectorySeparatorChar); ! sRelativePathUpTwoLevelsSepNormalized := System.String.Format(sNormRelativePathUpTwoLevelsSep, Path.VolumeSeparatorChar, Path.DirectorySeparatorChar); ! sStartWithThisPathNormalized := System.String.Format(sNormStartWithThisPath, Path.VolumeSeparatorChar, Path.DirectorySeparatorChar); ! sHasDottedFolderNameNormalized := System.String.Format(sNormHasDottedFolderName, Path.VolumeSeparatorChar, Path.DirectorySeparatorChar); ! sWildcardedFileNormalized := System.String.Format(sNormWildcardedFile, Path.VolumeSeparatorChar, Path.DirectorySeparatorChar); ! ! sCombinedVolRootAndRelativePath := System.String.Format(sNormCombinedVolRootAndRelativePath, Path.VolumeSeparatorChar, Path.DirectorySeparatorChar); ! sCombinedDeepVolRootAndRelPathUpTwo := System.String.Format(sNormCombinedDeepVolRootAndRelPathUpTwo, Path.VolumeSeparatorChar, Path.DirectorySeparatorChar); ! sCombinedVolRoot2AndDeepRooted := System.String.Format(sNormCombinedVolRoot2AndDeepRooted, Path.VolumeSeparatorChar, Path.DirectorySeparatorChar); ! sCombinedVolPathAndDeepRooted := System.String.Format(sNormCombinedVolPathAndDeepRooted, Path.VolumeSeparatorChar, Path.DirectorySeparatorChar); ! sCombinedRelAndRelPathUp := System.String.Format(sNormCombinedRelAndRelPathUp, Path.VolumeSeparatorChar, Path.DirectorySeparatorChar); end; --- 89,124 ---- sCombinedVolPathAndDeepRooted: string; sCombinedRelAndRelPathUp: string; + public + class var + sCommonPathOf1And2: string; + sCommonPathOf1And3: string; + sCommonPathOf1And4: string; + sCommonPathOfAll4: string; + public + class var + sRelativePath1: string; + sRelativePath2: string; + sRelativePath3: string; + sRelativePath4: string; end; implementation class constructor PathTestCases.Create; + var + field: FieldInfo; + secondField: FieldInfo; begin ! for field in TypeOf(PathTestCases).GetFields(BindingFlags.Static or BindingFlags.NonPublic) do ! begin ! if field.IsLiteral and field.Name.StartsWith('sNorm') then ! begin ! secondField := TypeOf(PathTestCases).GetField('s' + field.Name.Substring(5), ! BindingFlags.Static or BindingFlags.Public); ! if (secondField <> nil) then ! secondField.SetValue(nil, System.String.Format(string(field.GetValue(nil)), Path.VolumeSeparatorChar, ! Path.DirectorySeparatorChar)); ! end; ! end; end; |
From: Marcel B. <jed...@us...> - 2005-03-28 18:13:43
|
Update of /cvsroot/jedidotnet/main/run In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13540/main/run Modified Files: Jedi.IO.Paths.pas Log Message: * Added: CommonBase method to determine the common base path of two or more paths * Added MakeRelativeFrom method to determine the relative path of one path to another * Added: PathElements to retrieve the individual elements of a path (volume, directories, file name) as an array Index: Jedi.IO.Paths.pas =================================================================== RCS file: /cvsroot/jedidotnet/main/run/Jedi.IO.Paths.pas,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Jedi.IO.Paths.pas 14 Mar 2005 13:30:13 -0000 1.3 --- Jedi.IO.Paths.pas 28 Mar 2005 18:13:19 -0000 1.4 *************** *** 27,31 **** uses ! Jedi.System; {$REGION 'Path manipulations'} --- 27,35 ---- uses ! Jedi.System.SourceVersioning, ! Jedi.System.Strings, ! System.Collections, ! System.IO, ! System.Text; {$REGION 'Path manipulations'} *************** *** 62,65 **** --- 66,71 ---- strict protected class var SysConfig: PathConfig; + strict protected + class function CommonBaseImpl(paths: array of string; config: PathConfig): ArrayList; static; public class function Combine(paths: StringArray): string; overload; static; *************** *** 67,70 **** --- 73,80 ---- class function Combine(path1, path2: string): string; overload; static; class function Combine(path1, path2: string; config: PathConfig): string; overload; static; + class function CommonBase(paths: StringArray): string; overload; static; + class function CommonBase(paths: array of string; config: PathConfig): string; overload; static; + class function CommonBase(path1, path2: string): string; overload; static; + class function CommonBase(path1, path2: string; config: PathConfig): string; overload; static; class function EnsureEndingDirectorySeparator(path: string): string; overload; static; class function EnsureEndingDirectorySeparator(path: string; config: PathConfig): string; overload; static; *************** *** 77,82 **** --- 87,96 ---- class function IsVolumePath(path: string): Boolean; overload; static; class function IsVolumePath(path: string; config: PathConfig): Boolean; overload; static; + class function MakeRelativeFrom(inPath, basePath: string): string; overload; static; + class function MakeRelativeFrom(inPath, basePath: string; config: PathConfig): string; overload; static; class function Normalize(path: string): string; overload; static; class function Normalize(path: string; config: PathConfig): string; overload; static; + class function PathElements(path: string): StringArray; overload; static; + class function PathElements(path: string; config: PathConfig): StringArray; overload; static; class function SystemConfig: PathConfig; static; end; *************** *** 89,99 **** implementation - {$REGION 'implementation uses'} - uses - System.Collections, - System.IO, - System.Text; - {$ENDREGION} - {$AUTOBOX ON} --- 103,106 ---- *************** *** 186,189 **** --- 193,245 ---- end; + class function Path.CommonBase(paths: StringArray): string; + begin + Result := CommonBase(paths, SysConfig); + end; + + class function Path.CommonBase(paths: array of string; config: PathConfig): string; + begin + Result := System.String.Join(config.DirectorySeparator, StringArray(CommonBaseImpl(paths, config).ToArray(TypeOf(string)))); + end; + + class function Path.CommonBase(path1, path2: string): string; + begin + Result := CommonBase([path1, path2], SysConfig); + end; + + class function Path.CommonBase(path1, path2: string; config: PathConfig): string; + begin + Result := CommonBase([path1, path2], config); + end; + + class function Path.CommonBaseImpl(paths: array of string; config: PathConfig): ArrayList; + var + thisPath: string; + currentList: ArrayList; + idx: Integer; + begin + Result := nil; + for thisPath in paths do + begin + currentList := ArrayList.Create(&Array(PathElements(thisPath, config))); + if currentList.Count > 0 then + begin + if Result = nil then + Result := currentList + else + begin + if currentList.Count < Result.Count then + Result.RemoveRange(currentList.Count, Result.Count - currentList.Count); + idx := 0; + while (idx < Result.Count) and + (System.String.Compare(string(Result[idx]), string(currentList[idx]), True) = 0) do + Inc(idx); + if idx < Result.Count then + Result.RemoveRange(idx, Result.Count - idx); + end; + end; + end; + end; + class function Path.EnsureEndingDirectorySeparator(path: string): string; begin *************** *** 275,278 **** --- 331,362 ---- end; + class function Path.MakeRelativeFrom(inPath, basePath: string): string; + begin + Result := MakeRelativeFrom(inPath, basePath, SysConfig); + end; + + class function Path.MakeRelativeFrom(inPath, basePath: string; config: PathConfig): string; + var + basePathElementCount: Integer; + commonElements: ArrayList; + relativeElements: ArrayList; + upLevelCount: Integer; + pathElements: ArrayList; + begin + basePathElementCount := &Array(Path.PathElements(basePath, config)).Length; + commonElements := CommonBaseImpl([basePath, inPath], config); + relativeElements := ArrayList.Create; + upLevelCount := basePathElementCount - commonElements.Count; + while upLevelCount > 0 do + begin + relativeElements.Add('..'); + Dec(upLevelCount); + end; + pathElements := ArrayList.Create(&Array(Path.PathElements(inPath, config))); + pathElements.RemoveRange(0, commonElements.Count); + relativeElements.AddRange(pathElements); + Result := System.String.Join(config.DirectorySeparator, StringArray(relativeElements.ToArray(TypeOf(string)))); + end; + class function Path.Normalize(path: string): string; begin *************** *** 312,315 **** --- 396,409 ---- end; + class function Path.PathElements(path: string): StringArray; + begin + Result := PathElements(path, SysConfig); + end; + + class function Path.PathElements(path: string; config: PathConfig): StringArray; + begin + Result := Normalize(path, config).Split([config.DirectorySeparator]); + end; + class function Path.SystemConfig: PathConfig; begin |
From: Marcel B. <jed...@us...> - 2005-03-28 12:26:25
|
Update of /cvsroot/jedidotnet/tools/JediDoc/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28000/tools/JediDoc/source Added Files: JediDoc.System.Analysis.pas JediDoc.System.Console.pas JediDoc.System.InfoClasses.pas JediDoc.System.Project.pas JediDoc.System.Xml.AssemblyDocGeneration.pas JediDoc.System.Xml.Reflection.pas JediDoc.System.Xml.UnitDocGeneration.pas Log Message: JediDoc tool initial check-in --- NEW FILE: JediDoc.System.Xml.UnitDocGeneration.pas --- {--------------------------------------------------------------------------------------------------- The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/MPL-1.1.html Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either expressed or implied. See the License for the specific language governing rights and limitations under the License. The Original Code is: JediDoc.System.Xml.UnitDocGeneration.pas, released on 2005-03-28. The Initial Developer of the Original Code is Marcel Bestebroer Portions created by Marcel Bestebroer are Copyright (C) 2004 Marcel Bestebroer All Rights Reserved. Contributor(s): You may retrieve the latest version of this file at the JEDI.NET home page, located at http://sf.net/projects/jedidotnet Known Issues: ---------------------------------------------------------------------------------------------------} // $Id: JediDoc.System.Xml.UnitDocGeneration.pas,v 1.1 2005/03/28 12:26:16 jedi_mbe Exp $ unit JediDoc.System.Xml.UnitDocGeneration; interface {$REGION 'uses'} uses Jedi.IO.Paths, JediDoc.System.InfoClasses, JediDoc.System.Xml.Reflection, System.Collections, System.IO, System.Xml; {$ENDREGION} {$REGION 'Unit-based documentation generation'} type UnitDocs = class {$REGION 'Constructors'} strict private class constructor Create; strict protected constructor Create(outPath, fileName: string); {$ENDREGION} {$REGION 'Data'} strict private FUnit: string; FWriter: XmlWriter; strict private class var FUnits: Hashtable; {$ENDREGION} {$REGION 'Protected methods'} strict protected procedure CheckException(member: MemberInfo; memberNode: XmlNode); procedure CheckNode(memberNode: XmlNode; element: string; required: Boolean); overload; procedure CheckNode(memberNode: XmlNode; element, attribute, attributeValue: string; required: Boolean); overload; procedure CheckNodes(memberNode: XmlNode; element: string); procedure CheckParams(member: MemberInfo; memberNode: XmlNode); procedure CheckOverload(member: MemberInfo; memberNode: XmlNode); procedure CheckReturn(member: MemberInfo; memberNode: XmlNode); procedure CheckRemarks(member: MemberInfo; memberNode: XmlNode); procedure CheckSeeAlso(member: MemberInfo; memberNode: XmlNode); procedure CheckSummary(member: MemberInfo; memberNode: XmlNode); procedure CopyNonStandard(memberNode: XmlNode); procedure Process(member: MemberInfo); procedure PullInFromXML(member: MemberInfo; canonName: string); procedure WriteSkeleton(member: MemberInfo; canonName: string); {$ENDREGION} {$REGION 'Protected static methods'} strict protected class function RemovedDoc(outPath, unitName: string): UnitDocs; static; class function UnitDoc(outPath, unitName: string): UnitDocs; static; {$ENDREGION} {$REGION 'Protected internal methods'} protected procedure Close; {$ENDREGION} {$REGION 'Static methods'} public class procedure Generate(docs: DocOverview; outPath: string; processUnits: array of string); static; {$ENDREGION} end; {$ENDREGION} implementation {$REGION 'Helper types'} type StringArray = array of string; {$ENDREGION} {$REGION 'UnitDocs'} class constructor UnitDocs.Create; begin FUnits := Hashtable.Create(CaseInsensitiveHashCodeProvider.DefaultInvariant, CaseInsensitiveComparer.DefaultInvariant); end; constructor UnitDocs.Create(outPath, fileName: string); begin inherited Create; FUnit := Path.Combine(outPath, fileName); FWriter := XmlTextWriter.Create(StreamWriter.Create(FUnit)); XmlTextWriter(FWriter).Formatting := Formatting.Indented; XmlTextWriter(FWriter).Indentation := 2; XmlTextWriter(FWriter).IndentChar := ' '; FWriter.WriteStartDocument; FWriter.WriteComment(System.String.Format('Timestamp most recent auto generation: {0}', DateTime.UtcNow.ToString('yyyy''-''MM''-''dd HH'':''mm'':''ss ''UTC'''))); if fileName.ToLower.StartsWith('namespacedoc.') then FWriter.WriteStartElement('namespacedoc') else FWriter.WriteStartElement('members'); end; procedure UnitDocs.CheckException(member: MemberInfo; memberNode: XmlNode); begin CheckNodes(memberNode, 'exception'); end; procedure UnitDocs.CheckNode(memberNode: XmlNode; element: string; required: Boolean); begin CheckNode(memberNode, element, '', '', required); end; procedure UnitDocs.CheckNode(memberNode: XmlNode; element, attribute, attributeValue: string; required: Boolean); var xPath: string; elementNode: XmlNode; begin if (attribute <> '') and (attributeValue <> '') then xPath := System.String.Format('{0}[@{1}="{2}"]', element, attribute, attributeValue) else xPath := element; if Assigned(memberNode) then elementNode := memberNode.SelectSingleNode(xPath) else elementNode := nil; if Assigned(elementNode) then elementNode.WriteTo(FWriter) else if required then begin FWriter.WriteStartElement(element); if xPath <> element then FWriter.WriteAttributeString(attribute, attributeValue); FWriter.WriteFullEndElement; end; end; procedure UnitDocs.CheckNodes(memberNode: XmlNode; element: string); var nodeList: XmlNodeList; node: XmlNode; begin if Assigned(memberNode) then begin nodeList := memberNode.SelectNodes(element); for node in nodeList do node.WriteTo(FWriter); end; end; procedure UnitDocs.CheckParams(member: MemberInfo; memberNode: XmlNode); var i: Integer; begin for i := 0 to member.Count - 1 do begin if member[i].Location and Location.InAssembly = Location.InAssembly then CheckNode(memberNode, 'param', 'name', member[i].Name, True) end; end; procedure UnitDocs.CheckOverload(member: MemberInfo; memberNode: XmlNode); begin CheckNode(memberNode, 'overloads', False); end; procedure UnitDocs.CheckReturn(member: MemberInfo; memberNode: XmlNode); begin if member.Name.EndsWith(':P') then CheckNode(memberNode, 'value', True) else if member.HasReturnValue then CheckNode(memberNode, 'returns', True); end; procedure UnitDocs.CheckRemarks(member: MemberInfo; memberNode: XmlNode); begin CheckNode(memberNode, 'remarks', False); end; procedure UnitDocs.CheckSeeAlso(member: MemberInfo; memberNode: XmlNode); begin CheckNodes(memberNode, 'seealso'); end; procedure UnitDocs.CheckSummary(member: MemberInfo; memberNode: XmlNode); begin CheckNode(memberNode, 'summary', True); end; procedure UnitDocs.Close; begin FWriter.Close; FWriter := nil; if Path.GetExtension(FUnit) = '.generating' then begin &File.Delete(System.IO.Path.ChangeExtension(FUnit, '.xml')); &File.Move(FUnit, System.IO.Path.ChangeExtension(FUnit, '.xml')); end; end; procedure UnitDocs.CopyNonStandard(memberNode: XmlNode); var node: XmlNode; begin for node in memberNode do if (node.NodeType = XmlNodeType.Element) and (&Array.BinarySearch(&Array(StringArray.Create( 'exception', 'overloads', 'param', 'remarks', 'returns', 'seealso', 'summary', 'value')), node.Name) < 0) then node.WriteTo(FWriter); end; class procedure UnitDocs.Generate(docs: DocOverview; outPath: string; processUnits: array of string); var obj: &Object; mi: MemberInfo; ud: UnitDocs; begin &Array.Sort(&Array(processUnits), CaseInsensitiveComparer.DefaultInvariant); for obj in docs do begin mi := MemberInfo(obj); if (mi.Location <> Location.None) and (&Array.BinarySearch(&Array(processUnits), mi.UnitName, CaseInsensitiveComparer.DefaultInvariant) >= 0) then begin if mi.Location = Location.InXML then ud := RemovedDoc(outPath, mi.UnitName) else ud := UnitDoc(outPath, mi.UnitName); ud.Process(mi); end; end; for ud in FUnits.Values do ud.Close; end; procedure UnitDocs.Process(member: MemberInfo); var typeId: string; canonName: string; begin typeId := member.Name.Chars[member.Name.Length - 1]; canonName := typeId + ':' + member.Name.Substring(0, member.Name.Length - 2); FWriter.WriteStartElement('member'); FWriter.WriteAttributeString('name', canonName); if member.Location and Location.InXML = Location.InXML then PullInFromXML(member, canonName) else WriteSkeleton(member, canonName); FWriter.WriteFullEndElement; end; procedure UnitDocs.PullInFromXML(member: MemberInfo; canonName: string); var isNamespace: Boolean; orgDoc: XmlDocument; orgMemberNode: XmlNode; node: XmlNode; begin isNamespace := canonName.StartsWith('N:'); orgDoc := XmlDocument.Create; orgDoc.PreserveWhitespace := False; orgDoc.Load(member.XmlFile); if isNamespace then orgMemberNode := orgDoc.DocumentElement else orgMemberNode := orgDoc.DocumentElement.SelectSingleNode(System.String.Format('member[@name="{0}"]', &Object(canonName))); if member.Location = Location.InXML then begin for node in orgMemberNode.ChildNodes do node.WriteTo(FWriter); end else begin if isNamespace then CheckSummary(member, orgDoc.DocumentElement) else begin orgMemberNode := orgDoc.DocumentElement.SelectSingleNode(System.String.Format('member[@name="{0}"]', &Object(canonName))); if orgMemberNode.SelectSingleNode('exclude') <> nil then begin FWriter.WriteStartElement('exclude'); FWriter.WriteEndElement; end else begin CheckOverload(member, orgMemberNode); CheckSummary(member, orgMemberNode); CheckParams(member, orgMemberNode); CheckReturn(member, orgMemberNode); CheckRemarks(member, orgMemberNode); CheckException(member, orgMemberNode); CheckSeeAlso(member, orgMemberNode); CopyNonStandard(orgMemberNode); end; end; end; end; class function UnitDocs.RemovedDoc(outPath, unitName: string): UnitDocs; begin unitName := System.String.Format('{0}.removed.{1}', unitName, DateTime.UtcNow.ToString('yyyyMMddHHmmss')); Result := UnitDocs(FUnits[unitName]); if not Assigned(Result) then begin Result := UnitDocs.Create(outPath, unitName); FUnits[unitName] := Result; end; end; class function UnitDocs.UnitDoc(outPath, unitName: string): UnitDocs; begin unitName := unitName + '.generating'; Result := UnitDocs(FUnits[unitName]); if not Assigned(Result) then begin Result := UnitDocs.Create(outPath, unitName); FUnits[unitName] := Result; end; end; procedure UnitDocs.WriteSkeleton(member: MemberInfo; canonName: string); begin if member.IsOptional then FWriter.WriteComment('Optional member; you''re not required to document this member'); CheckSummary(member, nil); CheckParams(member, nil); CheckReturn(member, nil); CheckRemarks(member, nil); end; {$ENDREGION} end. --- NEW FILE: JediDoc.System.InfoClasses.pas --- {--------------------------------------------------------------------------------------------------- The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/MPL-1.1.html Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either expressed or implied. See the License for the specific language governing rights and limitations under the License. The Original Code is: JediDoc.System.InfoClasses.pas, released on 2005-03-28. The Initial Developer of the Original Code is Marcel Bestebroer Portions created by Marcel Bestebroer are Copyright (C) 2004 Marcel Bestebroer All Rights Reserved. Contributor(s): You may retrieve the latest version of this file at the JEDI.NET home page, located at http://sf.net/projects/jedidotnet Known Issues: ---------------------------------------------------------------------------------------------------} // $Id: JediDoc.System.InfoClasses.pas,v 1.1 2005/03/28 12:26:16 jedi_mbe Exp $ unit JediDoc.System.InfoClasses; interface {$REGION 'uses'} uses Jedi.System.SourceVersioning, Jedi.System.Strings, System.Collections, System.Collections.Specialized, System.Globalization, System.IO, System.Reflection, System.Text; {$ENDREGION} {$REGION 'Location flags'} type [Flags] Location = (None = 0, InAssembly = 1, InXML = 2, InBoth = InAssembly + InXML); {$ENDREGION} {$REGION 'Helper types'} type ParameterInfoArray = array of ParameterInfo; StringArray = array of string; {$ENDREGION} {$REGION 'Forward declarations'} type MemberInfo = class; ParamInfo = class; {$ENDREGION} {$REGION 'Documentation overview'} DocOverview = class (MarshalByRefObject) {$REGION 'Constructor'} public constructor Create; {$ENDREGION} {$REGION 'Data'} strict private FMembers: SortedList; // of MemberInfo {$ENDREGION} {$REGION 'Protected methods'} strict protected function AddMember(typeId, name, assembly: string; loc: Location): MemberInfo; {$ENDREGION} {$REGION 'Public methods'} public function AddReflectionMember(typeId, name, assembly: string): MemberInfo; overload; function AddReflectionMember(typeId, name, assembly: string; isOptional: Boolean): MemberInfo; overload; function AddReflectionMember(typeId, name, assembly: string; isOptional: Boolean; params: StringArray): MemberInfo; overload; function AddReflectionMember(typeId, name, assembly: string; isOptional, hasRetVal: Boolean): MemberInfo; overload; function AddReflectionMember(typeId, name, assembly: string; isOptional, hasRetVal: Boolean; params: StringArray): MemberInfo; overload; function AddReflectionMember(typeId, name, assembly: string; params: StringArray): MemberInfo; overload; function AddXmlMember(memberId, xmlFile: string; params: array of string; hasExclude: Boolean): MemberInfo; function GetEnumerator: IEnumerator; overload; function GetEnumerator(assembly: string): IEnumerator; overload; function GetEnumeratorForNamespace(namespace: string): IEnumerator; procedure ProcessAssembly(path: string); {$ENDREGION} end; {$ENDREGION} {$REGION 'Info about a type or member'} MemberInfo = class (MarshalByRefObject) {$REGION 'Constructor'} protected constructor Create(typeId, name, assembly: string); {$ENDREGION} {$REGION 'Data'} strict private FAssembly: string; FHasExclude: Boolean; FHasReturnValue: Boolean; FIsOptional: Boolean; FLocation: Location; FName: string; FParamNames: ArrayList; FUnitName: string; FXmlFile: string; {$ENDREGION} {$REGION 'Protected internal methods'} protected procedure AddParameters(params: array of string; loc: Location); procedure AddReflectionParameters(params: array of string); procedure AddXmlParameters(params: array of string); procedure SetHasReturnValue(value: Boolean); procedure SetIsOptional(value: Boolean); procedure SetUnitName(unitName: string); procedure SetXmlFile(xmlFile: string; hasExclude: Boolean); procedure UpdateLocationFlags(loc: Location); {$ENDREGION} {$REGION 'Method overrides'} public function GetEnumerator: IEnumerator; function ToString: string; override; {$ENDREGION} {$REGION 'Property accessors'} public function get_Count: Integer; function get_Items(index: Integer): ParamInfo; function get_UnitName: string; {$ENDREGION} {$REGION 'Properties'} public property Assembly: string read FAssembly; property HasExclude: Boolean read FHasExclude; property HasReturnValue: Boolean read FHasReturnValue; property IsOptional: Boolean read FIsOptional; property Location: Location read FLocation; property Name: string read FName; property Count: Integer read get_Count; property Items[&index: Integer]: ParamInfo read get_Items; default; property UnitName: string read get_UnitName; property XmlFile: string read FXmlFile; {$ENDREGION} end; {$ENDREGION} {$REGION 'Information about a property or method parameter'} ParamInfo = class (MarshalByRefObject) {$REGION 'Constructor'} protected constructor Create(memberInfo: MemberInfo; name: string; loc: Location); {$ENDREGION} {$REGION 'Data'} strict private FLocation: Location; FMember: MemberInfo; FName: string; {$ENDREGION} {$REGION 'Protected internal methods'} protected procedure UpdateLocationFlags(loc: Location); {$ENDREGION} {$REGION 'Method overrides'} public function ToString: string; override; {$ENDREGION} {$REGION 'Properties'} public property Location: Location read FLocation; property Member: MemberInfo read FMember; property Name: string read FName; {$ENDREGION} end; {$ENDREGION} {$REGION 'Assembly based reflection'} AssemblyProcessor = class (MarshalByRefObject) {$REGION 'Constructor'} public constructor Create; {$ENDREGION} {$REGION 'Data'} strict protected docs: DocOverview; assembly: string; {$ENDREGION} {$REGION 'Protected methods'} strict protected procedure HandleEvent(thisEvent: EventInfo); procedure HandleField(thisField: FieldInfo); procedure HandleMethod(thisMethod: MethodBase); procedure HandleProperty(thisProperty: PropertyInfo); procedure HandleType(thisType: &Type); {$ENDREGION} {$REGION 'Protected static methods'} strict protected class function GetUnitFor(thisType: &Type): string; overload; static; class function GetUnitFor(thisMember: System.Reflection.MemberInfo): string; overload; static; class function GetUnitFromUnitMaps(thisType: &Type): string; static; class function IsEventDocumentable(thisEvent: EventInfo): Boolean; static; class function IsEventOptional(thisEvent: EventInfo): Boolean; static; class function IsFieldDocumentable(thisField: FieldInfo): Boolean; static; class function IsFieldOptional(thisField: FieldInfo): Boolean; static; class function IsMethodDocumentable(thisMethod: MethodBase; isPropertyCheck: Boolean): Boolean; static; class function IsMethodOptional(thisMethod: MethodBase): Boolean; static; class function IsPropertyDocumentable(thisProperty: PropertyInfo): Boolean; static; class function IsPropertyOptional(thisProperty: PropertyInfo): Boolean; static; class function IsTypeDocumentable(thisType: &Type): Boolean; static; class function IsTypeOptional(thisType: &Type): Boolean; static; class function IsUnitMapClass(thisType: &Type): Boolean; static; {$ENDREGION} {$REGION 'Public methods'} public procedure ParseAssembly(path: string; docs: DocOverview); {$ENDREGION} end; {$ENDREGION} {$REGION 'Naming conversions'} type Conversions = class (&Object) public class function ParamNames(params: ParameterInfoArray): StringArray; static; class function ParamString(params: ParameterInfoArray): string; static; class function MemberNameToDocName(member: System.Reflection.MemberInfo): string; static; class function MemberNameToDocType(member: System.Reflection.MemberInfo): string; static; class function TypeNameToDocName(&type: &Type): string; static; class function XmlNameToDocName(name: string): string; static; class function XmlNameToDocType(name: string): string; static; end; {$ENDREGION} implementation {$REGION 'Protected class: FilteredEnumerator'} type FilteredEnumerator = class (&Object, IEnumerator) {$REGION 'Constructor'} strict protected constructor Create(baseEnum: IEnumerator; filterForNamespace: Boolean; filterValue: string); {$ENDREGION} {$REGION 'Data'} strict private FBaseEnumerator: IEnumerator; FFilterForNamespace: Boolean; FFilterValue: string; FFilterValueAlt: string; {$ENDREGION} {$REGION 'IEnumerator methods'} strict protected function get_Current: &Object; function MoveNext: Boolean; procedure Reset; {$ENDREGION} {$REGION 'Protected methods'} strict protected function IsAllowed(info: MemberInfo): Boolean; {$ENDREGION} {$REGION 'Static methods'} public class function CreateForAssemblyFilter(baseEnum: IEnumerator; assemblyName: string): IEnumerator; static; class function CreateForNamespaceFilter(baseEnum: IEnumerator; namespace: string): IEnumerator; static; {$ENDREGION} end; {$ENDREGION} {$REGION 'AssemblyProcessor'} constructor AssemblyProcessor.Create; begin inherited Create; end; class function AssemblyProcessor.GetUnitFor(thisType: &Type): string; var attrs: array of &Object; enum: IEnumerator; pi: PropertyInfo; function IsSubClassOf(t: &Type; name: string): Boolean; begin Result := False; while not Result and Assigned(t) do begin Result := System.String.Compare(t.FullName, name, True, CultureInfo.InvariantCulture) = 0; t := t.BaseType; end; end; begin attrs := thisType.GetCustomAttributes(TypeOf(TUnitNameAttribute), False); if Length(attrs) > 0 then Result := TUnitNameAttribute(attrs[0]).UnitName else begin { We can't use SourceInfoAttribute directly, since this assembly will use a different version of the 'Jedi.System' assembly than the one that might get parsed uses (resulting in no SourceInfoAttribute being found for records/interfaces/enumerations/delegates). This problem will go away when the Jedi.System assembly would be strong-named and placed in the GAC. For now, we'll simply use reflection to get the required information. } Result := ''; attrs := thisType.GetCustomAttributes(False); enum := &Array(attrs).GetEnumerator; while enum.MoveNext and (Result = '') do if IsSubClassOf(enum.Current.GetType, TypeOf(SourceInfoAttribute).FullName) then begin pi := enum.Current.GetType.GetProperty('SourceFile'); if Assigned(pi) then Result := Path.GetFileNameWithoutExtension(System.String(pi.GetValue(enum.Current, []))); end; if (Result = '') and Assigned(thisType.DeclaringType) then Result := GetUnitFor(thisType.DeclaringType) end; if Result = '' then Result := GetUnitFromUnitMaps(thisType); if Result = '' then Result := thisType.Namespace; end; class function AssemblyProcessor.GetUnitFor(thisMember: System.Reflection.MemberInfo): string; begin Result := GetUnitFor(thisMember.DeclaringType); if Result = '' then raise Exception.Create(System.String.Format('No unit for member {0}', thisMember)); end; class function AssemblyProcessor.GetUnitFromUnitMaps(thisType: &Type): string; var unitNS: string; typeArray: array of &Type; currentType: &Type; begin Result := ''; unitNS := thisType.Namespace + '.Units'; try typeArray := thisType.Assembly.GetTypes; except on e: ReflectionTypeLoadException do typeArray := e.Types; end; for currentType in typeArray do begin if (unitNS = currentType.Namespace) and (currentType.Name = '$map$') and (currentType.GetField(thisType.Name, BindingFlags.Static or BindingFlags.Instance or BindingFlags.NonPublic or BindingFlags.Public) <> nil) then begin Result := System.String.Format('{0}.{1}', thisType.Namespace, currentType.DeclaringType.Name); Break; end; end; end; procedure AssemblyProcessor.HandleEvent(thisEvent: EventInfo); var di: MemberInfo; begin di := docs.AddReflectionMember( Conversions.MemberNameToDocType(thisEvent), Conversions.MemberNameToDocName(thisEvent), assembly, IsEventOptional(thisEvent), []); di.SetUnitName(GetUnitFor(thisEvent)); end; procedure AssemblyProcessor.HandleField(thisField: FieldInfo); var di: MemberInfo; begin di := docs.AddReflectionMember( Conversions.MemberNameToDocType(thisField), Conversions.MemberNameToDocName(thisField), assembly, IsFieldOptional(thisField), False, []); di.SetUnitName(GetUnitFor(thisField)); end; procedure AssemblyProcessor.HandleMethod(thisMethod: MethodBase); var retType: &Type; di: MemberInfo; begin if (thisMethod is MethodInfo) then retType := MethodInfo(thisMethod).ReturnType else retType := nil; di := docs.AddReflectionMember( Conversions.MemberNameToDocType(thisMethod), Conversions.MemberNameToDocName(thisMethod), assembly, IsMethodOptional(thisMethod), Assigned(retType) and not TypeOf(System.Void).IsAssignableFrom(retType), Conversions.ParamNames(thisMethod.GetParameters)); di.SetUnitName(GetUnitFor(thisMethod)); end; procedure AssemblyProcessor.HandleProperty(thisProperty: PropertyInfo); var di: MemberInfo; begin di := docs.AddReflectionMember( Conversions.MemberNameToDocType(thisProperty), Conversions.MemberNameToDocName(thisProperty), assembly, IsPropertyOptional(thisProperty), True, Conversions.ParamNames(thisProperty.GetIndexParameters)); di.SetUnitName(GetUnitFor(thisProperty)); end; procedure AssemblyProcessor.HandleType(thisType: &Type); var di: MemberInfo; mi: System.Reflection.MemberInfo; begin // Asserts the namespace item exists. di := docs.AddReflectionMember('N:', thisType.Namespace, assembly); di.SetUnitName('namespaceDoc.' + thisType.Namespace); // Asserts the type exists. di := docs.AddReflectionMember('T:', Conversions.TypeNameToDocName(thisType), assembly, IsTypeOptional(thisType)); di.SetUnitName(GetUnitFor(thisType)); for mi in thisType.GetMembers(BindingFlags.Static or BindingFlags.Instance or BindingFlags.Public or BindingFlags.NonPublic or BindingFlags.DeclaredOnly) do begin if (mi is EventInfo) and IsEventDocumentable(EventInfo(mi)) then HandleEvent(EventInfo(mi)) else if (mi is FieldInfo) and IsFieldDocumentable(FieldInfo(mi)) then HandleField(FieldInfo(mi)) else if (mi is MethodBase) and IsMethodDocumentable(MethodBase(mi), False) then HandleMethod(MethodBase(mi)) else if (mi is PropertyInfo) and IsPropertyDocumentable(PropertyInfo(mi)) then HandleProperty(PropertyInfo(mi)); end; end; class function AssemblyProcessor.IsEventDocumentable(thisEvent: EventInfo): Boolean; var accessMethod: MethodInfo; begin accessMethod := thisEvent.GetAddMethod(True); if not Assigned(accessMethod) then accessMethod := thisEvent.GetRemoveMethod(True); Result := thisEvent.IsSpecialName and Assigned(accessMethod) and IsMethodDocumentable(accessMethod, True); end; class function AssemblyProcessor.IsEventOptional(thisEvent: EventInfo): Boolean; var accessMethod: MethodInfo; begin accessMethod := thisEvent.GetAddMethod(True); if not Assigned(accessMethod) then accessMethod := thisEvent.GetRemoveMethod(True); Result := Assigned(accessMethod) and IsMethodOptional(accessMethod); end; class function AssemblyProcessor.IsFieldDocumentable(thisField: FieldInfo): Boolean; begin Result := not thisField.IsSpecialName and (thisField.IsPublic or thisField.IsFamily or thisField.IsFamilyOrAssembly); end; class function AssemblyProcessor.IsFieldOptional(thisField: FieldInfo): Boolean; begin Result := False; end; class function AssemblyProcessor.IsMethodDocumentable(thisMethod: MethodBase; isPropertyCheck: Boolean): Boolean; var methodArray: array of MethodInfo; i: Integer; begin // ignore any method declared by TObjectHelper methodArray := TypeOf(TObjectHelper).GetMethods(BindingFlags.Static or BindingFlags.Public); i := High(methodArray); while (i >= 0) and (methodArray[i].Name <> thisMethod.Name) do Dec(i); Result := i < 0; if Result then Result := not thisMethod.IsPrivate and not thisMethod.IsAssembly and (thisMethod.Name <> '@__CloneHelper__') and (thisMethod.Name <> '__Initialize__'); if Result and not isPropertyCheck and thisMethod.IsSpecialName then { only if it's a constructor or a class operator } Result := thisMethod.IsConstructor or thisMethod.Name.StartsWith('op_'); end; class function AssemblyProcessor.IsMethodOptional(thisMethod: MethodBase): Boolean; begin Result := // optional type => optional method IsTypeOptional(thisMethod.DeclaringType) or // if it the method is inherited from a parent class the method is also optional ((thisMethod is MethodInfo) and (MethodInfo(thisMethod).GetBaseDefinition.DeclaringType <> thisMethod.DeclaringType)); end; class function AssemblyProcessor.IsPropertyDocumentable(thisProperty: PropertyInfo): Boolean; var accessMethod: MethodInfo; begin accessMethod := thisProperty.GetGetMethod(True); if not Assigned(accessMethod) then accessMethod := thisProperty.GetSetMethod(True); Result := not thisProperty.IsSpecialName and Assigned(accessMethod) and IsMethodDocumentable(accessMethod, True); end; class function AssemblyProcessor.IsPropertyOptional(thisProperty: PropertyInfo): Boolean; var accessMethod: MethodInfo; begin accessMethod := thisProperty.GetGetMethod(True); if not Assigned(accessMethod) then accessMethod := thisProperty.GetSetMethod(True); Result := Assigned(accessMethod) and IsMethodOptional(accessMethod); end; class function AssemblyProcessor.IsTypeDocumentable(thisType: &Type): Boolean; begin // Ignore all the Delphi meta classes and implementation declared types. if thisType.FullName.IndexOfAny(['@', '$']) > -1 then Result := False else if thisType.DeclaringType = nil then Result := thisType.IsPublic else Result := (thisType.IsNestedPublic or thisType.IsNestedFamORAssem) and IsTypeDocumentable(thisType.DeclaringType); // Ignore the Unit type (Delphi 8) or the *.Units namespace (Delphi 2005) if it is indeed Delphi based (look for // the initalization section of the unit in both cases; must be a class static public method.) if Result then begin if thisType.Name = 'Unit' then Result := not Assigned(thisType.GetMethod(thisType.Namespace, BindingFlags.Static or BindingFlags.&Public)) else if thisType.Namespace.EndsWith('.Units') then Result := not Assigned(thisType.GetMethod( thisType.Namespace.Substring(0, thisType.Namespace.Length - 5) + thisType.Name, BindingFlags.Static or BindingFlags.&Public)); end; if Result and Assigned(thisType.BaseType) then // better make sure the base type hierarchy if documentable too. Result := IsTypeDocumentable(thisType.BaseType); end; class function AssemblyProcessor.IsTypeOptional(thisType: &Type): Boolean; begin if thisType.DeclaringType = nil then Result := not thisType.IsPublic else Result := not thisType.IsNestedPublic or thisType.DeclaringType.IsSealed; end; class function AssemblyProcessor.IsUnitMapClass(thisType: &Type): Boolean; begin Result := thisType.IsNestedPrivate and (thisType.Name = '$map$') and thisType.Namespace.EndsWith('.Units'); end; procedure AssemblyProcessor.ParseAssembly(path: string; docs: DocOverview); var assy: System.Reflection.Assembly; thisType: &Type; begin assy := System.Reflection.Assembly.LoadFrom(path); Self.docs := docs; assembly := assy.GetName.Name; for thisType in &Array(assy.GetExportedTypes) do if IsTypeDocumentable(thisType) then HandleType(thisType) end; {$ENDREGION} {$REGION 'Conversions'} class function Conversions.MemberNameToDocName(member: System.Reflection.MemberInfo): string; var sb: StringBuilder; params: array of ParameterInfo; begin sb := StringBuilder.Create; params := nil; if member is PropertyInfo then params := PropertyInfo(member).GetIndexParameters else if member is MethodBase then params := MethodBase(member).GetParameters; sb.Append(TypeNameToDocName(member.ReflectedType)); sb.Append('.'); sb.Append(member.Name.Replace('.', '#')); if Assigned(params) then sb.Append(ParamString(params)); if (member is MethodInfo) and ((member.Name.ToLower = 'op_implicit') or (member.Name.ToLower = 'op_explicit')) then begin sb.Append('~'); sb.Append(TypeNameToDocName(MethodInfo(member).ReturnType)); end; Result := sb.ToString; end; class function Conversions.MemberNameToDocType(member: System.Reflection.MemberInfo): string; begin if member is PropertyInfo then Result := 'P' else if member is MethodBase then Result := 'M' else if member is EventInfo then Result := 'E' else if member is FieldInfo then Result := 'F' else Result := '!'; end; class function Conversions.ParamNames(params: array of ParameterInfo): StringArray; var i: Integer; begin if Assigned(params) then begin Result := new (StringArray, &Array(params).Length); for i := 0 to &Array(params).Length - 1 do Result[i] := params[i].Name; end else Result := new (StringArray, 0); end; class function Conversions.ParamString(params: array of ParameterInfo): string; var sb: StringBuilder; i: Integer; begin sb := StringBuilder.Create; for i := Low(params) to High(params) do begin sb.Append(TypeNameToDocName(params[i].ParameterType).Replace('&', '@')); sb.Append(','); end; if sb.Length > 0 then begin sb.Insert(0, '('); sb.Remove(sb.Length - 1, 1); sb.Append(')'); end; Result := sb.ToString; end; class function Conversions.TypeNameToDocName(&type: &Type): string; begin Result := &type.FullName.Replace('+', '.'); end; class function Conversions.XmlNameToDocName(name: string): string; begin Result := name.Substring(2); if name.EndsWith('.NamespaceDoc') then Result := Result.Substring(0, Result.Length - 'NamespaceDoc'.Length); end; class function Conversions.XmlNameToDocType(name: string): string; begin if name.EndsWith('.NamespaceDoc') then Result := 'N:' else Result := name.ToUpper.Substring(0, 2); end; {$ENDREGION} {$REGION 'DocOVerview'} constructor DocOverview.Create; begin inherited Create; FMembers := SortedList.Create(CaseInsensitiveComparer.DefaultInvariant); end; function DocOverview.AddMember(typeId, name, assembly: string; loc: Location): MemberInfo; var keyName: string; idx: Integer; begin keyName := name + ' ' + typeId.ToUpper.Chars[0]; idx := FMembers.IndexOfKey(keyName); if idx < 0 then begin Result := MemberInfo.Create(typeId, name, assembly); FMembers.Add(keyName, Result); end else Result := MemberInfo(FMembers[keyName]); Result.UpdateLocationFlags(loc); end; function DocOverview.AddReflectionMember(typeId, name, assembly: string): MemberInfo; begin Result := AddMember(typeId, name, assembly, Location.InAssembly); end; function DocOverview.AddReflectionMember(typeId, name, assembly: string; isOptional: Boolean): MemberInfo; begin Result := AddReflectionMember(typeId, name, assembly); Result.SetIsOptional(isOptional); end; function DocOverview.AddReflectionMember(typeId, name, assembly: string; isOptional: Boolean; params: array of string): MemberInfo; begin Result := AddReflectionMember(typeId, name, assembly); Result.SetIsOptional(isOptional); Result.AddReflectionParameters(params); end; function DocOverview.AddReflectionMember(typeId, name, assembly: string; isOptional, hasRetVal: Boolean): MemberInfo; begin Result := AddReflectionMember(typeId, name, assembly); Result.SetIsOptional(isOptional); end; function DocOverview.AddReflectionMember(typeId, name, assembly: string; isOptional, hasRetVal: Boolean; params: array of string): MemberInfo; begin Result := AddReflectionMember(typeId, name, assembly); Result.SetIsOptional(isOptional); Result.SetHasReturnValue(hasRetVal); Result.AddReflectionParameters(params); end; function DocOverview.AddReflectionMember(typeId, name, assembly: string; params: array of string): MemberInfo; begin Result := AddReflectionMember(typeId, name, assembly); Result.AddReflectionParameters(params); end; function DocOverview.AddXmlMember(memberId, xmlFile: string; params: array of string; hasExclude: Boolean): MemberInfo; begin Result := AddMember(Conversions.XmlNameToDocType(memberId), Conversions.XmlNameToDocName(memberId), '', Location.InXml); Result.SetXmlFile(xmlFile, hasExclude); if Result.UnitName = '' then Result.SetUnitName(StringUtils.BeforeLast(StringUtils.AfterLastAnyOf(xmlFile, '/\'.ToCharArray), '.')); Result.AddXmlParameters(params); end; function DocOverview.GetEnumerator: IEnumerator; begin Result := FMembers.Values.GetEnumerator; end; function DocOverview.GetEnumerator(assembly: string): IEnumerator; begin Result := FilteredEnumerator.CreateForAssemblyFilter(GetEnumerator, assembly); end; function DocOverview.GetEnumeratorForNamespace(namespace: string): IEnumerator; begin Result := FilteredEnumerator.CreateForNamespaceFilter(GetEnumerator, namespace); end; procedure DocOverview.ProcessAssembly(path: string); var domainSetup: AppDomainSetup; loaderDomain: AppDomain; processor: AssemblyProcessor; begin domainSetup := AppDomainSetup.Create; domainSetup.ApplicationBase := AppDomain.CurrentDomain.BaseDirectory; domainSetup.PrivateBinPath := AppDomain.CurrentDomain.BaseDirectory; domainSetup.ApplicationName := 'Loader'; domainSetup.ShadowCopyFiles := 'true'; loaderDomain := AppDomain.CreateDomain('Assembly Loader', nil, domainSetup); processor := AssemblyProcessor(loaderDomain.CreateInstanceFromAndUnwrap(GetType.Assembly.Location, TypeOf(AssemblyProcessor).FullName)); try processor := AssemblyProcessor.Create; processor.ParseAssembly(path, Self); finally AppDomain.Unload(loaderDomain); loaderDomain := nil; end; end; {$ENDREGION} {$REGION 'FilteredEnumerator'} constructor FilteredEnumerator.Create(baseEnum: IEnumerator; filterForNamespace: Boolean; filterValue: string); begin inherited Create; FBaseEnumerator := baseEnum; FFilterForNamespace := filterForNamespace; if filterForNamespace then begin if not filterValue.EndsWith('.') then FFilterValue := filterValue + '.' else FFilterValue := filterValue; FFilterValueAlt := FFilterValue.Substring(0, FFilterValue.Length - 1) + ' N'; end else FFilterValue := filterValue; end; class function FilteredEnumerator.CreateForAssemblyFilter(baseEnum: IEnumerator; assemblyName: string): IEnumerator; begin Result := FilteredEnumerator.Create(baseEnum, False, assemblyName); end; class function FilteredEnumerator.CreateForNamespaceFilter(baseEnum: IEnumerator; namespace: string): IEnumerator; begin Result := FilteredEnumerator.Create(baseEnum, True, namespace); end; function FilteredEnumerator.get_Current: &Object; begin Result := FBaseEnumerator.Current; end; function FilteredEnumerator.IsAllowed(info: MemberInfo): Boolean; begin if FFilterForNamespace then Result := (System.String.Compare(FFilterValue, info.Name.Substring(0, FFilterValue.Length), True, CultureInfo.InvariantCulture) = 0) or (System.String.Compare(FFilterValueAlt, info.Name.Substring(0, FFilterValueAlt.Length), True, CultureInfo.InvariantCulture) = 0) else Result := System.String.Compare(FFilterValue, info.Assembly, True, CultureInfo.InvariantCulture) = 0; end; function FilteredEnumerator.MoveNext: Boolean; begin repeat Result := FBaseEnumerator.MoveNext; until not Result or IsAllowed(MemberInfo(FBaseEnumerator.Current)); end; procedure FilteredEnumerator.Reset; begin FBaseEnumerator.Reset; end; {$ENDREGION} {$REGION 'MemberInfo'} constructor MemberInfo.Create(typeId, name, assembly: string); begin inherited Create; FAssembly := assembly; FName := name + ':' + typeId.SubString(0, 1).ToUpper; FLocation := JediDoc.System.InfoClasses.Location.None; FParamNames := ArrayList.Create; end; procedure MemberInfo.AddParameters(params: array of string; loc: Location); var thisParamName: string; hasFound: Boolean; thisParamInfo: ParamInfo; begin for thisParamName in params do begin hasFound := False; for thisParamInfo in FParamNames do begin if System.String.Compare(thisParamName, thisParamInfo.Name, True, CultureInfo.InvariantCulture) = 0 then begin thisParamInfo.UpdateLocationFlags(JediDoc.System.InfoClasses.Location.InXML); hasFound := True; Break; end; end; if not hasFound then FParamNames.Add(ParamInfo.Create(Self, thisParamName, loc)); end; end; procedure MemberInfo.AddReflectionParameters(params: array of string); begin AddParameters(params, JediDoc.System.InfoClasses.Location.InAssembly); end; procedure MemberInfo.AddXmlParameters(params: array of string); begin AddParameters(params, JediDoc.System.InfoClasses.Location.InXml); end; function MemberInfo.get_Count: Integer; begin Result := FParamNames.Count; end; function MemberInfo.get_Items(index: Integer): ParamInfo; begin Result := ParamInfo(FParamNames[index]); end; function MemberInfo.get_UnitName: string; begin Result := FUnitName end; function MemberInfo.GetEnumerator: IEnumerator; begin Result := FParamNames.GetEnumerator; end; procedure MemberInfo.SetHasReturnValue(value: Boolean); begin FHasReturnValue := value; end; procedure MemberInfo.SetIsOptional(value: Boolean); begin FIsOptional := value; end; procedure MemberInfo.SetUnitName(unitName: string); begin FUnitName := unitName; end; procedure MemberInfo.SetXmlFile(xmlFile: string; hasExclude: Boolean); begin FXmlFile := xmlFile; FHasExclude := hasExclude; end; function MemberInfo.ToString: string; begin Result := FName; end; procedure MemberInfo.UpdateLocationFlags(loc: Location); begin FLocation := FLocation or loc; end; {$ENDREGION} {$REGION 'ParamInfo'} constructor ParamInfo.Create(memberInfo: MemberInfo; name: string; loc: Location); begin inherited Create; FMember := memberInfo; FName := name; FLocation := loc; end; function ParamInfo.ToString: string; begin Result := FMember.ToString + ' [param ' + FName + ']'; end; procedure ParamInfo.UpdateLocationFlags(loc: Location); begin FLocation := FLocation or loc; end; {$ENDREGION} end. --- NEW FILE: JediDoc.System.Console.pas --- {--------------------------------------------------------------------------------------------------- The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/MPL-1.1.html Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either expressed or implied. See the License for the specific language governing rights and limitations under the License. The Original Code is: JediDoc.System.Console.pas, released on 2005-03-28. The Initial Developer of the Original Code is Marcel Bestebroer Portions created by Marcel Bestebroer are Copyright (C) 2004 Marcel Bestebroer All Rights Reserved. Contributor(s): You may retrieve the latest version of this file at the JEDI.NET home page, located at http://sf.net/projects/jedidotnet Known Issues: ---------------------------------------------------------------------------------------------------} // $Id: JediDoc.System.Console.pas,v 1.1 2005/03/28 12:26:16 jedi_mbe Exp $ unit JediDoc.System.Console; interface {$REGION 'uses'} uses Jedi.System.CommandLine, JediDoc.System.Project, System.Diagnostics, System.IO; {$ENDREGION} {$REGION 'Settings class'} type Settings = class {$REGION 'Constructor'} strict protected constructor Create; {$ENDREGION} {$REGION 'ExecutionTypes enumeration'} public type ExecutionTypes = (SaveProject = 0, Analyse = 1, UnitGeneration = 2, AssemblyGeneration = 4); {$ENDREGION} {$REGION 'Data'} strict private class var FArgumentDetected: Boolean; class var FExecutionType: ExecutionTypes; class var FHelpShown: Boolean; class var FProjectFile: string; class var FProjectContents: Project; class var FQuiet: Boolean; {$ENDREGION} {$REGION 'Protected static methods'} strict protected [CommandLineArgument(CaseSensitive = False, Prefix = '/', Name = '?')] [CommandLineArgument(CaseSensitive = False, Prefix = '--', Name = 'help')] class procedure HelpSwitch(match, commandLine: string; var index: Integer); static; {$ENDREGION} {$REGION 'Protected property accessors'} strict protected class function get_Analyse: Boolean; static; class function get_AssemblyGeneration: Boolean; static; class function get_UnitGeneration: Boolean; static; class procedure set_Analyse(value: Boolean); static; class procedure set_AssemblyGeneration(value: Boolean); static; class procedure set_UnitGeneration(value: Boolean); static; {$ENDREGION} {$REGION 'Protected properties'} strict protected [CommandLineArgument(CaseSensitive = False, Prefix = '--', Name = 'analyse')] class property Analyse: Boolean read get_Analyse write set_Analyse; [CommandLineArgument(CaseSensitive = False, Prefix = '--', Name = 'generate:assemblydocs')] class property AssemblyGeneration: Boolean read get_AssemblyGeneration write set_AssemblyGeneration; [CommandLineArgument(CaseSensitive = False, Prefix = '--', Name = 'generate:unitdocs')] class property UnitGeneration: Boolean read get_UnitGeneration write set_UnitGeneration; {$ENDREGION} {$REGION 'Static methods'} public class function ArgumentDetected: Boolean; static; class function HelpShown: Boolean; static; class procedure ParseCommandLine; static; class procedure ShowHelp; static; {$ENDREGION} {$REGION 'Properties'} public class property ExecutionType: ExecutionTypes read FExecutionType; class property ProjectContents: Project read FProjectContents; class property ProjectFile: string read FProjectFile; [CommandLineArgument(CaseSensitive = False, Prefix = '-', Name = 'q')] class property Quiet: Boolean read FQuiet write FQuiet; {$ENDREGION} end; {$ENDREGION} implementation {$REGION 'Settings'} constructor Settings.Create; begin inherited Create; end; class function Settings.ArgumentDetected: Boolean; begin Result := FArgumentDetected or (FProjectContents.Assemblies.Count > 0) or (FProjectContents.XmlFiles.Count > 0); end; class function Settings.HelpShown: Boolean; begin Result := FHelpShown; end; class function Settings.get_Analyse: Boolean; begin Result := (FExecutionType and ExecutionTypes.Analyse) = ExecutionTypes.Analyse; end; class function Settings.get_AssemblyGeneration: Boolean; begin Result := (FExecutionType and ExecutionTypes.AssemblyGeneration) = ExecutionTypes.AssemblyGeneration; end; class function Settings.get_UnitGeneration: Boolean; begin Result := (FExecutionType and ExecutionTypes.UnitGeneration) = ExecutionTypes.UnitGeneration; end; class procedure Settings.set_Analyse(value: Boolean); begin FArgumentDetected := True; if value then FExecutionType := FExecutionType or ExecutionTypes.Analyse else FExecutionType := (FExecutionType or ExecutionTypes.Analyse) xor ExecutionTypes.Analyse; end; class procedure Settings.set_AssemblyGeneration(value: Boolean); begin FArgumentDetected := True; if value then FExecutionType := FExecutionType or ExecutionTypes.AssemblyGeneration else FExecutionType := (FExecutionType or ExecutionTypes.AssemblyGeneration) xor ExecutionTypes.AssemblyGeneration; end; class procedure Settings.set_UnitGeneration(value: Boolean); begin FArgumentDetected := True; if value then FExecutionType := FExecutionType or ExecutionTypes.UnitGeneration else FExecutionType := (FExecutionType or ExecutionTypes.UnitGeneration) xor ExecutionTypes.UnitGeneration; end; class procedure Settings.HelpSwitch(match, commandLine: string; var index: Integer); begin FArgumentDetected := True; FHelpShown := True; index := commandLine.Length; // stop further parsing ShowHelp; end; class procedure Settings.ParseCommandLine; var notSwitches: array of string; begin FProjectContents := Project.Create; try notSwitches := CommandLine.Parse([TypeOf(Settings), FProjectContents.Assemblies, FProjectContents.XmlFiles], '@'); if &Array(notSwitches).Length > 1 then begin Console.WriteLine('ERROR: Commandline parsing error:'); Console.WriteLine('More than project filename specified.'); Halt(100); end; if &Array(notSwitches).Length = 1 then FProjectFile := notSwitches[0]; if ArgumentDetected and not HelpShown and (ExecutionType = ExecutionTypes.SaveProject) and (ProjectFile = '') then begin Console.WriteLine('ERROR: Commandline parsing error:'); Console.WriteLine('No project filename specified to save to.'); Halt(100); end; //TODO: loading project file if one was specified. except on e: CommandLineException do begin Console.WriteLine('ERROR: Commandline parsing error:'); Console.WriteLine(e.Message); Halt(100); end else raise; end; end; class procedure Settings.ShowHelp; begin Console.Write('Usage: '); Console.Write(Path.GetFileNameWithoutExtension(Process.GetCurrentProcess.MainModule.ModuleName)); Console.WriteLine(' [options] project'); Console.WriteLine; Console.WriteLine('Valid options:'); Console.WriteLine; Console.WriteLine(' -a[ssemblypath]:<path of assembly/assemblies>'); Console.WriteLine(' Adds the specified assembly or assemblies to the project. You can use'); Console.WriteLine(' wild-cards in the file name.'); Console.WriteLine(' -x[mlpath]:<path of xml file/files>'); Console.WriteLine(' Adds the specified xml file or files to the project. You can use wild-'); Console.WriteLine(' cards in the file name.'); Console.WriteLine(' -q'); Console.WriteLine(' Use quiet mode (no output other than errors and warnings).'); Console.WriteLine(' /? or --help'); Console.WriteLine(' Show this help page (also shown when no arguments were specified).'); Console.WriteLine(' --analyse'); Console.WriteLine(' Analyses the project for mismatches in documentation/assemblies.'); Console.WriteLine(' Will always result in output, regardless of -q option.'); Console.WriteLine(' --generate:unitdocs'); Console.WriteLine(' Generates/updates unit based XML files from the parsed assemblies.'); Console.WriteLine(' --generate:assemblydocs'); Console.WriteLine(' Generates/updates assembly based XML files from the parsed assemblies and'); Console.WriteLine(' xml files. <include> tags will be processed.'); Console.WriteLine; Console.WriteLine('Notes:'); Console.WriteLine(' The -a and -x options affect the default project. When a project file name is'); Console.WriteLine(' specified, those settings will be ignored.'); Console.WriteLine; Console.WriteLine(' If neither the analyse nor either of the generate options were specified, the'); Console.WriteLine(' default project as build through the -a and -x options will be saved as the'); Console.WriteLine(' specified project file (if no file name is specied an error message is'); Console.WriteLine(' displayed).'); Console.WriteLine; Console.WriteLine(' Instead of specifying everything on the command line, you can put all'); Console.WriteLine(' arguments in a file and use that file through the @<file> option. You can'); Console.WriteLine(' freely mix the usage of response files and arguments.'); Console.WriteLine; end; {$ENDREGION} end. --- NEW FILE: JediDoc.System.Analysis.pas --- {--------------------------------------------------------------------------------------------------- The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/MPL-1.1.html Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either expressed or implied. See the License for the specific language governing rights and limitations under the License. The Original Code is: JediDoc.System.Analysis.pas, released on 2005-03-28. The Initial Developer of the Original Code is Marcel Bestebroer Portions created by Marcel Bestebroer are Copyright (C) 2004 Marcel Bestebroer All Rights Reserved. Contributor(s): You may retrieve the latest version of this file at the JEDI.NET home page, located at http://sf.net/projects/jedidotnet Known Issues: ---------------------------------------------------------------------------------------------------} // $Id: JediDoc.System.Analysis.pas,v 1.1 2005/03/28 12:26:16 jedi_mbe Exp $ unit JediDoc.System.Analysis; interface {$REGION 'uses'} uses System.Collections, System.IO, Jedi.System.Strings, JediDoc.System.InfoClasses; {$ENDREGION} {$REGION 'Helper types'} type StringArray = array of string; {$ENDREGION} {$REGION 'Documentation analyzer'} type DocAnalyzer = class {$REGION 'Private static methods'} strict private class procedure GetMembersInLocation(overview: DocOverview; onlyIn: Location; includeParams: Boolean; list: ArrayList); static; class procedure GetParametersInLocation(memberInfo: MemberInfo; onlyIn: Location; list: ArrayList); static; {$ENDREGION} {$REGION 'Static methods'} public class function GetAssemblyOnlyElements(overview: DocOverview): ArrayList; static; class function GetDocumentOnlyElements(overview: DocOverview): ArrayList; static; class function GetChangedUnits(overview: DocOverview): StringArray; static; {$ENDREGION} end; {$ENDREGION} implementation {$REGION 'DocAnalyzer'} class function DocAnalyzer.GetAssemblyOnlyElements(overview: DocOverview): ArrayList; begin Result := ArrayList.Create; GetMembersInLocation(overview, Location.InAssembly, True, Result); end; class function DocAnalyzer.GetDocumentOnlyElements(overview: DocOverview): ArrayList; begin Result := ArrayList.Create; GetMembersInLocation(overview, Location.InXML, True, Result); end; class procedure DocAnalyzer.GetMembersInLocation(overview: DocOverview; onlyIn: Location; includeParams: Boolean; list: ArrayList); var obj: &Object; mi: MemberInfo; begin for obj in overview do begin mi := MemberInfo(obj); if mi.Location = onlyIn then list.Add(mi) else if includeParams and not mi.HasExclude then GetParametersInLocation(mi, onlyIn, list); end; end; class procedure DocAnalyzer.GetParametersInLocation(memberInfo: MemberInfo; onlyIn: Location; list: ArrayList); var obj: &Object; pi: ParamInfo; begin for obj in memberInfo do begin pi := ParamInfo(obj); if (pi.Location = onlyIn) then list.Add(pi); end; end; class function DocAnalyzer.GetChangedUnits(overview: DocOverview): StringArray; var al: ArrayList; obj: &Object; mi: MemberInfo; idx: Integer; obj2: &Object; pi: ParamInfo; begin al := ArrayList.Create; for obj in overview do begin mi := MemberInfo(obj); if (mi.Location <> Location.InBoth) or (mi.UnitName <> Path.GetFileNameWithoutExtension(mi.XmlFile)) then begin idx := al.BinarySearch(mi.UnitName, CaseInsensitiveComparer.DefaultInvariant); if idx < 0 then al.Insert(not idx, mi.UnitName); end else if not mi.HasExclude then for obj2 in mi do begin pi := ParamInfo(obj2); if pi.Location <> Location.InBoth then begin idx := al.BinarySearch(mi.UnitName, CaseInsensitiveComparer.DefaultInvariant); if idx < 0 then al.Insert(not idx, mi.UnitName); end; end; end; Result := StringArray(al.ToArray(TypeOf(System.String))); end; {$ENDREGION} end. --- NEW FILE: JediDoc.System.Xml.Reflection.pas --- {--------------------------------------------------------------------------------------------------- The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/MPL-1.1.html Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either expressed or implied. See the License for the specific language governing rights and limitations under the License. The Original Code is: JediDoc.System.Xml.Reflection.pas, released on 2005-03-28. The Initial Developer of the Original Code is Marcel Bestebroer Portions created by Marcel Bestebroer are Copyright (C) 2004 Marcel Bestebroer All Rights Reserved. Contributor(s): You may retrieve the latest version of this file at the JEDI.NET home page, located at http://sf.net/projects/jedidotnet Known Issues: ---------------------------------------------------------------------------------------------------} // $Id: JediDoc.System.Xml.Reflection.pas,v 1.1 2005/03/28 12:26:16 jedi_mbe Exp $ unit JediDoc.System.Xml.Reflection; interface {$REGION 'uses'} uses System.Collections, System.IO, System.Xml, JediDoc.System.InfoClasses; {$ENDREGION} {$REGION 'Xml-based reflection'} type XmlReflector = class {$REGION 'Private static methods'} strict private class function GetParameterNames(doc: XmlDocument): StringArray; static; class function GetParameters(doc: XmlDocument): XmlNodeList; static; class procedure ProcessXmlMember(reader: XmlReader; filePath: string; docs: DocOverview; fileList: HashTable); static; {$ENDREGION} {$REGION 'Static methods'} public class procedure ProcessXml(path: string; docs: DocOverview); static; {$ENDREGION} end; {$ENDREGION} {$REGION 'Utilities (include processing)'} XmlUtils = class {$REGION 'Private static methods'} strict private class function GetIncludedNodes(filename, xpath: string; fileList: HashTable): XmlNodeList; static; {$ENDREGION} {$REGION 'Static methods'} public class procedure ExpandIncludeNodes(doc: XmlDocument; fileList: HashTable); static; {$ENDREGION} end; {$ENDREGION} implementation {$AUTOBOX ON} {$REGION 'XmlReflector'} class function XmlReflector.GetParameterNames(doc: XmlDocument): StringArray; var paramList: XmlNodeList; nameList: ArrayList; node: XmlNode; begin paramList := GetParameters(doc); nameList := ArrayList.Create(paramList.Count); for node in paramList do nameList.Add(node.Attributes['name'].Value); Result := StringArray(nameList.ToArray(TypeOf(System.String))); end; class function XmlReflector.GetParameters(doc: XmlDocument): XmlNodeList; begin Result := doc.GetElementsByTagName('param'); end; class procedure XmlReflector.ProcessXml(path: string; docs: DocOverview); var fileList: HashTable; savedDirectory: string; xr: XmlReader; begin savedDirectory := System.Environment.CurrentDirectory; xr := XmlTextReader.Create(StreamReader.Create(path)); try System.Environment.CurrentDirectory := System.IO.Path.GetDirectoryName(System.IO.Path.GetFullPath(path)); fileList := Hashtable.Create(CaseInsensitiveHashCodeProvider.DefaultInvariant, CaseInsensitiveComparer.DefaultInvariant); if System.IO.Path.GetFileNameWithoutExtension(path).ToLower.StartsWith('namespacedoc.') then begin docs.AddXmlMember('N:' + System.IO.path.GetFileNameWithoutExtension(path).Substring('namespacedoc.'.Length), path, [], False); end else begin if xr.MoveToContent = XmlNodeType.Element then begin xr.ReadStartElement('members'); while xr.IsStartElement do begin if xr.IsStartElement('member') then ProcessXmlMember(xr, path, docs, fileList) else xr.Skip; end; xr.ReadEndElement; end; end; finally xr.Close; // release the file System.Environment.CurrentDirectory := savedDirectory; end; end; class procedure XmlReflector.ProcessXmlMember(reader: XmlReader; filePath: string; docs: DocOverview; fileList: HashTable); var line: Integer; pos: Integer; memberId: string; tmpXml: string; doc: XmlDocument; params: array of string; begin if reader is XmlTextReader then begin line := XmlTextRea... [truncated message content] |
From: Marcel B. <jed...@us...> - 2005-03-28 12:26:25
|
Update of /cvsroot/jedidotnet/tools/JediDoc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28000/tools/JediDoc Added Files: JediDoc.Analysis.bdsproj JediDoc.Analysis.dpk JediDoc.Console.bdsproj JediDoc.Console.dpr JediDoc.Core.bdsproj JediDoc.Core.dpk JediDoc.Tool.bdsproj JediDoc.Tool.dpk JediDoc.Xml.bdsproj JediDoc.Xml.dpk Log Message: JediDoc tool initial check-in --- NEW FILE: JediDoc.Analysis.dpk --- package JediDoc.Analysis; {$ALIGN 0} {$ASSERTIONS ON} {$BOOLEVAL OFF} {$DEBUGINFO ON} {$EXTENDEDSYNTAX ON} {$IMPORTEDDATA ON} {$IOCHECKS ON} {$LOCALSYMBOLS ON} {$LONGSTRINGS ON} {$OPENSTRINGS ON} {$OPTIMIZATION ON} {$OVERFLOWCHECKS OFF} {$RANGECHECKS OFF} {$REFERENCEINFO ON} {$SAFEDIVIDE OFF} {$STACKFRAMES OFF} {$TYPEDADDRESS OFF} {$VARSTRINGCHECKS ON} {$WRITEABLECONST OFF} {$MINENUMSIZE 1} {$IMAGEBASE $400000} {$IMPLICITBUILD OFF} requires Borland.Delphi, JediDoc.Core, Jedi.System; contains JediDoc.System.Analysis in 'source\JediDoc.System.Analysis.pas'; [assembly: AssemblyTitle('JediDoc.Analysis')] [assembly: AssemblyDescription('Jedi documentation tool analyzing classes')] [assembly: AssemblyCompany('Project JEDI')] [assembly: AssemblyProduct('JediDoc documentation tool')] [assembly: AssemblyCopyright('Copyright © 2004, 2005 Project JEDI')] [assembly: AssemblyTrademark('')] [assembly: AssemblyCulture('')] [assembly: AssemblyVersion('1.0.1.0')] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile('')] [assembly: AssemblyKeyName('')] [assembly: ComVisible(False)] end. --- NEW FILE: JediDoc.Core.dpk --- package JediDoc.Core; {$ALIGN 0} {$ASSERTIONS ON} {$BOOLEVAL OFF} {$DEBUGINFO ON} {$EXTENDEDSYNTAX ON} {$IMPORTEDDATA ON} {$IOCHECKS ON} {$LOCALSYMBOLS ON} {$LONGSTRINGS ON} {$OPENSTRINGS ON} {$OPTIMIZATION ON} {$OVERFLOWCHECKS OFF} {$RANGECHECKS OFF} {$REFERENCEINFO ON} {$SAFEDIVIDE OFF} {$STACKFRAMES OFF} {$TYPEDADDRESS OFF} {$VARSTRINGCHECKS ON} {$WRITEABLECONST OFF} {$MINENUMSIZE 1} {$IMAGEBASE $400000} {$IMPLICITBUILD OFF} requires Borland.Delphi, Jedi.System; contains JediDoc.System.InfoClasses in 'source\JediDoc.System.InfoClasses.pas'; [assembly: AssemblyTitle('JediDoc.Core')] [assembly: AssemblyDescription('Jedi documentation tool core assembly')] [assembly: AssemblyCompany('Project JEDI')] [assembly: AssemblyProduct('JediDoc documentation tool')] [assembly: AssemblyCopyright('Copyright © 2004, 2005 Project JEDI')] [assembly: AssemblyTrademark('')] [assembly: AssemblyCulture('')] [assembly: AssemblyVersion('1.0.1.0')] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile('')] [assembly: AssemblyKeyName('')] [assembly: ComVisible(False)] end. --- NEW FILE: JediDoc.Console.bdsproj --- (This appears to be a binary file; contents omitted.) --- NEW FILE: JediDoc.Core.bdsproj --- (This appears to be a binary file; contents omitted.) --- NEW FILE: JediDoc.Tool.bdsproj --- (This appears to be a binary file; contents omitted.) --- NEW FILE: JediDoc.Xml.dpk --- package JediDoc.Xml; {$ALIGN 0} {$ASSERTIONS ON} {$BOOLEVAL OFF} {$DEBUGINFO ON} {$EXTENDEDSYNTAX ON} {$IMPORTEDDATA ON} {$IOCHECKS ON} {$LOCALSYMBOLS ON} {$LONGSTRINGS ON} {$OPENSTRINGS ON} {$OPTIMIZATION ON} {$OVERFLOWCHECKS OFF} {$RANGECHECKS OFF} {$REFERENCEINFO ON} {$SAFEDIVIDE OFF} {$STACKFRAMES OFF} {$TYPEDADDRESS OFF} {$VARSTRINGCHECKS ON} {$WRITEABLECONST OFF} {$MINENUMSIZE 1} {$IMAGEBASE $400000} {$IMPLICITBUILD OFF} requires Borland.Delphi, JediDoc.Core, System.XML, Jedi.IO; contains JediDoc.System.Xml.Reflection in 'source\JediDoc.System.Xml.Reflection.pas', JediDoc.System.Xml.UnitDocGeneration in 'source\JediDoc.System.Xml.UnitDocGeneration.pas', JediDoc.System.Xml.AssemblyDocGeneration in 'source\JediDoc.System.Xml.AssemblyDocGeneration.pas'; [assembly: AssemblyTitle('JediDoc.Xml')] [assembly: AssemblyDescription('Jedi documentation tool XML handling')] [assembly: AssemblyCompany('Project JEDI')] [assembly: AssemblyProduct('JediDoc documentation tool')] [assembly: AssemblyCopyright('Copyright © 2004, 2005 Project JEDI')] [assembly: AssemblyTrademark('')] [assembly: AssemblyCulture('')] [assembly: AssemblyVersion('1.0.1.0')] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile('')] [assembly: AssemblyKeyName('')] [assembly: ComVisible(False)] end. --- NEW FILE: JediDoc.Analysis.bdsproj --- (This appears to be a binary file; contents omitted.) --- NEW FILE: JediDoc.Xml.bdsproj --- (This appears to be a binary file; contents omitted.) --- NEW FILE: JediDoc.Console.dpr --- program JediDoc.Console; {$APPTYPE CONSOLE} {%DelphiDotNetAssemblyCompiler '..\bin\JediDoc.Analysis.dll'} {%DelphiDotNetAssemblyCompiler '..\bin\JediDoc.Core.dll'} {%DelphiDotNetAssemblyCompiler '..\bin\JediDoc.Tool.dll'} {%DelphiDotNetAssemblyCompiler '..\bin\JediDoc.Xml.dll'} {$AUTOBOX ON} uses {$REGION 'uses'} JediDoc.System.Analysis, JediDoc.System.Console, JediDoc.System.InfoClasses, JediDoc.System.Project, JediDoc.System.Xml.AssemblyDocGeneration, JediDoc.System.Xml.Reflection, JediDoc.System.Xml.UnitDocGeneration, System.Collections, System.IO, System.Reflection, System.Runtime.InteropServices; {$ENDREGION} {$REGION 'Assembly attributes'} [assembly: AssemblyTitle('JediDoc.Console')] [assembly: AssemblyDescription('Jedi documentation command line tool')] [assembly: AssemblyCompany('Project JEDI')] [assembly: AssemblyProduct('JediDoc documentation tool')] [assembly: AssemblyCopyright('Copyright © 2004, 2005 Project JEDI')] [assembly: AssemblyTrademark('')] [assembly: AssemblyCulture('')] [assembly: AssemblyVersion('1.0.1.0')] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile('')] [assembly: AssemblyKeyName('')] [assembly: ComVisible(False)] {$ENDREGION} {$REGION 'Data'} var docs: DocOverview; assyPath: string; xmlPath: string; {$ENDREGION} procedure Analyse; begin Console.WriteLine('Analysis:'); Console.WriteLine(' Items not in xml: {0}', DocAnalyzer.GetAssemblyOnlyElements(docs).Count); Console.WriteLine(' Items only in xml: {0}', DocAnalyzer.GetDocumentOnlyElements(docs).Count); Console.WriteLine; end; procedure AssemblyGeneration; begin if not Settings.Quiet then Console.WriteLine('Generating assembly-based XML files...'); AssemblyDocs.Generate(docs, assyPath); end; procedure DisplaySettings; begin Console.WriteLine('Settings:'); Console.Write(' Analyse? '); if Settings.ExecutionType and Settings.ExecutionTypes.Analyse = Settings.ExecutionTypes.Analyse then Console.WriteLine('yes') else Console.WriteLine('no'); Console.Write(' Unit-based docs? '); if Settings.ExecutionType and Settings.ExecutionTypes.UnitGeneration = Settings.ExecutionTypes.UnitGeneration then Console.WriteLine('yes') else Console.WriteLine('no'); Console.Write(' Assembly-based docs? '); if Settings.ExecutionType and Settings.ExecutionTypes.AssemblyGeneration = Settings.ExecutionTypes.AssemblyGeneration then Console.WriteLine('yes') else Console.WriteLine('no'); Console.WriteLine; end; procedure ParseProject; var enum: IEnumerator; hasFile: Boolean; begin docs := DocOverview.Create; if not Settings.Quiet then Console.WriteLine('Processing assemblies...'); enum := Settings.ProjectContents.Assemblies.GetFileEnumerator; hasFile := False; while enum.MoveNext do begin hasFile := True; if not Settings.Quiet then Console.WriteLine(' ' + Path.GetFileNameWithoutExtension(string(enum.Current))); docs.ProcessAssembly(string(enum.Current)); end; if not hasFile then begin Console.WriteLine('ERROR: No assemblies assigned/found.'); Halt(50); end; assyPath := Path.GetDirectoryName(Settings.ProjectContents.Assemblies[0]); if not Settings.Quiet then Console.WriteLine('Processing xml files...'); enum := Settings.ProjectContents.XmlFiles.GetFileEnumerator; hasFile := False; while enum.MoveNext do begin hasFile := True; if not Settings.Quiet then Console.WriteLine(' ' + Path.GetFileNameWithoutExtension(string(enum.Current))); XmlReflector.ProcessXml(string(enum.Current), docs); end; if not hasFile then begin Console.WriteLine('ERROR: No xml files assigned/found.'); Halt(50); end; xmlPath := Path.GetDirectoryName(Settings.ProjectContents.XmlFiles[0]); if not Settings.Quiet then Console.WriteLine; end; procedure SaveProject; begin Console.WriteLine('Project files are not yet supported.'); Halt(80); end; procedure UnitGeneration; begin if not Settings.Quiet then Console.WriteLine('Generating unit-based XML files...'); UnitDocs.Generate(docs, xmlPath, DocAnalyzer.GetChangedUnits(docs)); end; begin Console.WriteLine('JediDoc Documentation tool 1.0'); Console.WriteLine('Copyright (c) 2004, 2005 Project JEDI.'); Console.WriteLine; Settings.ParseCommandLine; if not Settings.HelpShown then begin if not Settings.ArgumentDetected then Settings.ShowHelp else begin if not Settings.Quiet then DisplaySettings; if Settings.ExecutionType = Settings.ExecutionTypes.SaveProject then SaveProject else begin ParseProject; if Settings.ExecutionType and Settings.ExecutionTypes.Analyse = Settings.ExecutionTypes.Analyse then Analyse; if Settings.ExecutionType and Settings.ExecutionTypes.UnitGeneration = Settings.ExecutionTypes.UnitGeneration then UnitGeneration; if Settings.ExecutionType and Settings.ExecutionTypes.AssemblyGeneration = Settings.ExecutionTypes.AssemblyGeneration then AssemblyGeneration; end; end; end; end. --- NEW FILE: JediDoc.Tool.dpk --- package JediDoc.Tool; {$ALIGN 0} {$ASSERTIONS ON} {$BOOLEVAL OFF} {$DEBUGINFO ON} {$EXTENDEDSYNTAX ON} {$IMPORTEDDATA ON} {$IOCHECKS ON} {$LOCALSYMBOLS ON} {$LONGSTRINGS ON} {$OPENSTRINGS ON} {$OPTIMIZATION ON} {$OVERFLOWCHECKS OFF} {$RANGECHECKS OFF} {$REFERENCEINFO ON} {$SAFEDIVIDE OFF} {$STACKFRAMES OFF} {$TYPEDADDRESS OFF} {$VARSTRINGCHECKS ON} {$WRITEABLECONST OFF} {$MINENUMSIZE 1} {$IMAGEBASE $400000} {$IMPLICITBUILD OFF} requires Borland.Delphi, Jedi.System; contains JediDoc.System.Project in 'source\JediDoc.System.Project.pas', JediDoc.System.Console in 'source\JediDoc.System.Console.pas'; [assembly: AssemblyTitle('JediDoc.Tool')] [assembly: AssemblyDescription('Jedi documentation tool high level common classes')] [assembly: AssemblyCompany('Project JEDI')] [assembly: AssemblyProduct('JediDoc documentation tool')] [assembly: AssemblyCopyright('Copyright © 2004, 2005 Project JEDI')] [assembly: AssemblyTrademark('')] [assembly: AssemblyCulture('')] [assembly: AssemblyVersion('1.0.1.0')] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile('')] [assembly: AssemblyKeyName('')] [assembly: ComVisible(False)] end. |
From: Marcel B. <jed...@us...> - 2005-03-28 12:26:24
|
Update of /cvsroot/jedidotnet/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28000/tools Added Files: HelpTools.bdsgroup Log Message: JediDoc tool initial check-in --- NEW FILE: HelpTools.bdsgroup --- (This appears to be a binary file; contents omitted.) |
From: Marcel B. <jed...@us...> - 2005-03-28 11:56:26
|
Update of /cvsroot/jedidotnet/tools/JediDoc/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12169/source Log Message: Directory /cvsroot/jedidotnet/tools/JediDoc/source added to the repository |
From: Marcel B. <jed...@us...> - 2005-03-28 11:56:13
|
Update of /cvsroot/jedidotnet/tools/JediDoc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12127/JediDoc Log Message: Directory /cvsroot/jedidotnet/tools/JediDoc added to the repository |
From: Marcel B. <jed...@us...> - 2005-03-15 09:55:39
|
Update of /cvsroot/jedidotnet/main/examples/Jedi.IO/StreamOfValueType In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11065/main/examples/Jedi.IO/StreamOfValueType Added Files: example.StreamOfValueType.res Log Message: Added missing .res --- NEW FILE: example.StreamOfValueType.res --- (This appears to be a binary file; contents omitted.) |
From: Marcel B. <jed...@us...> - 2005-03-14 17:07:42
|
Update of /cvsroot/jedidotnet/main/run In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9119/main/run Modified Files: Jedi.Windows.Forms.Graphics.ShapeControl.pas Log Message: Published the properties Index: Jedi.Windows.Forms.Graphics.ShapeControl.pas =================================================================== RCS file: /cvsroot/jedidotnet/main/run/Jedi.Windows.Forms.Graphics.ShapeControl.pas,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Jedi.Windows.Forms.Graphics.ShapeControl.pas 7 Mar 2005 18:04:00 -0000 1.1 --- Jedi.Windows.Forms.Graphics.ShapeControl.pas 14 Mar 2005 17:07:30 -0000 1.2 *************** *** 83,87 **** {$ENDREGION} {$REGION 'Properties'} ! public [Category('Appearance'), Description(SShapeBrush)] property Brush: System.Drawing.Brush read FBrush write set_Brush; --- 83,87 ---- {$ENDREGION} {$REGION 'Properties'} ! published [Category('Appearance'), Description(SShapeBrush)] property Brush: System.Drawing.Brush read FBrush write set_Brush; |
From: Marcel B. <jed...@us...> - 2005-03-14 17:04:20
|
Update of /cvsroot/jedidotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7846 Modified Files: JediDotNet.bdsgroup Log Message: Added Shape example Index: JediDotNet.bdsgroup =================================================================== RCS file: /cvsroot/jedidotnet/JediDotNet.bdsgroup,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JediDotNet.bdsgroup 14 Mar 2005 14:26:21 -0000 1.1 --- JediDotNet.bdsgroup 14 Mar 2005 17:04:09 -0000 1.2 *************** *** 9,14 **** </Option> </PersonalityInfo> ! <Default.Personality> ! <Projects> <Projects Name="Jedi.System.dll">main\assemblies\Jedi.System.bdsproj</Projects> <Projects Name="Jedi.Drawing.dll">main\assemblies\Jedi.Drawing.bdsproj</Projects> --- 9,13 ---- </Option> </PersonalityInfo> ! <Default.Personality> <Projects> <Projects Name="Jedi.System.dll">main\assemblies\Jedi.System.bdsproj</Projects> <Projects Name="Jedi.Drawing.dll">main\assemblies\Jedi.Drawing.bdsproj</Projects> *************** *** 18,22 **** <Projects Name="Nunit.Jedi.IO.dll">nunit\Nunit.Jedi.IO.bdsproj</Projects> <Projects Name="example.StreamOfValueType.exe">main\examples\Jedi.IO\StreamOfValueType\example.StreamOfValueType.bdsproj</Projects> ! <Projects Name="Targets">Jedi.System.dll Jedi.Drawing.dll Jedi.IO.dll Jedi.Windows.Forms.Graphics.dll Nunit.Jedi.System.dll Nunit.Jedi.IO.dll example.StreamOfValueType.exe</Projects> </Projects> <Dependencies/> --- 17,22 ---- <Projects Name="Nunit.Jedi.IO.dll">nunit\Nunit.Jedi.IO.bdsproj</Projects> <Projects Name="example.StreamOfValueType.exe">main\examples\Jedi.IO\StreamOfValueType\example.StreamOfValueType.bdsproj</Projects> ! <Projects Name="example.Jedi.Windows.Forms.Shape.exe">main\examples\Jedi.Windows.Forms.Graphics\Shape\example.Jedi.Windows.Forms.Shape.bdsproj</Projects> ! <Projects Name="Targets">Jedi.System.dll Jedi.Drawing.dll Jedi.IO.dll Jedi.Windows.Forms.Graphics.dll Nunit.Jedi.System.dll Nunit.Jedi.IO.dll example.StreamOfValueType.exe example.Jedi.Windows.Forms.Shape.exe</Projects> </Projects> <Dependencies/> |
Update of /cvsroot/jedidotnet/main/examples/Jedi.Windows.Forms.Visual/Shape In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12531/main/examples/Jedi.Windows.Forms.Visual/Shape Removed Files: TestProject.bdsproj TestProject.dpr TestProject.res WinForm.TWinForm.resources WinForm.pas WinForm.resx Log Message: Moved example of shape control to new directory; adapted in some places. --- WinForm.resx DELETED --- --- WinForm.TWinForm.resources DELETED --- --- TestProject.bdsproj DELETED --- --- TestProject.dpr DELETED --- --- TestProject.res DELETED --- --- WinForm.pas DELETED --- |
From: Marcel B. <jed...@us...> - 2005-03-14 15:22:11
|
Update of /cvsroot/jedidotnet/main/examples/Jedi.Windows.Forms.Graphics/Shape In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12531/main/examples/Jedi.Windows.Forms.Graphics/Shape Added Files: example.Jedi.Windows.Forms.Shape.MainForm.pas example.Jedi.Windows.Forms.Shape.MainForm.resx example.Jedi.Windows.Forms.Shape.bdsproj example.Jedi.Windows.Forms.Shape.dpr example.Jedi.Windows.Forms.Shape.res Log Message: Moved example of shape control to new directory; adapted in some places. --- NEW FILE: example.Jedi.Windows.Forms.Shape.res --- (This appears to be a binary file; contents omitted.) --- NEW FILE: example.Jedi.Windows.Forms.Shape.MainForm.resx --- (This appears to be a binary file; contents omitted.) --- NEW FILE: example.Jedi.Windows.Forms.Shape.MainForm.pas --- unit example.Jedi.Windows.Forms.Shape.MainForm; interface uses System.Drawing, System.Collections, System.ComponentModel, System.Windows.Forms, System.Data, Jedi.Windows.Forms.Graphics.ShapeControl; type MainForm = class(System.Windows.Forms.Form) {$REGION 'Designer Managed Code'} strict private /// <summary> /// Required designer variable. /// </summary> Components: System.ComponentModel.Container; cbShape: System.Windows.Forms.ComboBox; shape: Jedi.Windows.Forms.Graphics.ShapeControl.Shape; btnClose: System.Windows.Forms.Button; /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> procedure InitializeComponent; procedure btnClose_Click(sender: System.Object; e: System.EventArgs); procedure cbShape_SelectedIndexChanged(sender: System.Object; e: System.EventArgs); {$ENDREGION} strict protected /// <summary> /// Clean up any resources being used. /// </summary> procedure Dispose(Disposing: Boolean); override; private { Private Declarations } public constructor Create; end; [assembly: RuntimeRequiredAttribute(TypeOf(MainForm))] implementation {$AUTOBOX ON} {$REGION 'Windows Form Designer generated code'} /// <summary> /// Required method for Designer support -- do not modify /// the contents of this method with the code editor. /// </summary> procedure MainForm.InitializeComponent; type TArrayOfSystem_Object = array of System.Object; begin Self.cbShape := System.Windows.Forms.ComboBox.Create; Self.shape := Jedi.Windows.Forms.Graphics.ShapeControl.Shape.Create; Self.btnClose := System.Windows.Forms.Button.Create; Self.SuspendLayout; // // cbShape // Self.cbShape.Anchor := (System.Windows.Forms.AnchorStyles(((System.Windows.Forms.AnchorStyles.Top or System.Windows.Forms.AnchorStyles.Left) or System.Windows.Forms.AnchorStyles.Right))); Self.cbShape.DropDownStyle := System.Windows.Forms.ComboBoxStyle.DropDownList; Self.cbShape.Items.AddRange(TArrayOfSystem_Object.Create('Circle', 'Ellips' + 'e', 'Rectangle', 'Rounded rectangle', 'Rounded square', 'Square')); Self.cbShape.Location := System.Drawing.Point.Create(8, 8); Self.cbShape.Name := 'cbShape'; Self.cbShape.Size := System.Drawing.Size.Create(202, 21); Self.cbShape.TabIndex := 0; Include(Self.cbShape.SelectedIndexChanged, Self.cbShape_SelectedIndexChanged); // // shape // Self.shape.Anchor := (System.Windows.Forms.AnchorStyles((((System.Windows.Forms.AnchorStyles.Top or System.Windows.Forms.AnchorStyles.Bottom) or System.Windows.Forms.AnchorStyles.Left) or System.Windows.Forms.AnchorStyles.Right))); Self.shape.Location := System.Drawing.Point.Create(10, 40); Self.shape.Name := 'shape'; Self.shape.Shape := Jedi.Windows.Forms.Graphics.ShapeControl.Shape.ShapeType.stRectangle; Self.shape.Size := System.Drawing.Size.Create(200, 100); Self.shape.TabIndex := 1; Self.shape.Text := 'Shape1'; // // btnClose // Self.btnClose.Anchor := (System.Windows.Forms.AnchorStyles((System.Windows.Forms.AnchorStyles.Bottom or System.Windows.Forms.AnchorStyles.Right))); Self.btnClose.Location := System.Drawing.Point.Create(135, 150); Self.btnClose.Name := 'btnClose'; Self.btnClose.Size := System.Drawing.Size.Create(75, 25); Self.btnClose.TabIndex := 2; Self.btnClose.Text := 'Close'; Include(Self.btnClose.Click, Self.btnClose_Click); // // MainForm // Self.AutoScaleBaseSize := System.Drawing.Size.Create(5, 13); Self.ClientSize := System.Drawing.Size.Create(217, 178); Self.Controls.Add(Self.btnClose); Self.Controls.Add(Self.shape); Self.Controls.Add(Self.cbShape); Self.Name := 'MainForm'; Self.Text := 'WinForm'; Self.ResumeLayout(False); end; {$ENDREGION} procedure MainForm.Dispose(Disposing: Boolean); begin if Disposing then begin if Components <> nil then Components.Dispose(); end; inherited Dispose(Disposing); end; constructor MainForm.Create; begin inherited Create; InitializeComponent; shape.Pen := Pen.Create(Color.Red); shape.Brush := Brushes.Yellow; cbShape.SelectedIndex := 0; end; procedure MainForm.cbShape_SelectedIndexChanged(sender: System.Object; e: System.EventArgs); begin case cbShape.SelectedIndex of 0: shape.Shape := stCircle; 1: shape.Shape := stEllipse; 2: shape.Shape := stRectangle; 3: shape.Shape := stRoundRect; 4: shape.Shape := stRoundSquare; 5: shape.Shape := stSquare; end; end; procedure MainForm.btnClose_Click(sender: System.Object; e: System.EventArgs); begin Close; end; end. --- NEW FILE: example.Jedi.Windows.Forms.Shape.dpr --- program example.Jedi.Windows.Forms.Shape; {%DelphiDotNetAssemblyCompiler '$(SystemRoot)\microsoft.net\framework\v1.1.4322\System.dll'} {%DelphiDotNetAssemblyCompiler '$(SystemRoot)\microsoft.net\framework\v1.1.4322\System.Data.dll'} {%DelphiDotNetAssemblyCompiler '$(SystemRoot)\microsoft.net\framework\v1.1.4322\System.Drawing.dll'} {%DelphiDotNetAssemblyCompiler '$(SystemRoot)\microsoft.net\framework\v1.1.4322\System.Windows.Forms.dll'} {%DelphiDotNetAssemblyCompiler '$(SystemRoot)\microsoft.net\framework\v1.1.4322\System.XML.dll'} {$R 'example.Jedi.Windows.Forms.Shape.MainForm.resources' 'example.Jedi.Windows.Forms.Shape.MainForm.resx'} {%DelphiDotNetAssemblyCompiler '..\..\..\bin\Jedi.Windows.Forms.Graphics.dll'} {%DelphiDotNetAssemblyCompiler 'Borland.Delphi.dll'} {%DelphiDotNetAssemblyCompiler '..\..\..\bin\Jedi.System.dll'} uses System.Reflection, System.Runtime.CompilerServices, System.Windows.Forms, example.Jedi.Windows.Forms.Shape.MainForm in 'example.Jedi.Windows.Forms.Shape.MainForm.pas' {example.Jedi.Windows.Forms.Shape.MainForm.MainForm: System.Windows.Forms.Form}; {$R *.res} {$REGION 'Program/Assembly Information'} [assembly: AssemblyTitle('example.Jedi.Windows.Forms.Shape')] [assembly: AssemblyDescription('Example of the Jedi.Windows.Forms.Graphics.Shape control.')] [assembly: AssemblyConfiguration('')] [assembly: AssemblyCompany('Project JEDI')] [assembly: AssemblyProduct('JEDI.NET library')] [assembly: AssemblyCopyright('Copyright © 2004 - 2005 Project JEDI')] [assembly: AssemblyTrademark('')] [assembly: AssemblyCulture('')] [assembly: AssemblyVersion('1.0.0.0')] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile('')] [assembly: AssemblyKeyName('')] {$ENDREGION} [STAThread] begin Application.Run(MainForm.Create); end. --- NEW FILE: example.Jedi.Windows.Forms.Shape.bdsproj --- (This appears to be a binary file; contents omitted.) |
From: Marcel B. <jed...@us...> - 2005-03-14 15:20:08
|
Update of /cvsroot/jedidotnet/main/examples/Jedi.Windows.Forms.Graphics/Shape In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11987/Shape Log Message: Directory /cvsroot/jedidotnet/main/examples/Jedi.Windows.Forms.Graphics/Shape added to the repository |
From: Marcel B. <jed...@us...> - 2005-03-14 15:19:57
|
Update of /cvsroot/jedidotnet/main/examples/Jedi.Windows.Forms.Graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11937/Jedi.Windows.Forms.Graphics Log Message: Directory /cvsroot/jedidotnet/main/examples/Jedi.Windows.Forms.Graphics added to the repository |
From: Marcel B. <jed...@us...> - 2005-03-14 14:26:31
|
Update of /cvsroot/jedidotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30116 Added Files: JediDotNet.bdsgroup Log Message: Added project group --- NEW FILE: JediDotNet.bdsgroup --- (This appears to be a binary file; contents omitted.) |
From: Marcel B. <jed...@us...> - 2005-03-14 14:19:09
|
Update of /cvsroot/jedidotnet/main/examples/Jedi.System.IO/FileOfRecord In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27910/main/examples/Jedi.System.IO/FileOfRecord Removed Files: ExampleFileOfRecord.bdsproj ExampleFileOfRecord.dpr ExampleFileOfRecord.res WinFormMain.TWinFormMain.resources WinFormMain.pas WinFormMain.resx Log Message: * Moved example for FileOfRecord to new folder and renamed the example. --- ExampleFileOfRecord.bdsproj DELETED --- --- ExampleFileOfRecord.dpr DELETED --- --- WinFormMain.TWinFormMain.resources DELETED --- --- WinFormMain.pas DELETED --- --- ExampleFileOfRecord.res DELETED --- --- WinFormMain.resx DELETED --- |
From: Marcel B. <jed...@us...> - 2005-03-14 14:19:08
|
Update of /cvsroot/jedidotnet/main/examples/Jedi.IO/StreamOfValueType In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27910/main/examples/Jedi.IO/StreamOfValueType Added Files: WinFormMain.pas WinFormMain.resx example.StreamOfValueType.bdsproj example.StreamOfValueType.dpr Log Message: * Moved example for FileOfRecord to new folder and renamed the example. --- NEW FILE: WinFormMain.pas --- {****************************************************************** JEDI.NET Demo Copyright (C) 2004 Project JEDI Original author: Andreas Hausladen You may retrieve the latest version of this file at the JEDI.NET home page, located at http://jedidotnet.sourceforge.net The contents of this file are used with permission, subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/MPL-1_1Final.html Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. ******************************************************************} unit WinFormMain; interface uses System.Drawing, System.Collections, System.ComponentModel, System.Windows.Forms, System.Data, System.IO, Jedi.IO.FileOfRec; type TWinFormMain = class(System.Windows.Forms.Form) {$REGION 'Designer Managed Code'} strict private Components: System.ComponentModel.Container; Label1: System.Windows.Forms.Label; TextBoxName: System.Windows.Forms.TextBox; Label2: System.Windows.Forms.Label; NumericUpDownAge: System.Windows.Forms.NumericUpDown; Panel1: System.Windows.Forms.Panel; Label3: System.Windows.Forms.Label; NumericUpDownIncome: System.Windows.Forms.NumericUpDown; LabelRecords: System.Windows.Forms.Label; ListViewRecords: System.Windows.Forms.ListView; ButtonQuit: System.Windows.Forms.Button; ButtonAddRecord: System.Windows.Forms.Button; ButtonOverwrite: System.Windows.Forms.Button; procedure InitializeComponent; procedure ButtonQuit_Click(sender: System.Object; e: System.EventArgs); procedure ButtonAddRecord_Click(sender: System.Object; e: System.EventArgs); procedure TWinFormMain_Load(sender: System.Object; e: System.EventArgs); procedure ButtonOverwrite_Click(sender: System.Object; e: System.EventArgs); procedure ListViewRecords_SelectedIndexChanged(sender: System.Object; e: System.EventArgs); {$ENDREGION} strict protected procedure Dispose(Disposing: Boolean); override; private FFileName: string; procedure PopulateListViewRecords; public ColumnHeader1: System.Windows.Forms.ColumnHeader; constructor Create; end; [assembly: RuntimeRequiredAttribute(TypeOf(TWinFormMain))] TPersonRec = record Name: string[30]; Age: Byte; Income: Double; end; implementation {$AUTOBOX ON} {$REGION 'Windows Form Designer generated code'} procedure TWinFormMain.InitializeComponent; type TArrayOfInteger = array of Integer; TArrayOfSystem_Windows_Forms_ColumnHeader = array of System.Windows.Forms.ColumnHeader; begin Self.Panel1 := System.Windows.Forms.Panel.Create; Self.Label3 := System.Windows.Forms.Label.Create; Self.NumericUpDownIncome := System.Windows.Forms.NumericUpDown.Create; Self.NumericUpDownAge := System.Windows.Forms.NumericUpDown.Create; Self.Label2 := System.Windows.Forms.Label.Create; Self.TextBoxName := System.Windows.Forms.TextBox.Create; Self.Label1 := System.Windows.Forms.Label.Create; Self.LabelRecords := System.Windows.Forms.Label.Create; Self.ListViewRecords := System.Windows.Forms.ListView.Create; Self.ColumnHeader1 := System.Windows.Forms.ColumnHeader.Create; Self.ButtonQuit := System.Windows.Forms.Button.Create; Self.ButtonAddRecord := System.Windows.Forms.Button.Create; Self.ButtonOverwrite := System.Windows.Forms.Button.Create; Self.Panel1.SuspendLayout; (System.ComponentModel.ISupportInitialize(Self.NumericUpDownIncome)).BeginInit; (System.ComponentModel.ISupportInitialize(Self.NumericUpDownAge)).BeginInit; Self.SuspendLayout; // // Panel1 // Self.Panel1.Controls.Add(Self.Label3); Self.Panel1.Controls.Add(Self.NumericUpDownIncome); Self.Panel1.Controls.Add(Self.NumericUpDownAge); Self.Panel1.Controls.Add(Self.Label2); Self.Panel1.Controls.Add(Self.TextBoxName); Self.Panel1.Controls.Add(Self.Label1); Self.Panel1.Location := System.Drawing.Point.Create(8, 8); Self.Panel1.Name := 'Panel1'; Self.Panel1.Size := System.Drawing.Size.Create(224, 160); Self.Panel1.TabIndex := 7; // // Label3 // Self.Label3.Location := System.Drawing.Point.Create(16, 112); Self.Label3.Name := 'Label3'; Self.Label3.Size := System.Drawing.Size.Create(72, 16); Self.Label3.TabIndex := 13; Self.Label3.Text := 'Income:'; // // NumericUpDownIncome // Self.NumericUpDownIncome.DecimalPlaces := 2; Self.NumericUpDownIncome.Location := System.Drawing.Point.Create(16, 128); Self.NumericUpDownIncome.Maximum := System.Decimal.Create(TArrayOfInteger.Create(100000000, 0, 0, 0)); Self.NumericUpDownIncome.Name := 'NumericUpDownIncome'; Self.NumericUpDownIncome.TabIndex := 12; Self.NumericUpDownIncome.TextAlign := System.Windows.Forms.HorizontalAlignment.Right; // // NumericUpDownAge // Self.NumericUpDownAge.Location := System.Drawing.Point.Create(16, 80); Self.NumericUpDownAge.Maximum := System.Decimal.Create(TArrayOfInteger.Create(300, 0, 0, 0)); Self.NumericUpDownAge.Name := 'NumericUpDownAge'; Self.NumericUpDownAge.Size := System.Drawing.Size.Create(56, 20); Self.NumericUpDownAge.TabIndex := 11; Self.NumericUpDownAge.TextAlign := System.Windows.Forms.HorizontalAlignment.Right; Self.NumericUpDownAge.Value := System.Decimal.Create(TArrayOfInteger.Create(1, 0, 0, 0)); // // Label2 // Self.Label2.Location := System.Drawing.Point.Create(16, 64); Self.Label2.Name := 'Label2'; Self.Label2.Size := System.Drawing.Size.Create(24, 16); Self.Label2.TabIndex := 10; Self.Label2.Text := 'Age'; // // TextBoxName // Self.TextBoxName.Location := System.Drawing.Point.Create(16, 32); Self.TextBoxName.Name := 'TextBoxName'; Self.TextBoxName.Size := System.Drawing.Size.Create(152, 20); Self.TextBoxName.TabIndex := 9; Self.TextBoxName.Text := ''; // // Label1 // Self.Label1.Location := System.Drawing.Point.Create(16, 16); Self.Label1.Name := 'Label1'; Self.Label1.Size := System.Drawing.Size.Create(40, 16); Self.Label1.TabIndex := 8; Self.Label1.Text := 'Name:'; // // LabelRecords // Self.LabelRecords.Location := System.Drawing.Point.Create(384, 176); Self.LabelRecords.Name := 'LabelRecords'; Self.LabelRecords.Size := System.Drawing.Size.Create(136, 16); Self.LabelRecords.TabIndex := 8; Self.LabelRecords.Text := '{0} records'; Self.LabelRecords.TextAlign := System.Drawing.ContentAlignment.MiddleRight; // // ListViewRecords // Self.ListViewRecords.Columns.AddRange(TArrayOfSystem_Windows_Forms_ColumnHeader.Create(Self.ColumnHeader1)); Self.ListViewRecords.FullRowSelect := True; Self.ListViewRecords.HideSelection := False; Self.ListViewRecords.Location := System.Drawing.Point.Create(240, 8); Self.ListViewRecords.MultiSelect := False; Self.ListViewRecords.Name := 'ListViewRecords'; Self.ListViewRecords.Size := System.Drawing.Size.Create(280, 160); Self.ListViewRecords.TabIndex := 9; Self.ListViewRecords.View := System.Windows.Forms.View.Details; Include(Self.ListViewRecords.SelectedIndexChanged, Self.ListViewRecords_SelectedIndexChanged); // // ColumnHeader1 // Self.ColumnHeader1.Text := 'Name'; Self.ColumnHeader1.Width := 200; // // ButtonQuit // Self.ButtonQuit.Location := System.Drawing.Point.Create(448, 200); Self.ButtonQuit.Name := 'ButtonQuit'; Self.ButtonQuit.TabIndex := 10; Self.ButtonQuit.Text := '&Quit'; Include(Self.ButtonQuit.Click, Self.ButtonQuit_Click); // // ButtonAddRecord // Self.ButtonAddRecord.Location := System.Drawing.Point.Create(8, 200); Self.ButtonAddRecord.Name := 'ButtonAddRecord'; Self.ButtonAddRecord.TabIndex := 11; Self.ButtonAddRecord.Text := 'Add Record'; Include(Self.ButtonAddRecord.Click, Self.ButtonAddRecord_Click); // // ButtonOverwrite // Self.ButtonOverwrite.Location := System.Drawing.Point.Create(96, 200); Self.ButtonOverwrite.Name := 'ButtonOverwrite'; Self.ButtonOverwrite.TabIndex := 12; Self.ButtonOverwrite.Text := '&Replace'; Include(Self.ButtonOverwrite.Click, Self.ButtonOverwrite_Click); // // TWinFormMain // Self.AutoScaleBaseSize := System.Drawing.Size.Create(5, 13); Self.ClientSize := System.Drawing.Size.Create(544, 230); Self.Controls.Add(Self.ButtonOverwrite); Self.Controls.Add(Self.ButtonAddRecord); Self.Controls.Add(Self.ButtonQuit); Self.Controls.Add(Self.ListViewRecords); Self.Controls.Add(Self.LabelRecords); Self.Controls.Add(Self.Panel1); Self.Name := 'TWinFormMain'; Self.StartPosition := System.Windows.Forms.FormStartPosition.CenterScreen; Self.Text := 'Jedi.System.IO.FileOfRecord Test'; Include(Self.Load, Self.TWinFormMain_Load); Self.Panel1.ResumeLayout(False); (System.ComponentModel.ISupportInitialize(Self.NumericUpDownIncome)).EndInit; (System.ComponentModel.ISupportInitialize(Self.NumericUpDownAge)).EndInit; Self.ResumeLayout(False); end; {$ENDREGION} procedure TWinFormMain.Dispose(Disposing: Boolean); begin if Disposing then begin if Components <> nil then Components.Dispose(); end; inherited Dispose(Disposing); end; constructor TWinFormMain.Create; begin inherited Create; InitializeComponent; FFileName := Directory.GetCurrentDirectory + '/ExampleFileOfValueType.rnd'; end; procedure TWinFormMain.ListViewRecords_SelectedIndexChanged(sender: System.Object; e: System.EventArgs); var f: FileOfRecord; r: TPersonRec; begin ButtonOverwrite.Enabled := False; if ListViewRecords.SelectedItems.Count > 0 then begin // C# users are required to use the FileOfValueType class; FileOfRecord is // just a convienient alias to FileOfValueType and only available to Delphi // users f := FileOfRecord.Create( TypeOf(TPersonRec), FFileName ); try // seek to the selected item f.Seek(Integer(ListViewRecords.SelectedItems[0].Tag)); f.Read(r); TextBoxName.Text := r.Name; NumericUpDownAge.Value := r.Age; NumericUpDownIncome.Value := r.Income; ButtonOverwrite.Enabled := True; finally f.Free; end; end else begin TextBoxName.Text := ''; NumericUpDownAge.Value := 0; NumericUpDownIncome.Value := 0; end; end; procedure TWinFormMain.ButtonOverwrite_Click(sender: System.Object; e: System.EventArgs); var f: FileOfRecord; r: TPersonRec; begin // C# users are required to use the FileOfValueType class; FileOfRecord is // just a convienient alias to FileOfValueType and only available to Delphi // users f := FileOfRecord.Create( TypeOf(TPersonRec), FFileName ); try // seek to the selected item f.Seek(Integer(ListViewRecords.SelectedItems[0].Tag)); r.Name := TextBoxName.Text; r.Age := Decimal.ToByte(NumericUpDownAge.Value); r.Income := Decimal.ToDouble(NumericUpDownIncome.Value); f.Write(r); finally f.Free; end; PopulateListViewRecords; TextBoxName.Text := ''; NumericUpDownAge.Value := 0; NumericUpDownIncome.Value := 0; Control(TextBoxName).Focus; end; procedure TWinFormMain.TWinFormMain_Load(sender: System.Object; e: System.EventArgs); begin PopulateListViewRecords; end; procedure TWinFormMain.PopulateListViewRecords; var f: FileOfRecord; r: TPersonRec; begin ButtonOverwrite.Enabled := False; ListViewRecords.Items.Clear; if &File.Exists(FFileName) then begin // C# users are required to use the FileOfValueType class; FileOfRecord is // just a convienient alias to FileOfValueType and only available to Delphi // users f := FileOfRecord.Create( TypeOf(TPersonRec), FFileName ); try while not f.Eof do begin f.Read(r); ListViewRecords.Items.Add(r.Name).Tag := Integer(f.Position - 1); end; finally f.Free; end; end; LabelRecords.Text := System.String.Format('{0} records', ListViewRecords.Items.Count); end; procedure TWinFormMain.ButtonAddRecord_Click(sender: System.Object; e: System.EventArgs); var f: FileOfRecord; r: TPersonRec; begin // C# users are required to use the FileOfValueType class; FileOfRecord is // just a convienient alias to FileOfValueType and only available to Delphi // users f := FileOfRecord.Create( TypeOf(TPersonRec), FFileName ); try f.Seek(f.RecordCount); r.Name := TextBoxName.Text; r.Age := Decimal.ToByte(NumericUpDownAge.Value); r.Income := Decimal.ToDouble(NumericUpDownIncome.Value); f.Write(r); finally f.Free; end; PopulateListViewRecords; TextBoxName.Text := ''; NumericUpDownAge.Value := 0; NumericUpDownIncome.Value := 0; Control(TextBoxName).Focus; end; procedure TWinFormMain.ButtonQuit_Click(sender: System.Object; e: System.EventArgs); begin Close; end; end. --- NEW FILE: example.StreamOfValueType.dpr --- program example.StreamOfValueType; {%DelphiDotNetAssemblyCompiler '$(SystemRoot)\microsoft.net\framework\v1.1.4322\System.Data.dll'} {%DelphiDotNetAssemblyCompiler '$(SystemRoot)\microsoft.net\framework\v1.1.4322\System.Drawing.dll'} {%DelphiDotNetAssemblyCompiler '$(SystemRoot)\microsoft.net\framework\v1.1.4322\System.Windows.Forms.dll'} {%DelphiDotNetAssemblyCompiler '$(SystemRoot)\microsoft.net\framework\v1.1.4322\System.XML.dll'} {$R 'WinFormMain.TWinFormMain.resources' 'WinFormMain.resx'} {%DelphiDotNetAssemblyCompiler '..\..\..\bin\Jedi.IO.dll'} {%DelphiDotNetAssemblyCompiler '..\..\..\bin\Jedi.System.dll'} uses System.Reflection, System.Runtime.CompilerServices, System.Windows.Forms, WinFormMain in 'WinFormMain.pas' {WinFormMain.TWinFormMain: System.Windows.Forms.Form}; {$R *.res} {$REGION 'Program/Assembly Information'} [assembly: AssemblyTitle('example.StreamOfValueType')] [assembly: AssemblyDescription('Example of the Jedi.IO.StreamOfValueType class.')] [assembly: AssemblyConfiguration('')] [assembly: AssemblyCompany('Project JEDI')] [assembly: AssemblyProduct('JEDI.NET library')] [assembly: AssemblyCopyright('Copyright © 2004 - 2005 Project JEDI')] [assembly: AssemblyTrademark('')] [assembly: AssemblyCulture('')] [assembly: AssemblyVersion('1.0.0.0')] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile('')] [assembly: AssemblyKeyName('')] {$ENDREGION} [STAThread] begin Application.Run(TWinFormMain.Create); end. --- NEW FILE: example.StreamOfValueType.bdsproj --- (This appears to be a binary file; contents omitted.) --- NEW FILE: WinFormMain.resx --- (This appears to be a binary file; contents omitted.) |
From: Marcel B. <jed...@us...> - 2005-03-14 14:17:00
|
Update of /cvsroot/jedidotnet/main/examples/Jedi.IO/StreamOfValueType In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27391/StreamOfValueType Log Message: Directory /cvsroot/jedidotnet/main/examples/Jedi.IO/StreamOfValueType added to the repository |