System.Data.SQLite

Check-in [99625b3b90]
Login

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

Overview
Comment:Move test-only private methods to their own region within the SQLiteIndex class.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | vtabFixes
Files: files | file ages | folders
SHA1: 99625b3b906a3e44a1b4867fbecfbb0e03eb12ba
User & Date: mistachkin 2015-12-04 06:35:21.458
Context
2015-12-04
20:05
Enhance new vtab test. Style and naming tweaks. check-in: 605ba3f2e2 user: mistachkin tags: vtabFixes
06:35
Move test-only private methods to their own region within the SQLiteIndex class. check-in: 99625b3b90 user: mistachkin tags: vtabFixes
06:31
Style and naming fixes. check-in: 88219678e3 user: mistachkin tags: vtabFixes
Changes
Unified Diff Ignore Whitespace Patch
Changes to System.Data.SQLite/SQLiteModule.cs.
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
            inputs = new SQLiteIndexInputs(nConstraint, nOrderBy);
            outputs = new SQLiteIndexOutputs(nConstraint);
        }
        #endregion

        ///////////////////////////////////////////////////////////////////////

        #region Internal Marshal Helper Methods
        /// <summary>
        /// Attempts to determine the structure sizes needed to create and
        /// populate a native
        /// <see cref="UnsafeNativeMethods.sqlite3_index_info" />
        /// structure.
        /// </summary>
        /// <param name="sizeOfInfoType">







|







1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
            inputs = new SQLiteIndexInputs(nConstraint, nOrderBy);
            outputs = new SQLiteIndexOutputs(nConstraint);
        }
        #endregion

        ///////////////////////////////////////////////////////////////////////

        #region Private Marshal Helper Methods (For Test Use Only)
        /// <summary>
        /// Attempts to determine the structure sizes needed to create and
        /// populate a native
        /// <see cref="UnsafeNativeMethods.sqlite3_index_info" />
        /// structure.
        /// </summary>
        /// <param name="sizeOfInfoType">
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
        /// structure is stored here.
        /// </param>
        /// <param name="sizeOfConstraintUsageType">
        /// The size of the native
        /// <see cref="UnsafeNativeMethods.sqlite3_index_constraint_usage" />
        /// structure is stored here.
        /// </param>
        private static void SizeOf( /* NOTE: For test use only. */
            out int sizeOfInfoType,
            out int sizeOfConstraintType,
            out int sizeOfOrderByType,
            out int sizeOfConstraintUsageType
            )
        {
            sizeOfInfoType = Marshal.SizeOf(typeof(







|







1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
        /// structure is stored here.
        /// </param>
        /// <param name="sizeOfConstraintUsageType">
        /// The size of the native
        /// <see cref="UnsafeNativeMethods.sqlite3_index_constraint_usage" />
        /// structure is stored here.
        /// </param>
        private static void SizeOf(
            out int sizeOfInfoType,
            out int sizeOfConstraintType,
            out int sizeOfOrderByType,
            out int sizeOfConstraintUsageType
            )
        {
            sizeOfInfoType = Marshal.SizeOf(typeof(
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
        /// pre-allocate space for.
        /// </param>
        /// <returns>
        /// The newly allocated native
        /// <see cref="UnsafeNativeMethods.sqlite3_index_info" /> structure
        /// -OR- <see cref="IntPtr.Zero" /> if it could not be fully allocated.
        /// </returns>
        private static IntPtr AllocateAndInitializeNative( /* NOTE: For test use only. */
            int nConstraint,
            int nOrderBy
            )
        {
            IntPtr pIndex = IntPtr.Zero;
            IntPtr pInfo = IntPtr.Zero;
            IntPtr pConstraint = IntPtr.Zero;







|







1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
        /// pre-allocate space for.
        /// </param>
        /// <returns>
        /// The newly allocated native
        /// <see cref="UnsafeNativeMethods.sqlite3_index_info" /> structure
        /// -OR- <see cref="IntPtr.Zero" /> if it could not be fully allocated.
        /// </returns>
        private static IntPtr AllocateAndInitializeNative(
            int nConstraint,
            int nOrderBy
            )
        {
            IntPtr pIndex = IntPtr.Zero;
            IntPtr pInfo = IntPtr.Zero;
            IntPtr pConstraint = IntPtr.Zero;
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
        /// <see cref="UnsafeNativeMethods.sqlite3_index_info" />
        /// structure.
        /// </summary>
        /// <param name="pIndex">
        /// The native pointer to the native sqlite3_index_info structure to
        /// free.
        /// </param>
        private static void FreeNative( /* NOTE: For test use only. */
            IntPtr pIndex
            )
        {
            if (pIndex == IntPtr.Zero)
                return;

            int offset = 0;







|







1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
        /// <see cref="UnsafeNativeMethods.sqlite3_index_info" />
        /// structure.
        /// </summary>
        /// <param name="pIndex">
        /// The native pointer to the native sqlite3_index_info structure to
        /// free.
        /// </param>
        private static void FreeNative(
            IntPtr pIndex
            )
        {
            if (pIndex == IntPtr.Zero)
                return;

            int offset = 0;
1487
1488
1489
1490
1491
1492
1493

1494
1495
1496

1497
1498
1499
1500
1501
1502
1503

            if (pIndex != IntPtr.Zero)
            {
                SQLiteMemory.Free(pIndex);
                pIndex = IntPtr.Zero;
            }
        }


        ///////////////////////////////////////////////////////////////////////


        /// <summary>
        /// Converts a native pointer to a native sqlite3_index_info structure
        /// into a new <see cref="SQLiteIndex" /> object instance.
        /// </summary>
        /// <param name="pIndex">
        /// The native pointer to the native sqlite3_index_info structure to
        /// convert.







>



>







1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505

            if (pIndex != IntPtr.Zero)
            {
                SQLiteMemory.Free(pIndex);
                pIndex = IntPtr.Zero;
            }
        }
        #endregion

        ///////////////////////////////////////////////////////////////////////

        #region Internal Marshal Helper Methods
        /// <summary>
        /// Converts a native pointer to a native sqlite3_index_info structure
        /// into a new <see cref="SQLiteIndex" /> object instance.
        /// </summary>
        /// <param name="pIndex">
        /// The native pointer to the native sqlite3_index_info structure to
        /// convert.