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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? idheaderlist.pas

?? delphi indy9.0.18組件包
?? PAS
字號(hào):
{ $HDR$}
{**********************************************************************}
{ Unit archived using Team Coherence                                   }
{ Team Coherence is Copyright 2002 by Quality Software Components      }
{                                                                      }
{ For further information / comments, visit our WEB site at            }
{ http://www.TeamCoherence.com                                         }
{**********************************************************************}
{}
{ $Log:  10185: IdHeaderList.pas 
{
{   Rev 1.1    2/25/2003 12:47:34 PM  JPMugaas
{ Updated with Hadi's fix.  If complete boolean evaluation was on, the code
{ could sometimes with an index out of range.
}
{
{   Rev 1.0    2002.11.12 10:40:38 PM  czhower
}
unit IdHeaderList;

{
 2002-Jan-27 Don Siders
  - Modified FoldLine to include Comma in break character set.

 2000-May-31 J. Peter Mugaas
  - started this class to facilitate some work on Indy so we don't have to
    convert '=' to ":" and vice-versa just to use the Values property.
  }

{
 NOTE:  This is a modification of Borland's TStrings definition in a
        TStringList descendant.  I had to conceal the original Values to do
        this since most of low level property setting routines aren't virtual   
        and are private.
}

interface

uses
  Classes;

type
  TIdHeaderList = class(TStringList)
  protected
    FNameValueSeparator : String;
    FCaseSensitive : Boolean;
    FUnfoldLines : Boolean;
    FFoldLines : Boolean;
    FFoldLinesLength : Integer;
    //
    {This deletes lines which were folded}
    Procedure DeleteFoldedLines(Index : Integer);
    {This folds one line into several lines}
    function FoldLine(AString : string) : TStringList;
    {Folds lines and inserts them into a position, Index}
    procedure FoldAndInsert(AString : String; Index : Integer);
    {Name property get method}
    function GetName(Index: Integer): string;
    {Value property get method}
    function GetValue(const AName: string): string;
    {Value property set method}
    procedure SetValue(const Name, Value: string);
    {Gets a value from a string}
    function GetValueFromLine(ALine : Integer) : String;
    Function GetNameFromLine(ALine : Integer) : String;
  public
    procedure AddStdValues(ASrc: TStrings);
    procedure ConvertToStdValues(ADest: TStrings);
    constructor Create;
    { This method  given a name specified by AName extracts all of the values for that name - and puts them in a new string
    list (just the values) one per line in the ADest TStrings.}
    procedure Extract(const AName: string; ADest: TStrings);
    { This property works almost exactly as Borland's IndexOfName except it uses
      our deliniator defined in NameValueSeparator }
    function IndexOfName(const AName: string): Integer; reintroduce;
    { This property works almost exactly as Borland's Values except it uses
      our deliniator defined in NameValueSeparator }
    property Names[Index: Integer]: string read GetName;
    { This property works almost exactly as Borland's Values except it uses   
      our deliniator defined in NameValueSeparator }
    property Values[const Name: string]: string read GetValue write SetValue;
    { This is the separator we need to separate the name from the value }
    property NameValueSeparator : String read FNameValueSeparator
      write FNameValueSeparator;
    { Should the names be tested in a case-senstive manner. }
    property CaseSensitive : Boolean read FCaseSensitive write FCaseSensitive;
    { Should we unfold lines so that continuation header data is returned as
    well}
    property UnfoldLines : Boolean read FUnfoldLines write FUnfoldLines;
    { Should we fold lines we the Values(x) property is set with an
    assignment }
    property FoldLines : Boolean read FFoldLines write FFoldLines;
    { The Wrap position for our folded lines }
    property FoldLength : Integer read FFoldLinesLength write FFoldLinesLength;
  end;

implementation

uses
  IdGlobal,
  SysUtils;

{This is taken from Borland's SysUtils and modified for our folding}    {Do not Localize}
function FoldWrapText(const Line, BreakStr: string; BreakChars: TSysCharSet;
  MaxCol: Integer): string;
const
  QuoteChars = ['"'];    {Do not Localize}
var
  Col, Pos: Integer;
  LinePos, LineLen: Integer;
  BreakLen, BreakPos: Integer;
  QuoteChar, CurChar: Char;
  ExistingBreak: Boolean;
begin
  Col := 1;
  Pos := 1;
  LinePos := 1;
  BreakPos := 0;
  QuoteChar := ' ';    {Do not Localize}
  ExistingBreak := False;
  LineLen := Length(Line);
  BreakLen := Length(BreakStr);
  Result := '';    {Do not Localize}
  while Pos <= LineLen do
  begin
    CurChar := Line[Pos];
    if CurChar in LeadBytes then
    begin
      Inc(Pos);
      Inc(Col);
    end  //if CurChar in LeadBytes then
    else
      if CurChar = BreakStr[1] then
      begin
        if QuoteChar = ' ' then    {Do not Localize}
        begin
          ExistingBreak := AnsiSameText(BreakStr, Copy(Line, Pos, BreakLen));
          if ExistingBreak then
          begin
            Inc(Pos, BreakLen-1);
            BreakPos := Pos;
          end; //if ExistingBreak then
        end // if QuoteChar = ' ' then    {Do not Localize}
      end // if CurChar = BreakStr[1] then
      else
        if CurChar in BreakChars then
        begin
          if QuoteChar = ' ' then    {Do not Localize}
            BreakPos := Pos
        end  // if CurChar in BreakChars then
        else
        if CurChar in QuoteChars then
          if CurChar = QuoteChar then
            QuoteChar := ' '    {Do not Localize}
          else
            if QuoteChar = ' ' then    {Do not Localize}
              QuoteChar := CurChar;
    Inc(Pos);
    Inc(Col);
    if not (QuoteChar in QuoteChars) and (ExistingBreak or
      ((Col > MaxCol) and (BreakPos > LinePos))) then
    begin
      Col := Pos - BreakPos;
      Result := Result + Copy(Line, LinePos, BreakPos - LinePos + 1);
      if not (CurChar in QuoteChars) then
        while (Pos <= LineLen) and (Line[Pos] in BreakChars + [#13, #10]) do Inc(Pos);
      if not ExistingBreak and (Pos < LineLen) then
        Result := Result + BreakStr;
      Inc(BreakPos);
      LinePos := BreakPos;
      ExistingBreak := False;
    end; //if not
  end; //while Pos <= LineLen do
  Result := Result + Copy(Line, LinePos, MaxInt);
end;

{ TIdHeaderList }

procedure TIdHeaderList.AddStdValues(ASrc: TStrings);
var
  i: integer;
begin
  for i := 0 to ASrc.Count - 1 do begin
    Add(StringReplace(ASrc[i], '=', NameValueSeparator, []));    {Do not Localize}
  end;
end;

procedure TIdHeaderList.ConvertToStdValues(ADest: TStrings);
var
  i: integer;
begin
  for i := 0 to Count - 1 do begin
    ADest.Add(StringReplace(Strings[i], NameValueSeparator, '=', []));    {Do not Localize}
  end;
end;

constructor TIdHeaderList.Create;
begin
  inherited Create;
  FNameValueSeparator := ': ';    {Do not Localize}
  FCaseSensitive := False;
  FUnfoldLines := True;
  FFoldLines := True;
  { 78 was specified by a message draft available at
    http://www.imc.org/draft-ietf-drums-msg-fmt }
  FFoldLinesLength := 78;
end;

procedure TIdHeaderList.DeleteFoldedLines(Index: Integer);
begin
  Inc(Index);  {skip the current line}
  if Index < Count then begin
    while ( Index < Count ) and ( ( Length( Get( Index ) ) > 0) and
     (  Get( Index ) [ 1 ] = ' ' ) or (  Get( Index ) [ 1 ] = #9 ) ) do    {Do not Localize}
    begin
      Delete( Index );
    end; //while
  end;
end;

procedure TIdHeaderList.Extract(const AName: string; ADest: TStrings);
var idx : Integer;
begin
  if not Assigned(ADest) then
    Exit;
  for idx := 0 to Count - 1 do
  begin
    if AnsiSameText(AName, GetNameFromLine(idx)) then
    begin
      ADest.Add(GetValueFromLine(idx));
    end;
  end;
end;

procedure TIdHeaderList.FoldAndInsert(AString : String; Index: Integer);
var strs : TStringList;
    idx : Integer;
begin
  strs := FoldLine( AString );
  try
    idx :=  strs.Count - 1;
    Put(Index, strs [ idx ] );
    {We decrement by one because we put the last string into the HeaderList}
    Dec( idx );
    while ( idx > -1 ) do
    begin
      Insert(Index, strs [ idx ] );
      Dec( idx );
    end;
  finally
    FreeAndNil( strs );
  end;  //finally
end;

function TIdHeaderList.FoldLine(AString : string): TStringList;
var s : String;
begin
  Result := TStringList.Create;
  try
    {we specify a space so that starts a folded line}
    s := FoldWrapText(AString, EOL+' ', LWS+[','], FFoldLinesLength);    {Do not Localize}
    while s <> '' do    {Do not Localize}
    begin
      Result.Add( TrimRight( Fetch( s, EOL ) ) );
    end; // while s <> '' do    {Do not Localize}
  finally
  end; //try..finally
end;

function TIdHeaderList.GetName(Index: Integer): string;
var
  P: Integer;
begin
  Result := Get( Index );
  P := IndyPos( FNameValueSeparator , Result );
  if P <> 0 then
  begin
    SetLength( Result, P - 1 );
  end  // if P <> 0 then
  else
  begin
    SetLength( Result, 0 );
  end;  // else if P <> 0 then
  Result := Result;
end;

function TIdHeaderList.GetNameFromLine(ALine: Integer): String;
var p : Integer;
begin
  Result := Get( ALine );
  if not FCaseSensitive then
  begin
    Result := UpperCase( Result );
  end; // if not FCaseSensitive then
  {We trim right to remove space to accomodate header errors such as

  Message-ID:<asdf@fdfs
  }
  P := IndyPos( TrimRight( FNameValueSeparator ), Result );
  Result := Copy( Result, 1, P - 1 );
end;

function TIdHeaderList.GetValue(const AName: string): string;
begin
  Result := GetValueFromLine(IndexOfName(AName));
end;

function TIdHeaderList.GetValueFromLine(ALine: Integer): String;
var
  LFoldedLine: string;
  LName: string;
begin
  if (ALine >= 0) and (ALine < Count) then begin
    LName := GetNameFromLine(ALine);
    Result := Copy(Get(ALine), Length(LName) + 2, MaxInt);
    if FUnfoldLines then begin
      while True do begin
        Inc(ALine);
        if ALine = Count then begin
          Break;
        end;
        LFoldedLine := Get(ALine);
        // s[1] is safe since header lines cannot be empty as that causes then end of the header block
        if not (LFoldedLine[1] in LWS) then begin
          Break;
        end;
        Result := Trim(Result) + ' ' + Trim(LFoldedLine); {Do not Localize}
      end;
    end;
  end else begin
    Result := ''; {Do not Localize}
  end;
  // User may be fetching an folded line diretly.
  Result := Trim(Result);
end;

function TIdHeaderList.IndexOfName(const AName: string): Integer;
var
  i: Integer;
begin
  Result := -1;
  for i := 0 to Count - 1 do begin
    if AnsiSameText(GetNameFromLine(i), AName) then begin
      Result := i;
      Break;
    end;
  end;
end;

procedure TIdHeaderList.SetValue(const Name, Value: string);
var
  I: Integer;
begin
  I := IndexOfName(Name);
  if Value <> '' then    {Do not Localize}
  begin
    if I < 0 then
    begin
      I := Add( '' );    {Do not Localize}
    end; //if I < 0 then
    if FFoldLines then
    begin
      DeleteFoldedLines( I );
      FoldAndInsert( Name + FNameValueSeparator + Value, I );
    end
    else
    begin
      Put( I, Name + FNameValueSeparator + Value );
    end;  //else..FFoldLines
  end //if Value <> '' then    {Do not Localize}
  else
  begin
    if I >= 0 then
    begin
      if FFoldLines then
      begin
        DeleteFoldedLines( I );
      end;
      Delete( I );
    end; //if I >= 0 then
  end;  //else .. if Value <> '' then    {Do not Localize}
end;

end.

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产91精品久久久久久久网曝门| www日韩大片| 麻豆精品精品国产自在97香蕉| 色婷婷综合久久久中文字幕| 日本亚洲三级在线| 国产精品你懂的| 欧美一区二区三区免费大片| bt7086福利一区国产| 久久99国产精品久久99| 午夜精品久久久久久不卡8050| 欧美二区三区91| 成人app在线观看| 久草这里只有精品视频| 亚洲丶国产丶欧美一区二区三区| 91成人在线精品| 国产不卡视频一区二区三区| 日韩中文字幕亚洲一区二区va在线| 欧美丰满嫩嫩电影| 99久久精品国产一区二区三区| 日韩美女啊v在线免费观看| 久久亚洲一区二区三区四区| 9191成人精品久久| 色88888久久久久久影院野外 | 午夜欧美视频在线观看| 国产精品久久久久久久岛一牛影视| 99vv1com这只有精品| 国产精品资源在线观看| 麻豆精品一区二区三区| 天堂成人免费av电影一区| 亚洲精品成a人| 亚洲欧美激情插| 欧美国产97人人爽人人喊| 久久久久久影视| 国产午夜亚洲精品羞羞网站| 精品国产sm最大网站免费看| 欧美成人a∨高清免费观看| 欧美一级专区免费大片| 欧美一区二区在线免费播放| 在线综合亚洲欧美在线视频| 欧美嫩在线观看| 69p69国产精品| 日韩精品一区二区三区在线播放 | 中文字幕 久热精品 视频在线 | 蜜臀av在线播放一区二区三区| 国产日韩综合av| 欧美激情中文字幕| 欧美国产日本韩| 国产精品视频线看| 亚洲人成小说网站色在线| 亚洲黄色在线视频| 亚洲国产精品一区二区久久恐怖片 | 国产一区二区伦理片| 国产在线不卡一区| 国产精华液一区二区三区| 国产成人av电影在线观看| 国产不卡在线视频| 成人免费不卡视频| 色婷婷综合中文久久一本| 欧美亚洲图片小说| 9191久久久久久久久久久| 日韩欧美国产综合| 欧美经典一区二区三区| 国产精品久久久久久久久动漫| 精品免费99久久| 久久精品视频免费观看| 亚洲桃色在线一区| 午夜精品久久久久久| 国产一区91精品张津瑜| 97精品久久久久中文字幕 | 久久久久国产免费免费| 久久久精品欧美丰满| 亚洲欧洲日韩在线| 丝袜美腿亚洲综合| 国产一区二区按摩在线观看| 99麻豆久久久国产精品免费| 欧美日韩综合一区| 欧美精品一区二区三区高清aⅴ| 在线播放欧美女士性生活| 精品第一国产综合精品aⅴ| 欧美激情在线看| 亚洲一区二区在线免费看| 加勒比av一区二区| 欧美在线免费观看亚洲| 久久综合久久综合亚洲| 亚洲影视在线播放| 国产盗摄一区二区三区| 欧美唯美清纯偷拍| 国产欧美综合在线观看第十页| 26uuu另类欧美亚洲曰本| 亚洲精品高清在线观看| 韩国女主播一区| 欧美另类高清zo欧美| 国产亚洲午夜高清国产拍精品| 337p粉嫩大胆色噜噜噜噜亚洲| 日韩一级大片在线| 亚洲精品国产第一综合99久久| 亚洲蜜臀av乱码久久精品| 美国毛片一区二区| 色综合天天做天天爱| 久久一夜天堂av一区二区三区| 亚洲精品一区二区三区精华液 | 日本vs亚洲vs韩国一区三区| 成人性生交大片免费看在线播放| 国产经典欧美精品| 日韩美女在线视频| 亚洲免费伊人电影| 国产91在线|亚洲| 日韩欧美在线1卡| 午夜私人影院久久久久| 92精品国产成人观看免费| 久久久.com| 麻豆传媒一区二区三区| 欧美日韩不卡视频| 亚洲精品福利视频网站| 99综合影院在线| 欧美激情综合五月色丁香小说| 亚洲丝袜另类动漫二区| 国模娜娜一区二区三区| 欧美一区二区国产| 亚洲观看高清完整版在线观看| 裸体一区二区三区| 欧美精品成人一区二区三区四区| 日韩区在线观看| 日韩综合一区二区| 欧美久久婷婷综合色| 亚洲国产精品久久不卡毛片 | 欧美日韩精品一区二区在线播放| 9191国产精品| 丝袜诱惑制服诱惑色一区在线观看| 九九热在线视频观看这里只有精品| 国产成人免费在线| 国产亚洲精品超碰| 国产一区二区福利视频| 精品国产自在久精品国产| 秋霞影院一区二区| 欧美一区二区美女| 蜜桃视频在线观看一区| 欧美成人女星排名| 国产一区二区三区观看| 欧美精品一区二区三区在线| 国产一区二区不卡老阿姨| 久久精子c满五个校花| 国产69精品久久777的优势| 国产日韩一级二级三级| 成人综合在线观看| 日韩理论片中文av| 在线视频中文字幕一区二区| 亚洲午夜三级在线| 欧美美女一区二区三区| 免费观看在线色综合| 精品国产乱码久久久久久老虎| 一区二区三区在线免费播放| 欧美性猛交xxxxxx富婆| 天天色天天爱天天射综合| 欧美一级黄色录像| 国产福利不卡视频| 国产精品嫩草99a| 欧洲人成人精品| 日韩精品亚洲专区| 久久男人中文字幕资源站| 99久久国产综合精品色伊| 亚洲一区成人在线| 日韩欧美国产精品| 成人深夜视频在线观看| 成人免费在线观看入口| 欧美精品在线一区二区三区| 精品一区二区在线播放| 中文字幕一区二区三区不卡| 欧美人妇做爰xxxⅹ性高电影| 亚洲天堂免费在线观看视频| 欧美日韩美女一区二区| 国产资源在线一区| 亚洲少妇30p| 日韩欧美在线观看一区二区三区| 亚洲成人免费在线观看| 久久久夜色精品亚洲| 色婷婷av一区二区三区软件| 男女性色大片免费观看一区二区| 欧美亚洲日本国产| 久久国产麻豆精品| 亚洲人成影院在线观看| 日韩美女在线视频| 色婷婷狠狠综合| 国产一二精品视频| 亚洲一卡二卡三卡四卡无卡久久 | 国产精品嫩草99a| 欧美精品少妇一区二区三区| 国产成人夜色高潮福利影视| 亚洲天堂网中文字| 精品国产3级a| 欧美日本免费一区二区三区| 国产高清一区日本| 日韩在线播放一区二区| 亚洲人成影院在线观看| 欧美精品一区二区三区蜜桃视频| 国产麻豆欧美日韩一区| 亚洲国产精品一区二区久久 | 久久国产三级精品| 亚洲一二三四区不卡| 中文字幕精品一区二区三区精品|