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

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

?? 個人收集及編寫的一個通用函數集.pas

?? 個人收集及編寫的一個通用函數集
?? PAS
?? 第 1 頁 / 共 5 頁
字號:
end;


//The first thing to note here is that I am passing the SourceLength and FindLength
//As neither Source or Find will alter at any point during FastReplace there is
//no need to call the LENGTH subroutine each time !
function FastPos(const aSourceString, aFindString : String; const aSourceLen, aFindLen, StartPos : Integer) : Integer;
begin
  //If this assert failed, it is because you passed 0 for StartPos, lowest value is 1 !!
  Assert(StartPos > 0);
  
  Result := Integer(FastmemPos(aSourceString[StartPos], aFindString[1],aSourceLen - (StartPos-1), aFindLen));
  if Result > 0 then
    Result := Result - Integer(@aSourceString[1]) +1;
end;

function FastPosNoCase(const aSourceString, aFindString : String; const aSourceLen, aFindLen, StartPos : Integer) : Integer;
begin
  //If this assert failed, it is because you passed 0 for StartPos, lowest value is 1 !!
  Assert(StartPos > 0);

  Result := Integer(FastmemPosNC(aSourceString[StartPos], aFindString[1],aSourceLen - (StartPos-1), aFindLen));
  if Result > 0 then
    Result := Result - Integer(@aSourceString[1]) +1;
end;

function FastPosBack(const aSourceString, aFindString : String; const aSourceLen, aFindLen, StartPos : Integer) : Integer;
var
  SourceLen : Integer;
begin
  if aFindLen < 1 then begin
    Result := 0;
    exit;
  end;
  if aFindLen > aSourceLen then begin
    Result := 0;
    exit;
  end;

  if (StartPos = 0) or  (StartPos + aFindLen >= aSourceLen) then
    SourceLen := aSourceLen - (aFindLen-1)
  else
    SourceLen := StartPos;

  asm
          push ESI
          push EDI
          push EBX

          mov EDI, aSourceString
          add EDI, SourceLen
          Dec EDI

          mov ESI, aFindString
          mov ECX, SourceLen
          Mov  Al, [ESI]

    @ScaSB:
          cmp  Al, [EDI]
          jne  @NextChar

    @CompareStrings:
          mov  EBX, aFindLen
          dec  EBX
          jz   @FullMatch

    @CompareNext:
          mov  Ah, [ESI+EBX]
          cmp  Ah, [EDI+EBX]
          Jnz  @NextChar

    @Matches:
          Dec  EBX
          Jnz  @CompareNext

    @FullMatch:
          mov  EAX, EDI
          sub  EAX, aSourceString
          inc  EAX
          mov  Result, EAX
          jmp  @TheEnd
    @NextChar:
          dec  EDI
          dec  ECX
          jnz  @ScaSB

          mov  Result,0

    @TheEnd:
          pop  EBX
          pop  EDI
          pop  ESI
  end;
end;


function FastPosBackNoCase(const aSourceString, aFindString : String; const aSourceLen, aFindLen, StartPos : Integer) : Integer;
var
  SourceLen : Integer;
begin
  if aFindLen < 1 then begin
    Result := 0;
    exit;
  end;
  if aFindLen > aSourceLen then begin
    Result := 0;
    exit;
  end;

  if (StartPos = 0) or  (StartPos + aFindLen >= aSourceLen) then
    SourceLen := aSourceLen - (aFindLen-1)
  else
    SourceLen := StartPos;

  asm
          push ESI
          push EDI
          push EBX

          mov  EDI, aSourceString
          add  EDI, SourceLen
          Dec  EDI

          mov  ESI, aFindString
          mov  ECX, SourceLen

          mov  EDX, GUpcaseLUT
          xor  EBX, EBX

          mov  Bl, [ESI]
          mov  Al, [EDX+EBX]

    @ScaSB:
          mov  Bl, [EDI]
          cmp  Al, [EDX+EBX]
          jne  @NextChar

    @CompareStrings:
          PUSH ECX
          mov  ECX, aFindLen
          dec  ECX
          jz   @FullMatch

    @CompareNext:
          mov  Bl, [ESI+ECX]
          mov  Ah, [EDX+EBX]
          mov  Bl, [EDI+ECX]
          cmp  Ah, [EDX+EBX]
          Jz   @Matches

    //Go back to findind the first char
          POP  ECX
          Jmp  @NextChar

    @Matches:
          Dec  ECX
          Jnz  @CompareNext

    @FullMatch:
          POP  ECX

          mov  EAX, EDI
          sub  EAX, aSourceString
          inc  EAX
          mov  Result, EAX
          jmp  @TheEnd
    @NextChar:
          dec  EDI
          dec  ECX
          jnz  @ScaSB

          mov  Result,0

    @TheEnd:
          pop  EBX
          pop  EDI
          pop  ESI
  end;
end;

//My move is not as fast as MOVE when source and destination are both
//DWord aligned, but certainly faster when they are not.
//As we are moving characters in a string, it is not very likely at all that
//both source and destination are DWord aligned, so moving bytes avoids the
//cycle penality of reading/writing DWords across physical boundaries
procedure FastCharMove(const Source; var Dest; Count : Integer);
asm
//Note:  When this function is called, delphi passes the parameters as follows
//ECX = Count
//EAX = Const Source
//EDX = Var Dest

        //If no bytes to copy, just quit altogether, no point pushing registers
        cmp   ECX,0
        Je    @JustQuit

        //Preserve the critical delphi registers
        push  ESI
        push  EDI

        //move Source into ESI  (generally the SOURCE register)
        //move Dest into EDI (generally the DEST register for string commands)
        //This may not actually be neccessary, as I am not using MOVsb etc
        //I may be able just to use EAX and EDX, there may be a penalty for
        //not using ESI, EDI but I doubt it, this is another thing worth trying !
        mov   ESI, EAX
        mov   EDI, EDX

        //The following loop is the same as repNZ MovSB, but oddly quicker !
    @Loop:
        //Get the source byte
        Mov   AL, [ESI]
        //Point to next byte
        Inc   ESI
        //Put it into the Dest
        mov   [EDI], AL
        //Point dest to next position
        Inc   EDI
        //Dec ECX to note how many we have left to copy
        Dec   ECX
        //If ECX <> 0 then loop
        Jnz   @Loop

        //Another optimization note.
        //Many people like to do this

        //Mov AL, [ESI]
        //Mov [EDI], Al
        //Inc ESI
        //Inc ESI

        //There is a hidden problem here, I wont go into too much detail, but
        //the pentium can continue processing instructions while it is still
        //working out the desult of INC ESI or INC EDI
        //(almost like a multithreaded CPU)
        //if, however, you go to use them while they are still being calculated
        //the processor will stop until they are calculated (a penalty)
        //Therefore I alter ESI and EDI as far in advance as possible of using them

        //Pop the critical Delphi registers that we have altered
        pop   EDI
        pop   ESI
    @JustQuit:
end;

//Point 1
//I pass CONST aSourceString rather than just aSourceString
//This is because I will just be passed a pointer to the data
//rather than a 10mb copy of the data itself, much quicker !
function FastReplace(const aSourceString : String; const aFindString, aReplaceString : String;
   CaseSensitive : Boolean = False) : String;
var
  PResult                     : PChar;
  PReplace                    : PChar;
  PSource                     : PChar;
  PFind                       : PChar;
  PPosition                   : PChar;
  CurrentPos,
  BytesUsed,
  lResult,
  lReplace,
  lSource,
  lFind                       : Integer;
  Find                        : TFastPosProc;

  CopySize                    : Integer;
begin
  LSource := Length(aSourceString);
  if LSource = 0 then begin
    Result := aSourceString;
    exit;
  end;
  PSource := @aSourceString[1];

  LFind := Length(aFindString);
  if LFind = 0 then exit;
  PFind := @aFindString[1];

  LReplace := Length(aReplaceString);

  //Here we may get an Integer Overflow, or OutOfMemory, if so, we use a Delta

  try
    if LReplace <= LFind then
      SetLength(Result,lSource)
    else
      SetLength(Result, (LSource *LReplace) div  LFind);
  except
    SetLength(Result,0);
  end;

  LResult := Length(Result);
  if LResult = 0 then begin
    LResult := Trunc((LSource + LReplace) * cDeltaSize);
    SetLength(Result, LResult);
  end;


  PResult := @Result[1];


  if CaseSensitive then
    Find := FastmemPos
  else
    Find := FastmemPosNC;


  if LReplace > 0 then begin
    BytesUsed := 0;
    PReplace := @aReplaceString[1];
    repeat
      PPosition := Find(PSource^,PFind^,lSource, lFind);
      if PPosition = nil then break;

      CopySize := PPosition - PSource;
      Inc(BytesUsed, CopySize + LReplace);

      if BytesUsed >= LResult then begin
        //We have run out of space
        CurrentPos := Integer(PResult) - Integer(@Result[1]) +1;
        LResult := Trunc(LResult * cDeltaSize);
        SetLength(Result,LResult);
        PResult := @Result[CurrentPos];
      end;

      FastCharMove(PSource^,PResult^,CopySize);
      Dec(lSource,CopySize + LFind);
      Inc(PSource,CopySize + LFind);
      Inc(PResult,CopySize);

      FastCharMove(PReplace^,PResult^,LReplace);
      Inc(PResult,LReplace);

    until lSource < lFind;
  end else begin
    repeat
      PPosition := Find(PSource^,PFind^,lSource, lFind);
      if PPosition = nil then break;

      CopySize := PPosition - PSource;
      FastCharMove(PSource^,PResult^,CopySize);
      Dec(lSource,CopySize + LFind);
      Inc(PSource,CopySize + LFind);
      Inc(PResult,CopySize);

    until lSource < lFind;
  end;

  FastCharMove(PSource^,PResult^,LSource);
  SetLength(Result, (PResult+LSource) - @Result[1]);
end;

function SmartPos(const SearchStr,SourceStr : String;
                  const CaseSensitive : Boolean = TRUE;
                  const StartPos : Integer = 1;
                  const ForwardSearch : Boolean = TRUE) : Integer;
begin
  // NOTE:  When using StartPos, the returned value is absolute!
  if (CaseSensitive) then
    if (ForwardSearch) then
      Result:=
        FastPos(SourceStr,SearchStr,Length(SourceStr),Length(SearchStr),StartPos)
    else
      Result:=
        FastPosBack(SourceStr,SearchStr,Length(SourceStr),Length(SearchStr),StartPos)
  else
    if (ForwardSearch) then
      Result:=
        FastPosNoCase(SourceStr,SearchStr,Length(SourceStr),Length(SearchStr),StartPos)
    else
      Result:=
        FastPosBackNoCase(SourceStr,SearchStr,Length(SourceStr),Length(SearchStr),StartPos)
end;

var
  I: Integer;

const
  cKey1 = 52845;
  cKey2 = 22719;

function StripHTMLorNonHTML(S : String; WantHTML : Boolean) : String; forward;

//Encrypt a string
function Encrypt(const S: String; Key: Word): String;
var
I: byte;
begin
 SetLength(result,length(s));
 for I := 1 to Length(S) do
    begin
        Result[I] := char(byte(S[I]) xor (Key shr 8));
        Key := (byte(Result[I]) + Key) * cKey1 + cKey2;
    end;
end;

//Return only the HTML of a string
function ExtractHTML(S : String) : String;
begin
  Result := StripHTMLorNonHTML(S,True);
end;

function CopyStr(const aSourceString : String; aStart, aLength : Integer) : String;
var
  L: Integer;
begin
  L := Length(aSourceString);
  if L=0 then exit;

  if aStart + (aLength-1) > L then aLength := L - (aStart-1);

  if (aStart <1) then exit;

  SetLength(Result,aLength);
  FastCharMove(aSourceString[aStart], Result[1], aLength);
end;

//Take all HTML out of a string
function ExtractNonHTML(S : String) : String;
begin
  Result := StripHTMLorNonHTML(S,False);
end;

//Decrypt a string encoded with Encrypt
function Decrypt(const S: String; Key: Word): String;
var
I: byte;
begin
 SetLength(result,length(s));
 for I := 1 to Length(S) do
    begin
        Result[I] := char(byte(S[I]) xor (Key shr 8));
        Key := (byte(S[I]) + Key) * cKey1 + cKey2;
    end;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
1000部国产精品成人观看| 欧美伦理电影网| 五月婷婷激情综合网| 精品剧情v国产在线观看在线| 99久久免费视频.com| 日本免费在线视频不卡一不卡二| 国产精品美日韩| 精品理论电影在线| 欧美日韩激情在线| 99久久精品国产一区| 国产一区二区三区在线观看免费视频 | 91久久精品午夜一区二区| 久久电影国产免费久久电影| 一区二区三区在线免费| 国产欧美日韩视频一区二区| 欧美一区午夜视频在线观看 | 成人国产精品免费观看动漫| 男男视频亚洲欧美| 亚洲一区av在线| 亚洲女同一区二区| 国产精品毛片大码女人| 精品系列免费在线观看| 亚洲女同女同女同女同女同69| 久久久精品欧美丰满| 在线成人免费视频| 在线观看视频一区| 国产精品中文有码| 亚洲精品国久久99热| 欧美日韩亚洲高清一区二区| 欧美高清视频不卡网| 国产成+人+日韩+欧美+亚洲| 伊人性伊人情综合网| 亚洲国产激情av| 久久青草国产手机看片福利盒子 | 99久久免费视频.com| 国产一区二区0| 久草热8精品视频在线观看| 午夜电影久久久| 亚洲国产精品久久久男人的天堂| 1024国产精品| 亚洲欧美国产高清| 亚洲丝袜另类动漫二区| 最新热久久免费视频| 成人免费在线视频观看| 国产精品入口麻豆九色| 国产精品污污网站在线观看| 国产欧美日产一区| 亚洲国产精品av| 国产精品久久久久国产精品日日| 中文天堂在线一区| 亚洲视频电影在线| 亚洲一区二区三区激情| 亚洲一区中文日韩| 日韩精品免费专区| 久久激五月天综合精品| 国产资源在线一区| 成人网页在线观看| 91丝袜高跟美女视频| 欧美三级视频在线观看| 91麻豆精品国产91久久久久久久久 | 国产乱子伦视频一区二区三区 | 亚洲444eee在线观看| 天堂久久久久va久久久久| 久久精品国产一区二区| 丰满白嫩尤物一区二区| 91麻豆精品秘密| 欧美日韩一区二区三区在线看| 91麻豆精品国产91久久久使用方法| 欧美不卡123| 中文无字幕一区二区三区| 一区二区三区四区在线播放| 天天亚洲美女在线视频| 国产在线乱码一区二区三区| 不卡欧美aaaaa| 欧美人伦禁忌dvd放荡欲情| 日韩欧美在线影院| 国产精品久久久久久亚洲伦| 亚洲一二三四在线| 精品一区二区久久久| 3d成人动漫网站| 国产日韩亚洲欧美综合| 国产精品盗摄一区二区三区| 亚洲第一电影网| 韩国三级在线一区| 91极品视觉盛宴| 欧美大度的电影原声| 国产精品免费视频网站| 日韩激情一二三区| 高清不卡一区二区在线| 欧美日韩一区高清| 久久精品免视看| 亚洲国产成人av网| 国产91清纯白嫩初高中在线观看| 在线亚洲免费视频| 国产网红主播福利一区二区| 亚洲一区二区三区四区不卡| 国产麻豆精品在线观看| 欧美日韩午夜在线视频| 久久精品人人爽人人爽| 天涯成人国产亚洲精品一区av| 豆国产96在线|亚洲| 91精品在线观看入口| 亚洲欧美国产77777| 国产一区二区三区黄视频 | 一个色综合网站| 国产精品911| 欧美一区二区视频观看视频| 亚洲欧美在线观看| 国产麻豆成人传媒免费观看| 欧美日韩国产欧美日美国产精品| 国产精品人成在线观看免费 | 久久成人久久爱| 欧美丝袜丝nylons| 中文字幕一区日韩精品欧美| 精品系列免费在线观看| 欧美巨大另类极品videosbest| 国产精品超碰97尤物18| 国产精品一区在线观看你懂的| 91精品国产91久久久久久一区二区| 亚洲欧美日韩国产中文在线| 国产高清亚洲一区| 精品少妇一区二区三区在线播放| 亚洲成在线观看| 色网站国产精品| 自拍偷拍欧美激情| 国产成人精品午夜视频免费| 精品日韩一区二区三区免费视频| 亚洲国产cao| 色成年激情久久综合| 亚洲欧洲精品一区二区精品久久久| 国产一区二区h| 亚洲精品一区二区三区福利| 久久aⅴ国产欧美74aaa| 欧美一区二区三区精品| 婷婷国产在线综合| 欧美性大战久久久久久久| 亚洲精品亚洲人成人网在线播放| 99精品欧美一区二区三区小说| 日本一区二区电影| 波多野结衣中文字幕一区| 国产精品久久久久久久裸模| 成人av免费在线| 日韩毛片在线免费观看| 色偷偷久久一区二区三区| 亚洲精品videosex极品| 欧美吻胸吃奶大尺度电影| 亚洲一二三四区不卡| 欧美日韩电影在线播放| 天天色天天操综合| 日韩区在线观看| 国产乱妇无码大片在线观看| 国产亚洲欧美在线| www.99精品| 夜夜嗨av一区二区三区四季av| 欧美日韩免费高清一区色橹橹| 亚洲高清在线视频| 日韩一区二区三区三四区视频在线观看| 亚洲电影一级片| 日韩三区在线观看| 国产精品 日产精品 欧美精品| 中文字幕精品—区二区四季| 91碰在线视频| 午夜久久久久久久久久一区二区| 91精品国产一区二区| 黑人巨大精品欧美黑白配亚洲| 国产丝袜美腿一区二区三区| 99精品国产视频| 午夜激情一区二区| 精品国产乱码久久久久久蜜臀| 福利91精品一区二区三区| 一区二区三区久久| 亚洲卡通欧美制服中文| 欧美喷潮久久久xxxxx| 激情久久五月天| 亚洲视频一二三区| 欧美一区二区三区啪啪| 丁香激情综合国产| 亚洲高清视频的网址| 久久综合久久综合九色| 91福利小视频| 久久成人麻豆午夜电影| 亚洲精选免费视频| 91精品国产黑色紧身裤美女| www.欧美精品一二区| 日本不卡一二三| 国产精品久久久久精k8| 欧美一级片在线| 99v久久综合狠狠综合久久| 日韩精品色哟哟| 亚洲欧美区自拍先锋| 精品av综合导航| 欧美视频在线一区二区三区| 国产精一品亚洲二区在线视频| 亚洲一区二区高清| 欧美国产成人在线| 91精品一区二区三区久久久久久| 懂色av一区二区在线播放| 美女一区二区视频| 一区二区三区不卡视频| 国产精品天美传媒|