System.Data.SQLite
Check-in [f0ccb3cd64]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Rename the SQLiteModuleBase class to SQLiteModule.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | virtualTables
Files: files | file ages | folders
SHA1: f0ccb3cd6471384aeec6263e941ce40e1907d899
User & Date: mistachkin 2013-06-21 07:21:06
Context
2013-06-21
07:23
Remove unused GetNativeModule method. check-in: e550e1282e user: mistachkin tags: virtualTables
07:21
Rename the SQLiteModuleBase class to SQLiteModule. check-in: f0ccb3cd64 user: mistachkin tags: virtualTables
07:15
Move string related marshalling methods to the new SQLiteString static class. check-in: 0d7f2bfcca user: mistachkin tags: virtualTables
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to System.Data.SQLite/SQLite3.cs.

    82     82       /// The user-defined functions registered on this connection
    83     83       /// </summary>
    84     84       protected SQLiteFunction[] _functionsArray;
    85     85   
    86     86       /// <summary>
    87     87       /// The modules created using this connection.
    88     88       /// </summary>
    89         -    protected Dictionary<string, SQLiteModuleBase> _modules;
           89  +    protected Dictionary<string, SQLiteModule> _modules;
    90     90   
    91     91       ///////////////////////////////////////////////////////////////////////////////////////////////
    92     92   
    93     93       internal SQLite3(
    94     94           SQLiteDateFormats fmt,
    95     95           DateTimeKind kind,
    96     96           string fmtString,
................................................................................
   137    137   
   138    138                   //////////////////////////////////////
   139    139                   // release unmanaged resources here...
   140    140                   //////////////////////////////////////
   141    141   
   142    142                   if (_modules != null)
   143    143                   {
   144         -                    foreach (KeyValuePair<string, SQLiteModuleBase> pair in _modules)
          144  +                    foreach (KeyValuePair<string, SQLiteModule> pair in _modules)
   145    145                       {
   146         -                        SQLiteModuleBase module = pair.Value;
          146  +                        SQLiteModule module = pair.Value;
   147    147   
   148    148                           if (module == null)
   149    149                               continue;
   150    150   
   151    151                           module.Dispose();
   152    152                       }
   153    153                   }
................................................................................
  1574   1574       /// <summary>
  1575   1575       /// Calls the native SQLite core library in order to create a disposable
  1576   1576       /// module containing the implementation of a virtual table.
  1577   1577       /// </summary>
  1578   1578       /// <param name="module">
  1579   1579       /// The module object to be used when creating the native disposable module.
  1580   1580       /// </param>
  1581         -    internal override void CreateModule(SQLiteModuleBase module)
         1581  +    internal override void CreateModule(SQLiteModule module)
  1582   1582       {
  1583   1583           if (module == null)
  1584   1584               throw new ArgumentNullException("module");
  1585   1585   
  1586   1586           if (_sql == null)
  1587   1587               throw new SQLiteException("connection has an invalid handle");
  1588   1588   
................................................................................
  1599   1599                   module.CreateNativeModule();
  1600   1600   
  1601   1601               if (UnsafeNativeMethods.sqlite3_create_disposable_module(
  1602   1602                       _sql, pName, ref nativeModule, IntPtr.Zero,
  1603   1603                       null) != IntPtr.Zero)
  1604   1604               {
  1605   1605                   if (_modules == null)
  1606         -                    _modules = new Dictionary<string, SQLiteModuleBase>();
         1606  +                    _modules = new Dictionary<string, SQLiteModule>();
  1607   1607   
  1608   1608                   _modules.Add(module.Name, module);
  1609   1609               }
  1610   1610               else
  1611   1611               {
  1612   1612                   throw new SQLiteException(SQLiteErrorCode.Error, GetLastError());
  1613   1613               }
................................................................................
  1626   1626       /// Calls the native SQLite core library in order to cleanup the resources
  1627   1627       /// associated with a module containing the implementation of a virtual table.
  1628   1628       /// </summary>
  1629   1629       /// <param name="module">
  1630   1630       /// The module object previously passed to the <see cref="CreateModule" />
  1631   1631       /// method.
  1632   1632       /// </param>
  1633         -    internal override void DisposeModule(SQLiteModuleBase module)
         1633  +    internal override void DisposeModule(SQLiteModule module)
  1634   1634       {
  1635   1635           if (module == null)
  1636   1636               throw new ArgumentNullException("module");
  1637   1637   
  1638   1638           module.Dispose();
  1639   1639       }
  1640   1640   
................................................................................
  1659   1659       /// Upon success, the contents of this parameter are undefined.  Upon failure,
  1660   1660       /// it should contain an appropriate error message.
  1661   1661       /// </param>
  1662   1662       /// <returns>
  1663   1663       /// A standard SQLite return code.
  1664   1664       /// </returns>
  1665   1665       internal override SQLiteErrorCode DeclareVirtualTable(
  1666         -        SQLiteModuleBase module,
         1666  +        SQLiteModule module,
  1667   1667           string strSql,
  1668   1668           ref string error
  1669   1669           )
  1670   1670       {
  1671   1671           if (_sql == null)
  1672   1672           {
  1673   1673               error = "connection has an invalid handle";

Changes to System.Data.SQLite/SQLiteBase.cs.

   214    214       /// <summary>
   215    215       /// Calls the native SQLite core library in order to create a disposable
   216    216       /// module containing the implementation of a virtual table.
   217    217       /// </summary>
   218    218       /// <param name="module">
   219    219       /// The module object to be used when creating the native disposable module.
   220    220       /// </param>
   221         -    internal abstract void CreateModule(SQLiteModuleBase module);
          221  +    internal abstract void CreateModule(SQLiteModule module);
   222    222   
   223    223       /// <summary>
   224    224       /// Calls the native SQLite core library in order to cleanup the resources
   225    225       /// associated with a module containing the implementation of a virtual table.
   226    226       /// </summary>
   227    227       /// <param name="module">
   228    228       /// The module object previously passed to the <see cref="CreateModule" />
   229    229       /// method.
   230    230       /// </param>
   231         -    internal abstract void DisposeModule(SQLiteModuleBase module);
          231  +    internal abstract void DisposeModule(SQLiteModule module);
   232    232   
   233    233       /// <summary>
   234    234       /// Calls the native SQLite core library in order to declare a virtual table
   235    235       /// in response to a call into the xCreate or xConnect virtual table methods.
   236    236       /// </summary>
   237    237       /// <param name="module">
   238    238       /// The virtual table module that is to be responsible for the virtual table
................................................................................
   245    245       /// <param name="error">
   246    246       /// Upon success, the contents of this parameter are undefined.  Upon failure,
   247    247       /// it should contain an appropriate error message.
   248    248       /// </param>
   249    249       /// <returns>
   250    250       /// A standard SQLite return code.
   251    251       /// </returns>
   252         -    internal abstract SQLiteErrorCode DeclareVirtualTable(SQLiteModuleBase module, string strSql, ref string error);
          252  +    internal abstract SQLiteErrorCode DeclareVirtualTable(SQLiteModule module, string strSql, ref string error);
   253    253   
   254    254       /// <summary>
   255    255       /// Enables or disabled extension loading by SQLite.
   256    256       /// </summary>
   257    257       /// <param name="bOnOff">
   258    258       /// True to enable loading of extensions, false to disable.
   259    259       /// </param>

Changes to System.Data.SQLite/SQLiteConnection.cs.

  1729   1729       /// Creates a disposable module containing the implementation of a virtual
  1730   1730       /// table.
  1731   1731       /// </summary>
  1732   1732       /// <param name="module">
  1733   1733       /// The module object to be used when creating the disposable module.
  1734   1734       /// </param>
  1735   1735       public void CreateModule(
  1736         -        SQLiteModuleBase module
         1736  +        SQLiteModule module
  1737   1737           )
  1738   1738       {
  1739   1739           CheckDisposed();
  1740   1740   
  1741   1741           if (_sql == null)
  1742   1742               throw new InvalidOperationException(
  1743   1743                   "Database connection not valid for creating modules.");

Name change from System.Data.SQLite/SQLiteModuleBase.cs to System.Data.SQLite/SQLiteModule.cs.

  1998   1998       }
  1999   1999       #endregion
  2000   2000   
  2001   2001       ///////////////////////////////////////////////////////////////////////////
  2002   2002   
  2003   2003       #region SQLiteModule Base Class
  2004   2004       /* NOT SEALED */
  2005         -    public abstract class SQLiteModuleBase :
         2005  +    public abstract class SQLiteModule :
  2006   2006               ISQLiteManagedModule, /*ISQLiteNativeModule,*/ IDisposable
  2007   2007       {
  2008   2008           #region Private Constants
  2009   2009           private const double DefaultCost = double.MaxValue;
  2010   2010           #endregion
  2011   2011   
  2012   2012           ///////////////////////////////////////////////////////////////////////
................................................................................
  2032   2032               return CreateNativeModule(CreateNativeModuleImpl());
  2033   2033           }
  2034   2034           #endregion
  2035   2035   
  2036   2036           ///////////////////////////////////////////////////////////////////////
  2037   2037   
  2038   2038           #region Public Constructors
  2039         -        public SQLiteModuleBase(string name)
         2039  +        public SQLiteModule(string name)
  2040   2040           {
  2041   2041               if (name == null)
  2042   2042                   throw new ArgumentNullException("name");
  2043   2043   
  2044   2044               this.name = name;
  2045   2045               this.tables = new Dictionary<IntPtr, SQLiteVirtualTable>();
  2046   2046               this.cursors = new Dictionary<IntPtr, SQLiteVirtualTableCursor>();
................................................................................
  3482   3482           private bool disposed;
  3483   3483           private void CheckDisposed() /* throw */
  3484   3484           {
  3485   3485   #if THROW_ON_DISPOSED
  3486   3486               if (disposed)
  3487   3487               {
  3488   3488                   throw new ObjectDisposedException(
  3489         -                    typeof(SQLiteModuleBase).Name);
         3489  +                    typeof(SQLiteModule).Name);
  3490   3490               }
  3491   3491   #endif
  3492   3492           }
  3493   3493   
  3494   3494           ///////////////////////////////////////////////////////////////////////
  3495   3495   
  3496   3496           protected virtual void Dispose(bool disposing)
................................................................................
  3535   3535               }
  3536   3536           }
  3537   3537           #endregion
  3538   3538   
  3539   3539           ///////////////////////////////////////////////////////////////////////
  3540   3540   
  3541   3541           #region Destructor
  3542         -        ~SQLiteModuleBase()
         3542  +        ~SQLiteModule()
  3543   3543           {
  3544   3544               Dispose(false);
  3545   3545           }
  3546   3546           #endregion
  3547   3547       }
  3548   3548       #endregion
  3549   3549   }

Changes to System.Data.SQLite/SQLiteModuleNoop.cs.

     3      3    * Written by Joe Mistachkin (joe@mistachkin.com)
     4      4    *
     5      5    * Released to the public domain, use at your own risk!
     6      6    ********************************************************/
     7      7   
     8      8   namespace System.Data.SQLite
     9      9   {
    10         -    public class SQLiteModuleNoop : SQLiteModuleBase
           10  +    public class SQLiteModuleNoop : SQLiteModule
    11     11       {
    12     12           #region Public Constructors
    13     13           public SQLiteModuleNoop(
    14     14               string name
    15     15               )
    16     16               : base(name)
    17     17           {

Changes to System.Data.SQLite/System.Data.SQLite.Files.targets.

    39     39       <Compile Include="SQLiteException.cs" />
    40     40       <Compile Include="SQLiteFactory.cs" />
    41     41       <Compile Include="SQLiteFunction.cs" />
    42     42       <Compile Include="SQLiteFunctionAttribute.cs" />
    43     43       <Compile Include="SQLiteKeyReader.cs" />
    44     44       <Compile Include="SQLiteLog.cs" />
    45     45       <Compile Include="SQLiteMetaDataCollectionNames.cs" />
    46         -    <Compile Include="SQLiteModuleBase.cs" />
           46  +    <Compile Include="SQLiteModule.cs" />
    47     47       <Compile Include="SQLiteModuleEnumerable.cs" />
    48     48       <Compile Include="SQLiteModuleNoop.cs" />
    49     49       <Compile Include="SQLiteParameter.cs" />
    50     50       <Compile Include="SQLiteParameterCollection.cs" />
    51     51       <Compile Include="SQLiteStatement.cs" />
    52     52       <Compile Include="SQLiteTransaction.cs" />
    53     53       <Compile Include="SR.Designer.cs">