亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
国产在线乱码一区二区三区| 亚洲精品高清在线观看| 成人精品小蝌蚪| 亚洲柠檬福利资源导航| 欧美日韩一区成人| 久久国产精品99精品国产| 国产精品久久影院| 欧美性感一类影片在线播放| 天堂在线一区二区| 日本一区二区三区四区在线视频 | 成人精品国产免费网站| 一区二区三区在线免费播放| 欧美电影免费提供在线观看| 91亚洲资源网| 韩国视频一区二区| 夜夜亚洲天天久久| 国产亚洲综合在线| 777午夜精品视频在线播放| 成人性生交大片免费| 日韩国产欧美在线观看| 国产精品福利一区二区三区| 在线不卡一区二区| 99re亚洲国产精品| 激情综合色播激情啊| 亚洲国产日产av| 中文字幕一区日韩精品欧美| 日韩精品最新网址| 欧美色综合久久| 9l国产精品久久久久麻豆| 欧美艳星brazzers| 91精品国产色综合久久| 日韩免费看的电影| 久久精品国产澳门| 天天操天天色综合| 中文字幕一区免费在线观看| 精品视频999| 色综合网站在线| 国产成人激情av| 美女在线观看视频一区二区| 亚洲一区二区三区中文字幕在线| 中文字幕精品三区| 7777精品伊人久久久大香线蕉| 色综合久久中文字幕| 大尺度一区二区| 久久se这里有精品| 日韩激情一二三区| 午夜视频一区在线观看| 亚洲三级免费电影| 国产欧美一区二区精品性色超碰 | 欧美美女黄视频| 国产成a人亚洲精品| 国产精品资源在线观看| 另类小说色综合网站| 亚洲精品乱码久久久久久黑人| 亚洲欧洲成人精品av97| 国产精品免费网站在线观看| 久久美女高清视频| 精品99999| 久久久蜜臀国产一区二区| 日韩视频免费观看高清完整版在线观看| 欧美三级一区二区| 欧美色图天堂网| 欧美男女性生活在线直播观看| 国产伦精品一区二区三区免费迷| 国产精品久久久久国产精品日日| 欧美韩日一区二区三区| 国产欧美一区二区精品性色超碰| 日本一区二区视频在线| 久久久精品一品道一区| 日本一区二区三区在线观看| 中文字幕精品一区二区三区精品| 国产精品福利av | 国产欧美精品一区aⅴ影院 | 国产一区二区调教| 国产高清精品网站| 国产福利一区在线| 99re视频这里只有精品| 在线免费亚洲电影| 欧美日韩国产一级片| 日韩一级高清毛片| 国产色综合久久| 久久这里都是精品| 国产精品久久久久久久久免费樱桃 | 久久精品亚洲精品国产欧美kt∨ | 亚洲精品菠萝久久久久久久| 亚洲午夜电影在线| 亚洲福利一二三区| 精品中文字幕一区二区| 国产在线视视频有精品| 成人av网址在线| 在线观看日产精品| 99久久婷婷国产综合精品| 欧美亚洲动漫制服丝袜| 欧美精品色一区二区三区| 91麻豆精品久久久久蜜臀| 老司机精品视频在线| 国产91精品精华液一区二区三区 | 在线观看网站黄不卡| 精品处破学生在线二十三| 一区二区三区小说| 国产成人亚洲综合a∨猫咪| 欧美高清hd18日本| 亚洲欧美视频在线观看| 狠狠狠色丁香婷婷综合激情| 欧美日韩一本到| 国产精品精品国产色婷婷| 久久99久国产精品黄毛片色诱| 在线观看日韩av先锋影音电影院| 亚洲国产精华液网站w| 日韩高清不卡一区二区| 一本大道久久a久久精二百| 欧美激情一区二区三区| 麻豆成人免费电影| 欧美伦理影视网| 亚洲最新在线观看| 91网站在线播放| 中文字幕高清一区| 国产一二三精品| 欧美大胆一级视频| 日日摸夜夜添夜夜添国产精品| 色欲综合视频天天天| 国产精品人人做人人爽人人添| 裸体在线国模精品偷拍| 91麻豆精品国产91久久久资源速度 | 日韩亚洲欧美一区| 亚洲国产成人高清精品| 日本道精品一区二区三区| 中文字幕亚洲欧美在线不卡| 国产经典欧美精品| 国产欧美日韩综合| 成人国产亚洲欧美成人综合网| 久久久久成人黄色影片| 国产一区啦啦啦在线观看| 精品国产一区二区亚洲人成毛片 | 欧美日韩一级大片网址| 亚洲一区二区三区在线播放| 日本电影欧美片| 一区二区三区色| 在线免费观看日本一区| 亚洲狠狠丁香婷婷综合久久久| 色综合久久99| 亚洲香蕉伊在人在线观| 欧美日韩不卡视频| 日本欧美大码aⅴ在线播放| 欧美一区二区三区不卡| 久久精品理论片| 久久久国产午夜精品| 成人精品亚洲人成在线| 亚洲女人的天堂| 欧美午夜免费电影| 奇米色一区二区| xfplay精品久久| 成人国产精品视频| 亚洲欧美色一区| 欧美高清视频不卡网| 久久精品国产**网站演员| 国产午夜三级一区二区三| 99久久精品国产导航| 亚洲国产你懂的| 精品国产自在久精品国产| 风间由美一区二区av101| 综合电影一区二区三区| 欧美精品日日鲁夜夜添| 国产剧情一区二区| 亚洲美女电影在线| 91精品久久久久久久91蜜桃| 国产美女av一区二区三区| 中文字幕一区免费在线观看| 欧美日韩国产高清一区二区| 精品一区二区久久| 亚洲三级在线免费观看| 欧美精品三级日韩久久| 国产91丝袜在线18| 亚洲va韩国va欧美va精品 | 国产精品美女久久久久aⅴ国产馆| 色一情一伦一子一伦一区| 日韩二区在线观看| 国产欧美一区二区三区在线老狼| 欧美亚洲图片小说| 黑人巨大精品欧美黑白配亚洲| 中文字幕中文字幕一区二区| 欧美日韩国产乱码电影| 国产精品自拍三区| 亚洲综合一区二区| 精品久久一二三区| 91小视频免费看| 免费成人在线视频观看| 国产精品久久久久久久久免费丝袜| 精品视频999| 成人高清在线视频| 奇米888四色在线精品| 亚洲国产高清在线观看视频| 欧美精品日日鲁夜夜添| 99精品欧美一区二区三区小说| 美腿丝袜亚洲三区| 一区二区三区免费| 国产日韩综合av| 日韩女优av电影| 欧洲另类一二三四区| 成人动漫av在线|