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

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

?? winskinini.pas

?? 目前所能找到的VCLSkin控件的源碼最新版, 控件功能參見官方網站: http://www.link-rank.com/
?? PAS
字號:
unit WinSkinIni;

{$B-}

interface

uses Classes,winconvert;

type
{ TQuickIni class }
  TQuickIni = class(TObject)
  private
    FAuto : boolean;
    FFileName: String;
    FIniFile : TStrings;
    function GetName(const Line: String): String;
    function GetValue(const Line, Name: String): String;
    function GetSectionIndex(const Section: String): Integer;
    function IsSection(const Line: String): Boolean;
    procedure SetFileName(Value: string);
    procedure SetIniFile(Value: TStrings);
  protected
    FSections: TStrings;
    procedure Compress(source,dest:TStream);
    procedure Decompress(source,Dest:TStream);
  public
    constructor Create;
    destructor Destroy; override;
    procedure LoadFromFile(aname:string);
    procedure SaveToFile(aname:string);
    procedure LoadFromStream(Stream: TStream);
    procedure SaveToStream(Stream:Tstream);
    procedure LoadFromZip(aname:string);
    procedure SavetoZip(aname:string);
    procedure DeleteKey(const Section, Ident: String);
    procedure EraseSection(const Section: String);
    function ReadBool(const Section, Ident: String; Default: Boolean): Boolean;
    function ReadInteger(const Section, Ident: String; Default: Longint): Longint;
    procedure ReadSection(const Section: String; Strings: TStrings);
    procedure ReadSections(Strings: TStrings);
    procedure ReadSectionValues(const Section: String; Strings: TStrings);
    function ReadString(const Section, Ident: String; Default: String): String;
    procedure RebuildSections;
    procedure WriteBool(const Section, Ident: String; Value: Boolean);
    procedure WriteInteger(const Section, Ident: String; Value: Longint);
    procedure WriteString(const Section, Ident: String; Value: String);
    property FileName: String read FFileName write SetFileName;
    property AutoSaveLoad: boolean read FAuto write FAuto;
    property IniFile: TStrings read FIniFile write SetIniFile;
    procedure Clear;
  end;

implementation

uses SysUtils;

const
  SStringsUnassignedError = 'The parameter Strings is unassigned!';
  StartBracket = '[';
  EndBracket   = ']';
  Separator    = '=';

{ TQuickIni }

constructor TQuickIni.Create;
begin
  FAuto := False;
  FIniFile := TStringList.Create;
  FSections := TStringList.Create;
//  if FileExists(FileName) then
//    LoadFromFile;
end;

destructor TQuickIni.Destroy;
begin
  FSections.Free;
  FIniFile.Free;
//  Finalize(FFileName);
end;

function TQuickIni.GetName(const Line: String): String;
var
  I: Integer;
begin
  I := Pos(Separator, Line);
  if I <> 0 then
    Result := Trim(Copy(Line, 1, I-1))
  else
    Result := EmptyStr;
  result:=lowercase(result);
end;

function TQuickIni.GetValue(const Line, Name: String): String;
var
  I: Integer;
begin
  Result := EmptyStr;
  if (Line <> EmptyStr) and (Name <> EmptyStr) then
  begin
    I := Pos(Separator, Line);
    if (Name = GetName(Line)) and (I <> 0) then
      Result := Trim(System.Copy(Line, I+1, Maxint));
  end;
end;

function TQuickIni.IsSection(const Line: String): Boolean;
var
  S: String;
begin
  Result := False;
  if Line <> EmptyStr then
  begin
    S := Trim(Line);
    if (S[1] = StartBracket) and (S[System.Length(S)] = EndBracket) then
      Result := True;
  end;
end;

function TQuickIni.GetSectionIndex(const Section: String): Integer;

begin
  Result := FSections.IndexOf(StartBracket + Section + EndBracket);
  if Result >= 0 then
    Result := Integer(FSections.Objects[Result])
  else
    Result := -1;  
end;

procedure TQuickIni.Decompress(source,Dest:TStream);
var
   LZH: TLZH;
   Size, Bytes: Longint;
begin
    // Decompress in memory blob.
    LZH := TLZH.Create;
    try
       LZH.StreamIn:= source;
       LZH.StreamOut:=dest;
       LZH.StreamIn.Position := 0;
       LZH.StreamOut.Position := 0;

       // Uncompressed file size
       LZH.StreamIn.Read(size, sizeof(Longint));
       Bytes := Size;

       // Decompress rest of stream.
       LZH.LZHUnpack(Bytes, LZH.GetBlockStream, LZH.PutBlockStream);
    finally
       LZH.Free;
    end;
end;

procedure TQuickIni.compress(source,dest:TStream);
var
   LZH: TLZH;
   Size, Bytes: Longint;
begin
    // Decompress in memory blob.
    LZH := TLZH.Create;
    try
        LZH.StreamIn := Source;
        LZH.StreamOut := dest;
        LZH.StreamIn.Position := 0;
        LZH.StreamOut.Position := 0;

        //write uncompressed size
        Size := LZH.StreamIn.Size;
        LZH.StreamOut.Write(Size, sizeof(Longint));

        // Compress stream.
        LZH.LZHPack(Bytes, LZH.GetBlockStream, LZH.PutBlockStream);
    finally
       LZH.Free;
    end;
end;

procedure TQuickIni.LoadFromZip(aname:string);
var
  r,r2: TMemoryStream;
begin
    r:=Tmemorystream.create;
    r2:=Tmemorystream.create;
    try
       r2.loadfromfile(aname);
       Decompress(r2,r);
       r.Seek(0,soFromBeginning);
       loadfromstream(r);
    finally
       r.free;
       r2.free;
    end;
end;

procedure TQuickIni.SavetoZip(aname:string);
var
  m,m2: TMemoryStream;
begin
   m:=Tmemorystream.create;
   m2:=Tmemorystream.create;
   try
     savetostream(m);
     compress(m,m2);
     m2.savetofile(aname);
   finally
     m.free;
     m2.free;
   end;
end;

procedure TQuickIni.LoadFromFile(aname:string);
var
  Stream: TStream;
  Ptr, Start: PChar;
  StmStr,Str: string;
  Size : integer;
  I : integer;
begin
  Stream := TFileStream.Create(aname, fmOpenRead or fmShareDenyWrite);
  LoadFromStream(Stream);
  Stream.Free;
end;

procedure TQuickIni.LoadFromStream(Stream: TStream);
var
  Ptr, Start: PChar;
  StmStr,Str: string;
  Size : integer;
  I : integer;
begin
  if not assigned(Stream) then exit;

  FIniFile.BeginUpdate;
  FSections.BeginUpdate;
  try
    Size := Stream.Size - Stream.Position;
    SetString(StmStr, nil, Size);
    Stream.Read(Pointer(StmStr)^, Size);
    FIniFile.Clear;
    FSections.Clear;
    Ptr := Pointer(StmStr);
    I := 0;
    if Ptr <> nil then
      while Ptr^ <> #0 do
      begin
        Start := Ptr;
        while not (Ptr^ in [#0, #10, #13]) do
          Inc(Ptr);
        SetString(Str, Start, Ptr - Start);
        Str := Trim(Str);
        if (Str <> '') and (Str[1] <> ';') then
        begin
          FIniFile.Add(Str);
          if (Str[1] = '[') and (Str[Length(Str)] = ']') then
          begin
            FSections.AddObject(Trim(Str),TObject(I));
          end;
          inc(I);
        end;
        if Ptr^ = #13 then Inc(Ptr);
        if Ptr^ = #10 then Inc(Ptr);
      end;
  finally
    FSections.EndUpdate;
    FIniFile.EndUpdate;
  end;
end;

procedure TQuickIni.SaveToFile(aname:string);
begin
//  if AutoSaveLoad then
    FIniFile.SaveToFile(aname);
end;

procedure TQuickIni.SaveToStream(Stream:Tstream);
begin
//  if AutoSaveLoad then
    if assigned(stream) then
    FIniFile.SaveTostream(stream);
end;

{ Read all Names of one Section }

procedure TQuickIni.ReadSection(const Section: String; Strings: TStrings);
var
  I: Integer;
  N: String;
begin
  Assert(Assigned(Strings), SStringsUnassignedError);
  Strings.BeginUpdate;
  try
    Strings.Clear;
    if FIniFile.Count > 0 then
    begin
      I := GetSectionIndex(Section);
      if I <> -1 then
      begin
        Inc(I);
        while (I < FIniFile.Count) and not IsSection(FIniFile[I]) do
        begin
          N := GetName(FIniFile[I]);
          if N <> EmptyStr then Strings.Add(N);
          Inc(I);
        end;
      end;
    end;
  finally
    Strings.EndUpdate;
  end;
end;

{ Read all Sections of the Ini-File }

procedure TQuickIni.ReadSections(Strings: TStrings);
var
  I: Integer;
  Section: String;
begin
  Assert(Assigned(Strings), SStringsUnassignedError);
  Strings.Assign(FSections);
  I := 0;
  while I < Strings.Count do
  begin
    Strings.Objects[I] := Nil;
    Section := Trim(Strings.Strings[I]);
    System.Delete(Section, 1, 1);
    System.Delete(Section, System.Length(Section), 1);
    Strings.Strings[I] := Trim(Section);
    Inc(I);
  end;
end;

{ Reads a String-Value of Ident in one Section.
  The result is Default if
  o Section doesn't exists
  o Ident doesn't exists
  o Ident doesn't have any assigned value }

function TQuickIni.ReadString(const Section, Ident: String; Default: String): String;
var
  I: Integer;
  V,s: String;
begin
  Result := Default;
  s:=lowercase(ident);
  if FIniFile.Count > 0 then
  begin
    I := GetSectionIndex(Section);
    if I <> -1 then
    begin
      Inc(I);
      while (I < FIniFile.Count) and not IsSection(FIniFile[I]) do
      begin
        if GetName(FIniFile[I]) = s then
        begin
          V := GetValue(FIniFile[I], s);
          if V <> EmptyStr then
            Result := V;
          break;
        end;
        Inc(I);
      end;
    end;
  end;
end;

{ Reads an Integer-Value of Ident in one Section }

function TQuickIni.ReadInteger(const Section, Ident: String; Default: Longint): Longint;
var
  IntStr: string;
begin
  IntStr := ReadString(Section, Ident, '');
  // convert a Hex-Value
  if (Length(IntStr) > 2) and (IntStr[1] = '0') and ((IntStr[2] = 'X') or (IntStr[2] = 'x')) then
    IntStr := '$' + System.Copy(IntStr, 3, Maxint);
  Result := StrToIntDef(IntStr, Default);
end;

{ Reads a Bool-Value of Ident in one Section }

function TQuickIni.ReadBool(const Section, Ident: String; Default: Boolean): Boolean;
begin
  Result := ReadInteger(Section, Ident, Ord(Default)) <> 0;
end;

{ Reads all Names + Values of one Section }

procedure TQuickIni.ReadSectionValues(const Section: String; Strings: TStrings);
var
  I: Integer;
begin
  Assert(Assigned(Strings), SStringsUnassignedError);
  Strings.BeginUpdate;
  try
    Strings.Clear;
    if FIniFile.Count > 0 then
    begin
      I := GetSectionIndex(Section);
      if I <> -1 then
      begin
        Inc(I);
        while (I < FIniFile.Count) and not IsSection(FIniFile[I]) do
        begin
          if (FIniFile[I] <> '') then
            Strings.Add(FIniFile[I]);
          Inc(I);
        end;
      end;
    end;
  finally
    Strings.EndUpdate;
  end;
end;

{ Writes a String-Value for Ident in one Section.
  Note: If Section and/or Ident don't exist, they will be placed in the Ini-File }

procedure TQuickIni.WriteString(const Section, Ident: String; Value: String);
var
  I: Integer;
  Q : integer;
  s:string;
begin
  I := GetSectionIndex(Section);
  s:=lowercase(ident);
  // Section exists
  if I >= 0 then
  begin
    Inc(I);
    while (I < FIniFile.Count) and not IsSection(FIniFile[I])
      and (GetName(FIniFile[I]) <> s) do
    begin
      Inc(I);
    end;
    // End of File or Ident doesn't exists in the Section
    if (I >= FIniFile.Count) then
    begin
      if Ident <> EmptyStr then
      begin
        FIniFile.Add(Ident + Separator + Value);
      end
    end
    else if (I < FIniFile.Count) and IsSection(FIniFile[I]) then
    begin
      if Ident <> EmptyStr then
      begin
        FIniFile.Insert(I,Ident + Separator + Value);
        Inc(I);
        Q := FSections.IndexOf(FIniFile[I]);
        FSections.Objects[Q] := TObject(I+1);
      end
    end
    // Ident does exists in the section
    else if Ident <> EmptyStr then
    begin
      FIniFile[I] := Ident + Separator + Value;
    end;
  end
  // Section doesn't exists, so add new [Section] with Ident=Value
  else
  begin
    I := FIniFile.Add(StartBracket + Section + EndBracket);
    FSections.AddObject(StartBracket + Section + EndBracket,TObject(I));
    if Ident <> EmptyStr then
    begin
      FIniFile.Add(Ident + Separator + Value);
    end;
  end;
//  SaveToFile;
end;

{ Writes an Integer-Value for Ident in one Section }

procedure TQuickIni.WriteInteger(const Section, Ident: String; Value: Longint);
begin
  WriteString(Section, Ident, IntToStr(Value));
end;

{ Writes a Bool-Value for Ident in one Section }

procedure TQuickIni.WriteBool(const Section, Ident: String; Value: Boolean);
const
  Values: array[Boolean] of string = ('0', '1');
begin
  WriteString(Section, Ident, Values[Value]);
end;

{ Deletes the Value of Ident in one Section.
  Note: Only if Section and Ident exist, the Value of Ident will be set to NULL }

procedure TQuickIni.DeleteKey(const Section, Ident: String);
var
  I: Integer;
begin
  I := GetSectionIndex(Section);
  if I <> -1 then
  begin
    Inc(I);
    while (I < FIniFile.Count) and not IsSection(FIniFile[I]) and
      (GetName(FIniFile[I]) <> Ident) do Inc(I);
    // Ident does exists  
    if not (I >= FIniFile.Count) and not IsSection(FIniFile[I]) then
    begin
      FIniFile.Delete(I);
//      SaveToFile;
    end;  
  end;
end;

procedure TQuickIni.EraseSection(const Section: String);
var
  I: Integer;
begin
  I := GetSectionIndex(Section);
  if I <> -1 then
  begin
    // Delete Section-Header
    FIniFile.Delete(I);
    // Delete Section-Items
    while (I < FIniFile.Count) and not IsSection(FIniFile[I]) do
      FIniFile.Delete(I);
    if I > 0 then FIniFile.Insert(I, EmptyStr);  
//    SaveToFile;
  end;
end;

procedure TQuickIni.SetFileName(Value: string);
begin
  if Value <> FFileName then
  begin
    FFileName := Value;
//    if FileExists(Value) and FAuto then
//      LoadFromFile;
  end;
end;

procedure TQuickIni.SetIniFile(Value: TStrings);
begin
  FIniFile.Assign(Value);
  RebuildSections;
end;

procedure TQuickIni.RebuildSections;
Var
  I : integer;
  Count : integer;
begin
  FSections.Clear;
  I := 0;
  Count := FIniFile.Count;
  while I < Count do
  begin
    if (FIniFile[I] <> '') and (FIniFile[I][1] = '[') and (FIniFile[I][Length(FIniFile[I])] = ']') then
    begin
      if assigned(FSections) then
        FSections.AddObject(Trim(FIniFile[I]),TObject(I));
    end;
    inc(I);
  end;
end;

procedure TQuickIni.Clear;
begin
  FIniFile.Clear;
  FSections.Clear;
end;

end.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲大片精品永久免费| 亚洲少妇30p| 91行情网站电视在线观看高清版| 无码av免费一区二区三区试看| 国产精品天干天干在观线| 91.com视频| 91久久精品一区二区二区| 激情文学综合插| 午夜亚洲福利老司机| 国产精品国产三级国产专播品爱网 | 国产精品自拍毛片| 日本午夜一本久久久综合| 中文字幕亚洲视频| 26uuu精品一区二区在线观看| 欧美日韩一区二区三区在线看| 成人性生交大片免费看中文| 久久精品国产一区二区三| 亚洲国产精品一区二区久久恐怖片 | 成人h精品动漫一区二区三区| 免费一级片91| 午夜成人免费电影| 亚洲一级片在线观看| 亚洲女人****多毛耸耸8| 日本一区二区视频在线观看| 欧美成人高清电影在线| 欧美日韩黄色一区二区| 色欧美乱欧美15图片| 成人av片在线观看| 国产精品一区二区在线观看网站| 日韩一区欧美二区| 无码av中文一区二区三区桃花岛| 亚洲国产一区在线观看| 一区二区三区精品在线观看| 成人免费一区二区三区视频| 中文字幕一区av| 国产精品白丝在线| 亚洲欧洲av在线| 亚洲欧美在线视频| 国产精品久久一卡二卡| 国产精品毛片高清在线完整版| 久久久99久久| 国产精品伦理一区二区| 中文av一区二区| 国产精品久久久久久久久免费樱桃 | 精品国产一区二区国模嫣然| 日韩区在线观看| 日韩欧美一区二区久久婷婷| 日韩一区二区麻豆国产| 久久青草国产手机看片福利盒子| 欧美va亚洲va| 国产婷婷精品av在线| 国产精品久线在线观看| 亚洲黄网站在线观看| 亚洲综合区在线| 日韩精品国产欧美| 精品一区二区三区欧美| 国产99久久久久久免费看农村| www.久久久久久久久| 91国在线观看| 日韩精品最新网址| 久久综合九色欧美综合狠狠| 国产欧美日韩另类视频免费观看| 国产精品剧情在线亚洲| 性久久久久久久| 国模一区二区三区白浆| 97精品国产97久久久久久久久久久久 | 在线观看91av| 国产偷v国产偷v亚洲高清| 国产色产综合产在线视频| 国产欧美一区二区三区在线看蜜臀| 欧美国产一区在线| 怡红院av一区二区三区| 日本欧美一区二区在线观看| 国产高清久久久| 色呦呦国产精品| 九九视频精品免费| 成人综合在线视频| 成人小视频免费观看| 在线一区二区三区四区五区| 日韩欧美亚洲国产精品字幕久久久| 精品福利在线导航| 洋洋成人永久网站入口| 经典三级视频一区| 色综合天天综合狠狠| 欧美一级片在线观看| 国产精品高清亚洲| 亚洲综合在线第一页| 日韩av在线发布| 97se狠狠狠综合亚洲狠狠| 欧美日韩国产免费一区二区| 久久久久国产精品厨房| 亚洲国产欧美在线| 福利一区二区在线观看| 欧美日韩三级一区二区| 国产精品伦一区二区三级视频| 免播放器亚洲一区| 欧美在线不卡视频| 国产丝袜在线精品| 久久激情综合网| 欧美综合一区二区| 国产精品欧美精品| 韩国毛片一区二区三区| 欧美疯狂做受xxxx富婆| 亚洲欧洲成人精品av97| 韩国成人精品a∨在线观看| 欧美日韩五月天| 亚洲色图另类专区| 国产91精品精华液一区二区三区 | 久久久久久**毛片大全| 亚洲成av人片一区二区三区| 99久久久精品免费观看国产蜜| 26uuuu精品一区二区| 久久精品国产在热久久| 欧美日韩夫妻久久| 亚洲人成在线播放网站岛国| 成人性视频免费网站| 久久免费看少妇高潮| 蜜桃精品在线观看| 欧美人伦禁忌dvd放荡欲情| 一区二区三区精品久久久| 不卡影院免费观看| 国产精品毛片无遮挡高清| 国产精品一二三四| 精品人伦一区二区色婷婷| 亚洲6080在线| 欧美日韩一区三区四区| 亚洲国产三级在线| 色香蕉久久蜜桃| 亚洲欧美激情在线| 国产69精品久久久久777| 久久久99免费| 国产伦精品一区二区三区免费 | 国产精品久久久久毛片软件| 色综合中文字幕| 久久综合久久99| 麻豆一区二区三区| 日韩久久精品一区| 老司机精品视频在线| 日韩精品一区二区三区视频播放| 奇米综合一区二区三区精品视频| 欧美乱妇15p| 青青青爽久久午夜综合久久午夜 | 日韩一区二区三区高清免费看看 | 日本不卡高清视频| 欧美一区二区视频免费观看| 乱一区二区av| 久久久久久亚洲综合影院红桃 | 日韩免费高清av| 激情都市一区二区| 国产日本一区二区| 99国产精品视频免费观看| 中文字幕中文字幕在线一区| 欧美曰成人黄网| 日本大胆欧美人术艺术动态| 精品国产欧美一区二区| 国产乱码精品一区二区三区忘忧草| 日韩三级av在线播放| 国产乱码字幕精品高清av| 国产精品久久久久影院老司| 色妞www精品视频| 日韩电影免费一区| 国产婷婷色一区二区三区四区| 91同城在线观看| 三级亚洲高清视频| 久久久久88色偷偷免费| av电影一区二区| 丝袜美腿一区二区三区| 久久亚洲二区三区| 色呦呦日韩精品| 麻豆精品视频在线| 国产精品卡一卡二卡三| 欧美区在线观看| 国产不卡一区视频| 亚洲中国最大av网站| 久久婷婷国产综合国色天香| 91美女在线视频| 蜜臀av性久久久久蜜臀aⅴ| 欧美激情综合五月色丁香| 欧美性三三影院| 国产九九视频一区二区三区| 亚洲精品视频免费观看| 久久亚洲一区二区三区明星换脸| 91蜜桃视频在线| 国产美女精品人人做人人爽| 亚洲人xxxx| 国产亚洲欧美在线| 欧美日韩国产片| aaa欧美色吧激情视频| 蜜桃视频一区二区| 一区二区三区视频在线观看| 中文字幕欧美区| 99久久精品免费精品国产| 香蕉加勒比综合久久| 国产欧美一区二区三区沐欲| 欧美日韩不卡在线| 97久久精品人人澡人人爽| 国产呦萝稀缺另类资源| 日韩精品1区2区3区| 亚洲精品一二三区| 国产欧美一区视频|