Changeset 7

Show
Ignore:
Timestamp:
06/18/04 15:27:22
Author:
DenisG
Message:

[SubversionSharp] Support of svn_config_get_config in client context

- Improve SvnConfig? to support svn_config_get_config
- Encapsulate svn_client_ctx
- Remove useless dependancy with Softec namespace for SvnException?

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/SubversionSharp/dev/src/SubversionSharp.prjx

    r2 r7  
    77    <File name="./SvnNullReferenceException.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> 
    88    <File name="./SvnConfig.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> 
     9    <File name="./SvnClientContext.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> 
    910  </Contents> 
    1011  <References> 
    11     <Reference type="Project" refto="Softec" localcopy="True" /> 
    1212    <Reference type="Project" refto="AprSharp" localcopy="True" /> 
    1313  </References> 
  • trunk/SubversionSharp/dev/src/Svn.cs

    r2 r7  
    5757        } 
    5858        #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 
    5964                 
    6065        #region Config 
    6166        [DllImport("svn_client-1")] static extern 
    6267        internal IntPtr svn_config_ensure(IntPtr config_dir, IntPtr pool); 
    63         [DllImport("svn_client-1")] static extern 
     68        [DllImport("svn_client-1", CharSet=CharSet.Ansi)] static extern 
    6469        internal IntPtr svn_config_ensure(string config_dir, IntPtr pool); 
    6570         
     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); 
    6675        #endregion 
    67  
    6876    } 
    6977}    
  • trunk/SubversionSharp/dev/src/SvnConfig.cs

    r2 r7  
    7474        public static void Ensure(AprPool pool) 
    7575        { 
     76            Debug.WriteLine(String.Format("svn_config_ensure({0},{1})",IntPtr.Zero,pool)); 
    7677            SvnError err = Svn.svn_config_ensure(IntPtr.Zero, pool); 
    7778            if(!err.IsNoError()) 
     
    8182        public static void Ensure(string configDir, AprPool pool) 
    8283        { 
     84            Debug.WriteLine(String.Format("svn_config_ensure({0},{1})",configDir,pool)); 
    8385            SvnError err = Svn.svn_config_ensure(configDir, pool); 
    8486            if(!err.IsNoError()) 
    8587                throw new SvnException(err); 
    8688        } 
     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        } 
    87127        #endregion 
    88128    } 
  • trunk/SubversionSharp/dev/src/SvnException.cs

    r2 r7  
    1212using System; 
    1313using System.Runtime.Serialization; 
    14 using Softec; 
    1514 
    1615namespace Softec.SubversionSharp 
    1716{ 
    1817    [Serializable] 
    19     public class SvnException : SoftecException 
     18    public class SvnException : Exception 
    2019    { 
    2120        const int Result = unchecked ((int)0xA0520000); 
  • trunk/SubversionSharp/test/src/Main.cs

    r2 r7  
    11// project created on 5/13/2004 at 10:00 PM 
    22using System; 
     3using System.Diagnostics; 
    34using Softec.AprSharp; 
    45using Softec.SubversionSharp; 
     
    89    public static void Main(string[] args) 
    910    { 
     11        Debug.Listeners.Add(new TextWriterTraceListener(Console.Out)); 
    1012        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(); 
    1123    } 
    1224} 
  • trunk/SubversionSharp/test/src/SvnTest.prjx

    r2 r7  
    55  </Contents> 
    66  <References> 
    7     <Reference type="Project" refto="Softec" localcopy="True" /> 
    87    <Reference type="Project" refto="AprSharp" localcopy="True" /> 
    98    <Reference type="Project" refto="SubversionSharp" localcopy="True" />