亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sqlitefunction.cs

?? sqlite 3.3.8 支持加密的版本
?? CS
?? 第 1 頁 / 共 2 頁
字號:
?/********************************************************
 * ADO.NET 2.0 Data Provider for SQLite Version 3.X
 * Written by Robert Simpson (robert@blackcastlesoft.com)
 * 
 * Released to the public domain, use at your own risk!
 ********************************************************/

namespace System.Data.SQLite
{
  using System;
  using System.Collections;
  using System.Collections.Generic;
  using System.Runtime.InteropServices;
  using System.Globalization;

  /// <summary>
  /// The type of user-defined function to declare
  /// </summary>
  public enum FunctionType
  {
    /// <summary>
    /// Scalar functions are designed to be called and return a result immediately.  Examples include ABS(), Upper(), Lower(), etc.
    /// </summary>
    Scalar = 0,
    /// <summary>
    /// Aggregate functions are designed to accumulate data until the end of a call and then return a result gleaned from the accumulated data.
    /// Examples include SUM(), COUNT(), AVG(), etc.
    /// </summary>
    Aggregate = 1,
    /// <summary>
    /// Collation sequences are used to sort textual data in a custom manner, and appear in an ORDER BY clause.  Typically text in an ORDER BY is
    /// sorted using a straight case-insensitive comparison function.  Custom collating sequences can be used to alter the behavior of text sorting
    /// in a user-defined manner.
    /// </summary>
    Collation = 2,
  }

  /// <summary>
  /// An internal callback delegate declaration.
  /// </summary>
  /// <param name="context">Raw context pointer for the user function</param>
  /// <param name="nArgs">Count of arguments to the function</param>
  /// <param name="argsptr">A pointer to the array of argument pointers</param>
  internal delegate void SQLiteCallback(IntPtr context, int nArgs, IntPtr argsptr);
  /// <summary>
  /// Internal callback delegate for implementing collation sequences
  /// </summary>
  /// <param name="len1">Length of the string pv1</param>
  /// <param name="pv1">Pointer to the first string to compare</param>
  /// <param name="len2">Length of the string pv2</param>
  /// <param name="pv2">Pointer to the second string to compare</param>
  /// <returns>Returns -1 if the first string is less than the second.  0 if they are equal, or 1 if the first string is greater
  /// than the second.</returns>
  internal delegate int SQLiteCollation(int len1, IntPtr pv1, int len2, IntPtr pv2);

  /// <summary>
  /// This abstract class is designed to handle user-defined functions easily.  An instance of the derived class is made for each
  /// connection to the database.
  /// </summary>
  /// <remarks>
  /// Although there is one instance of a class derived from SQLiteFunction per database connection, the derived class has no access
  /// to the underlying connection.  This is necessary to deter implementers from thinking it would be a good idea to make database
  /// calls during processing.
  /// 
  /// It is important to distinguish between a per-connection instance, and a per-SQL statement context.  One instance of this class
  /// services all SQL statements being stepped through on that connection, and there can be many.  One should never store per-statement
  /// information in member variables of user-defined function classes.
  /// 
  /// For aggregate functions, always create and store your per-statement data in the contextData object on the 1st step.  This data will
  /// be automatically freed for you (and Dispose() called if the item supports IDisposable) when the statement completes.
  /// </remarks>
  public abstract class SQLiteFunction : IDisposable
  {
    /// <summary>
    /// The base connection this function is attached to
    /// </summary>
    private SQLiteBase              _base;
    /// <summary>
    /// Used internally to keep track of memory allocated for aggregate functions
    /// </summary>
    private IntPtr                     _interopCookie;
    /// <summary>
    /// Internal array used to keep track of aggregate function context data
    /// </summary>
    private Dictionary<long, object> _contextDataList;

    /// <summary>
    /// Holds a reference to the callback function for user functions
    /// </summary>
    private SQLiteCallback  _InvokeFunc;
    /// <summary>
    /// Holds a reference to the callbakc function for stepping in an aggregate function
    /// </summary>
    private SQLiteCallback  _StepFunc;
    /// <summary>
    /// Holds a reference to the callback function for finalizing an aggregate function
    /// </summary>
    private SQLiteCallback  _FinalFunc;
    /// <summary>
    /// Holds a reference to the callback function for collation sequences
    /// </summary>
    private SQLiteCollation _CompareFunc;

    /// <summary>
    /// This static list contains all the user-defined functions declared using the proper attributes.
    /// </summary>
    private static List<SQLiteFunctionAttribute> _registeredFunctions = new List<SQLiteFunctionAttribute>();

    /// <summary>
    /// Internal constructor, initializes the function's internal variables.
    /// </summary>
    protected SQLiteFunction()
    {
      _contextDataList = new Dictionary<long, object>();
    }

    /// <summary>
    /// Returns a reference to the underlying connection's SQLiteConvert class, which can be used to convert
    /// strings and DateTime's into the current connection's encoding schema.
    /// </summary>
    public SQLiteConvert SQLiteConvert
    {
      get
      {
        return _base;
      }
    }

    /// <summary>
    /// Scalar functions override this method to do their magic.
    /// </summary>
    /// <remarks>
    /// Parameters passed to functions have only an affinity for a certain data type, there is no underlying schema available
    /// to force them into a certain type.  Therefore the only types you will ever see as parameters are
    /// DBNull.Value, Int64, Double, String or byte[] array.
    /// </remarks>
    /// <param name="args">The arguments for the command to process</param>
    /// <returns>You may return most simple types as a return value, null or DBNull.Value to return null, DateTime, or
    /// you may return an Exception-derived class if you wish to return an error to SQLite.  Do not actually throw the error,
    /// just return it!</returns>
    public virtual object Invoke(object[] args)
    {
      return null;
    }

    /// <summary>
    /// Aggregate functions override this method to do their magic.
    /// </summary>
    /// <remarks>
    /// Typically you'll be updating whatever you've placed in the contextData field and returning as quickly as possible.
    /// </remarks>
    /// <param name="args">The arguments for the command to process</param>
    /// <param name="stepNumber">The 1-based step number.  This is incrememted each time the step method is called.</param>
    /// <param name="contextData">A placeholder for implementers to store contextual data pertaining to the current context.</param>
    public virtual void Step(object[] args, int stepNumber, ref object contextData)
    {
    }

    /// <summary>
    /// Aggregate functions override this method to finish their aggregate processing.
    /// </summary>
    /// <remarks>
    /// If you implemented your aggregate function properly,
    /// you've been recording and keeping track of your data in the contextData object provided, and now at this stage you should have
    /// all the information you need in there to figure out what to return.
    /// NOTE:  It is possible to arrive here without receiving a previous call to Step(), in which case the contextData will
    /// be null.  This can happen when no rows were returned.  You can either return null, or 0 or some other custom return value
    /// if that is the case.
    /// </remarks>
    /// <param name="contextData">Your own assigned contextData, provided for you so you can return your final results.</param>
    /// <returns>You may return most simple types as a return value, null or DBNull.Value to return null, DateTime, or
    /// you may return an Exception-derived class if you wish to return an error to SQLite.  Do not actually throw the error,
    /// just return it!
    /// </returns>
    public virtual object Final(object contextData)
    {
      return null;
    }

    /// <summary>
    /// User-defined collation sequences override this method to provide a custom string sorting algorithm.
    /// </summary>
    /// <param name="param1">The first string to compare</param>
    /// <param name="param2">The second strnig to compare</param>
    /// <returns>1 if param1 is greater than param2, 0 if they are equal, or -1 if param1 is less than param2</returns>
    public virtual int Compare(string param1, string param2)
    {
      return 0;
    }

    /// <summary>
    /// Converts an IntPtr array of context arguments to an object array containing the resolved parameters the pointers point to.
    /// </summary>
    /// <remarks>
    /// Parameters passed to functions have only an affinity for a certain data type, there is no underlying schema available
    /// to force them into a certain type.  Therefore the only types you will ever see as parameters are
    /// DBNull.Value, Int64, Double, String or byte[] array.
    /// </remarks>
    /// <param name="nArgs">The number of arguments</param>
    /// <param name="argsptr">A pointer to the array of arguments</param>
    /// <returns>An object array of the arguments once they've been converted to .NET values</returns>
    internal object[] ConvertParams(int nArgs, IntPtr argsptr)
    {
      object[] parms = new object[nArgs];
#if !PLATFORM_COMPACTFRAMEWORK
      IntPtr[] argint = new IntPtr[nArgs];
#else
      int[] argint = new int[nArgs];
#endif
      Marshal.Copy(argsptr, argint, 0, nArgs);

      for (int n = 0; n < nArgs; n++)
      {
        switch (_base.GetParamValueType((IntPtr)argint[n]))
        {
          case TypeAffinity.Null:
            parms[n] = DBNull.Value;
            break;
          case TypeAffinity.Int64:
            parms[n] = _base.GetParamValueInt64((IntPtr)argint[n]);
            break;
          case TypeAffinity.Double:
            parms[n] = _base.GetParamValueDouble((IntPtr)argint[n]);
            break;
          case TypeAffinity.Text:
            parms[n] = _base.GetParamValueText((IntPtr)argint[n]);
            break;
          case TypeAffinity.Blob:
            {
              int x;
              byte[] blob;

              x = (int)_base.GetParamValueBytes((IntPtr)argint[n], 0, null, 0, 0);
              blob = new byte[x];
              _base.GetParamValueBytes((IntPtr)argint[n], 0, blob, 0, x);
              parms[n] = blob;
            }
            break;
          case TypeAffinity.DateTime: // Never happens here but what the heck, maybe it will one day.
            parms[n] = _base.ToDateTime(_base.GetParamValueText((IntPtr)argint[n]));
            break;
        }
      }
      return parms;
    }

    /// <summary>
    /// Takes the return value from Invoke() and Final() and figures out how to return it to SQLite's context.
    /// </summary>
    /// <param name="context">The context the return value applies to</param>
    /// <param name="returnValue">The parameter to return to SQLite</param>
    void SetReturnValue(IntPtr context, object returnValue)
    {
      if (returnValue == null || returnValue == DBNull.Value)
      {
        _base.ReturnNull(context);
        return;
      }

      Type t = returnValue.GetType();
      if (t == typeof(DateTime))
      {
        _base.ReturnText(context, _base.ToString((DateTime)returnValue));
        return;
      }
      else
      {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美系列在线观看| 亚洲女同一区二区| 国产成人免费视频网站高清观看视频| 免费观看在线综合色| 亚洲无线码一区二区三区| 亚洲已满18点击进入久久| 亚洲精品v日韩精品| 一区二区三区高清不卡| 亚洲成人一区二区| 日韩avvvv在线播放| 美日韩一级片在线观看| 激情综合色丁香一区二区| 精品一区在线看| 国产suv精品一区二区6| 99re成人在线| 欧美精品在线观看一区二区| 欧美精品日韩一区| 久久嫩草精品久久久精品一| 国产欧美久久久精品影院| 国产精品美女一区二区三区 | 一区二区高清在线| 亚洲丰满少妇videoshd| 男女男精品视频| 国产大陆精品国产| 色素色在线综合| 精品久久人人做人人爱| 欧美经典一区二区三区| 一区二区三区在线视频免费| 日精品一区二区三区| 国产成人aaaa| 欧美在线影院一区二区| 精品免费视频.| 亚洲人成网站影音先锋播放| 老司机精品视频在线| av资源网一区| 日韩精品一区二区三区在线观看 | 91在线看国产| 日韩一区二区三区免费看 | 亚洲激情av在线| 美女性感视频久久| 一本色道久久加勒比精品| 8x8x8国产精品| 亚洲国产经典视频| 日韩电影网1区2区| 99精品桃花视频在线观看| 日韩午夜激情av| 亚洲激情自拍视频| 成人在线一区二区三区| 欧美一区二区三区婷婷月色 | 97se亚洲国产综合自在线不卡| av在线综合网| 欧美成va人片在线观看| 亚洲国产sm捆绑调教视频| 成人一二三区视频| 精品国精品自拍自在线| 亚洲高清不卡在线观看| 国产九色精品成人porny| 欧美久久一区二区| 亚洲欧美色一区| 国产成人av网站| 91精品国产色综合久久不卡蜜臀| 国产女主播一区| 国产成人8x视频一区二区| 欧美日韩www| 亚洲444eee在线观看| eeuss影院一区二区三区| 欧美亚洲综合另类| 亚洲国产综合色| 欧美性受极品xxxx喷水| 一区二区三区美女| 97精品国产97久久久久久久久久久久| 国产午夜精品美女毛片视频| 免费高清在线视频一区·| 欧美一级免费大片| 人妖欧美一区二区| 日韩欧美国产1| 国产综合一区二区| 国产亚洲精品bt天堂精选| 国产一区二区三区精品视频| 久久久久久一级片| 国产激情视频一区二区在线观看| 久久影音资源网| 成人天堂资源www在线| 亚洲视频一区二区免费在线观看| 99re这里都是精品| 亚洲不卡av一区二区三区| 宅男噜噜噜66一区二区66| 麻豆成人综合网| 国产日产欧产精品推荐色| 波多野结衣中文字幕一区二区三区| 国产精品久久免费看| 色偷偷成人一区二区三区91| 一区二区三区四区av| 欧美一区二区三区四区久久 | 国产欧美中文在线| 成a人片亚洲日本久久| 尤物在线观看一区| 在线91免费看| 成人深夜在线观看| 亚瑟在线精品视频| 久久精品男人天堂av| 色域天天综合网| 喷白浆一区二区| 中文字幕在线一区二区三区| 欧美羞羞免费网站| 国产一区二区三区黄视频| 亚洲男女一区二区三区| 日韩美女天天操| 色一情一乱一乱一91av| 精品在线你懂的| 亚洲欧美日韩国产另类专区| 日韩欧美一级二级三级| 97se亚洲国产综合自在线不卡 | 五月天精品一区二区三区| 久久精品一区四区| 欧美日韩精品一区二区三区 | 色婷婷av一区二区三区之一色屋| 日日夜夜一区二区| 国产精品福利一区| 欧美变态tickle挠乳网站| 色综合久久久网| 另类综合日韩欧美亚洲| 亚洲精品老司机| 国产欧美精品一区| 日韩精品影音先锋| 欧美日韩精品免费观看视频| 成人av免费在线| 狠狠v欧美v日韩v亚洲ⅴ| 亚洲国产成人va在线观看天堂| 国产欧美va欧美不卡在线| 日韩精品一区二区三区四区视频| 色狠狠桃花综合| av成人老司机| 国产高清久久久久| 狠狠狠色丁香婷婷综合激情| 日韩专区一卡二卡| 亚洲电影一区二区三区| 亚洲色图20p| 中文字幕人成不卡一区| 国产日韩一级二级三级| 精品粉嫩超白一线天av| 欧美一区二区观看视频| 欧美三级欧美一级| 欧美日韩一区二区三区四区| 色婷婷综合久久久| 欧美综合欧美视频| 欧美在线影院一区二区| 欧美亚洲国产一区二区三区 | 国产成人自拍网| 国产精品一区二区三区四区| 精品一区免费av| 国产在线视频一区二区三区| 另类的小说在线视频另类成人小视频在线 | 99久久精品国产一区二区三区| 国产毛片精品视频| 国产**成人网毛片九色| 国产乱国产乱300精品| 国产精品99久久久| 成人v精品蜜桃久久一区| 成人国产免费视频| 91国在线观看| 91精品国产福利| 日韩精品一区二区三区三区免费| 日韩女优视频免费观看| 久久精品人人做| 亚洲精品欧美在线| 青青草国产精品97视觉盛宴| 蜜臀久久99精品久久久久久9| 国内精品伊人久久久久av一坑| 国产精品一区二区你懂的| www.亚洲免费av| 欧美日韩国产小视频| 欧美一区二区三区视频| 日韩美一区二区三区| 欧美—级在线免费片| 亚洲欧美另类综合偷拍| 青青草原综合久久大伊人精品 | 免费久久99精品国产| 国产电影一区二区三区| 91美女在线看| 精品国产免费人成电影在线观看四季 | 日本 国产 欧美色综合| 成人永久免费视频| 欧美日韩一卡二卡| 久久精品夜夜夜夜久久| 亚洲va天堂va国产va久| 国产伦理精品不卡| 欧美日韩一本到| 欧美激情综合在线| 视频一区欧美精品| 成人免费视频一区二区| 91精品一区二区三区久久久久久| 国产清纯美女被跳蛋高潮一区二区久久w| 亚洲免费成人av| 黄一区二区三区| 欧美日韩综合在线| 国产精品传媒入口麻豆| 麻豆91在线看| 欧美日韩和欧美的一区二区| 久久九九久久九九|