Changeset 7
- Timestamp:
- 06/18/04 15:27:22
- Files:
-
- trunk/SubversionSharp/dev/src/SubversionSharp.prjx (modified) (1 diff)
- trunk/SubversionSharp/dev/src/Svn.cs (modified) (1 diff)
- trunk/SubversionSharp/dev/src/SvnClientContext.cs (added)
- trunk/SubversionSharp/dev/src/SvnConfig.cs (modified) (2 diffs)
- trunk/SubversionSharp/dev/src/SvnException.cs (modified) (1 diff)
- trunk/SubversionSharp/test/src/Main.cs (modified) (2 diffs)
- trunk/SubversionSharp/test/src/SvnTest.prjx (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/SubversionSharp/dev/src/SubversionSharp.prjx
r2 r7 7 7 <File name="./SvnNullReferenceException.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> 8 8 <File name="./SvnConfig.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> 9 <File name="./SvnClientContext.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> 9 10 </Contents> 10 11 <References> 11 <Reference type="Project" refto="Softec" localcopy="True" />12 12 <Reference type="Project" refto="AprSharp" localcopy="True" /> 13 13 </References> trunk/SubversionSharp/dev/src/Svn.cs
r2 r7 57 57 } 58 58 #endregion 59 60 #region ClientContext 61 [DllImport("svn_client-1")] static extern 62 internal IntPtr svn_client_create_context(out IntPtr ctx, IntPtr pool); 63 #endregion 59 64 60 65 #region Config 61 66 [DllImport("svn_client-1")] static extern 62 67 internal IntPtr svn_config_ensure(IntPtr config_dir, IntPtr pool); 63 [DllImport("svn_client-1" )] static extern68 [DllImport("svn_client-1", CharSet=CharSet.Ansi)] static extern 64 69 internal IntPtr svn_config_ensure(string config_dir, IntPtr pool); 65 70 71 [DllImport("svn_client-1")] static extern 72 internal IntPtr svn_config_get_config(out IntPtr cfg_hash, IntPtr config_dir, IntPtr pool); 73 [DllImport("svn_client-1", CharSet=CharSet.Ansi)] static extern 74 internal IntPtr svn_config_get_config(out IntPtr cfg_hash, string config_dir, IntPtr pool); 66 75 #endregion 67 68 76 } 69 77 } trunk/SubversionSharp/dev/src/SvnConfig.cs
r2 r7 74 74 public static void Ensure(AprPool pool) 75 75 { 76 Debug.WriteLine(String.Format("svn_config_ensure({0},{1})",IntPtr.Zero,pool)); 76 77 SvnError err = Svn.svn_config_ensure(IntPtr.Zero, pool); 77 78 if(!err.IsNoError()) … … 81 82 public static void Ensure(string configDir, AprPool pool) 82 83 { 84 Debug.WriteLine(String.Format("svn_config_ensure({0},{1})",configDir,pool)); 83 85 SvnError err = Svn.svn_config_ensure(configDir, pool); 84 86 if(!err.IsNoError()) 85 87 throw new SvnException(err); 86 88 } 89 90 public static void Ensure(AprString configDir, AprPool pool) 91 { 92 Debug.WriteLine(String.Format("svn_config_ensure({0},{1})",configDir,pool)); 93 SvnError err = Svn.svn_config_ensure(configDir, pool); 94 if(!err.IsNoError()) 95 throw new SvnException(err); 96 } 97 98 public static AprHash GetConfig(AprPool pool) 99 { 100 IntPtr h; 101 Debug.WriteLine(String.Format("svn_config_get_config({0},{1})",IntPtr.Zero,pool)); 102 SvnError err = Svn.svn_config_get_config(out h, IntPtr.Zero, pool); 103 if(!err.IsNoError()) 104 throw new SvnException(err); 105 return h; 106 } 107 108 public static AprHash GetConfig(string configDir, AprPool pool) 109 { 110 IntPtr h; 111 Debug.WriteLine(String.Format("svn_config_get_config({0},{1})",configDir,pool)); 112 SvnError err = Svn.svn_config_get_config(out h, configDir, pool); 113 if(!err.IsNoError()) 114 throw new SvnException(err); 115 return h; 116 } 117 118 public static AprHash GetConfig(AprString configDir, AprPool pool) 119 { 120 IntPtr h; 121 Debug.WriteLine(String.Format("svn_config_get_config({0},{1})",configDir,pool)); 122 SvnError err = Svn.svn_config_get_config(out h, configDir, pool); 123 if(!err.IsNoError()) 124 throw new SvnException(err); 125 return h; 126 } 87 127 #endregion 88 128 } trunk/SubversionSharp/dev/src/SvnException.cs
r2 r7 12 12 using System; 13 13 using System.Runtime.Serialization; 14 using Softec;15 14 16 15 namespace Softec.SubversionSharp 17 16 { 18 17 [Serializable] 19 public class SvnException : SoftecException18 public class SvnException : Exception 20 19 { 21 20 const int Result = unchecked ((int)0xA0520000); trunk/SubversionSharp/test/src/Main.cs
r2 r7 1 1 // project created on 5/13/2004 at 10:00 PM 2 2 using System; 3 using System.Diagnostics; 3 4 using Softec.AprSharp; 4 5 using Softec.SubversionSharp; … … 8 9 public static void Main(string[] args) 9 10 { 11 Debug.Listeners.Add(new TextWriterTraceListener(Console.Out)); 10 12 SvnConfig.Ensure(); 13 14 AprPool pool = Svn.PoolCreate(); 15 SvnClientContext ctx = SvnClientContext.Create(pool); 16 ctx.Config = SvnConfig.GetConfig(pool); 17 AprHash ctxcfg = ctx.Config; 18 foreach(AprHashEntry cfg in ctxcfg) 19 { 20 Console.WriteLine("{0}\t{1:X}",cfg.KeyAsString,cfg.Value.ToInt32()); 21 } 22 pool.Destroy(); 11 23 } 12 24 } trunk/SubversionSharp/test/src/SvnTest.prjx
r2 r7 5 5 </Contents> 6 6 <References> 7 <Reference type="Project" refto="Softec" localcopy="True" />8 7 <Reference type="Project" refto="AprSharp" localcopy="True" /> 9 8 <Reference type="Project" refto="SubversionSharp" localcopy="True" />