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

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

?? configstorage.pas

?? Delphi編寫的一個支持語法高亮顯示和很多語言的文本編輯器
?? PAS
字號:
{-------------------------------------------------------------------------------
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/

Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
the specific language governing rights and limitations under the License.

The Original Code is: ConfigStorage.pas, released 06 May 2001.

The Initial Developer of the Original Code is J黵gen G黱therodt.

Portions created by J黵gen G黱therodt <jguentherodt@users.sourceforge.net>
are Copyright (C) 2001-2002 J黵gen G黱therodt. All Rights Reserved.

Alternatively, the contents of this file may be used under the terms of the
GNU General Public License Version 2 or later (the "GPL"), in which case
the provisions of the GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms
of the GPL and not to allow others to use your version of this file
under the MPL, indicate your decision by deleting the provisions above and
replace them with the notice and other provisions required by the GPL.
If you do not delete the provisions above, a recipient may use your version
of this file under either the MPL or the GPL.

$Id: ConfigStorage.pas,v 1.3 2002/05/26 13:47:35 jguentherodt Exp $

You may retrieve the latest version of this file at the Open Perl IDE webpage,
located at http://open-perl-ide.sourceforge.net or http://www.lost-sunglasses.de
-------------------------------------------------------------------------------}
unit ConfigStorage;

interface

uses
  Classes, sysUtils;

type
  TConfigStorage = class
  private
    m_slSections: TStringList;
  protected
    function InternalGetSectionList(sSection: String; bCreateIfNotExists: Boolean): TStringList; virtual;
    procedure InternalClear; virtual;
    function GetSectionNames: String; virtual;
    function GetSections(sSectionName: String): String; virtual;
    procedure SetSections(sSectionName: String; s: String); virtual;
  public
    constructor Create;
    destructor Destroy; override;
    procedure Clear; virtual;
    procedure Refresh; virtual;
    procedure Flush; virtual;
    procedure ReadSection(sSection: String; sl: TStringList); virtual;
    procedure EraseSection(sSection: String); virtual;
    function ReadString(sSection, sEntry, sDefaultValue: String): String; virtual;
    function ReadInteger(sSection, sEntry: String; nDefaultValue: Integer): Integer; virtual;
    procedure WriteString(sSection, sEntry, sValue: String); virtual;
    procedure WriteInteger(sSection, sEntry: String; nValue: Integer); virtual;
    property SectionNames: String Read GetSectionNames;
    property Sections[sSectionName: String]: String Read GetSections Write SetSections;
  end;


  TConfigFileStorage = class(TConfigStorage)
  private
    m_sFileName: String;
  protected
    procedure InternalLoadFromFile; virtual;
    procedure InternalSaveToFile; virtual;
  public
    constructor Create(sFileName: String);
    destructor Destroy; override;
    procedure Refresh; override;
    procedure Flush; override;
    property FileName: String Read m_sFileName;
  end;

  
implementation


////////////////////////////////////////////////////////////////////////////////
//  TConfigFileStorage = class(TConfigStorage)
////////////////////////////////////////////////////////////////////////////////
constructor TConfigFileStorage.Create(sFileName: String);
begin
  inherited Create;
  m_sFileName := sFileName;
  Refresh;
end;


destructor TConfigFileStorage.Destroy;
begin
  Flush;
  inherited Destroy;
end;


procedure TConfigFileStorage.InternalLoadFromFile;
var
  sl: TStringList;
  slSection: TStringList;
  s: String;
  i: Integer;
begin
  if not FileExists(m_sFileName) then exit;
  sl := TStringList.Create;
  try
    sl.LoadFromFile(m_sFileName);
    Clear;
    // Retreive sections and entries
    slSection := nil;
    for i := 0 to sl.Count - 1 do begin
      s := sl[i];
      if s <> '' then begin
        if (copy(s, 1, 1) = '[') and (copy(s, Length(s), 1) = ']') then begin
          slSection := InternalGetSectionList(copy(s, 2, Length(s) - 2), True);
        end else begin
          if (slSection <> nil) and (Pos('=', s) > 0) then slSection.Add(s);
        end;
      end;
    end;
  finally
    sl.Free;
  end;
end;


procedure TConfigFileStorage.InternalSaveToFile;
var
  sl, slOut, slSections: TStringList;
  i: Integer;
begin
  slOut := TStringList.Create;
  slSections := TStringList.Create;
  try
    slSections.CommaText := SectionNames;
    for i := 0 to slSections.Count - 1 do begin
      sl := InternalGetSectionList(slSections[i], False);
      if sl <> nil then begin
        slOut.Add('[' + slSections[i] + ']');
        slOut.AddStrings(sl);
        slOut.Add('');
      end;
    end;
    slOut.SaveToFile(m_sFileName);
  finally
    slSections.Free;
    slOut.Free;
  end;
end;


procedure TConfigFileStorage.Refresh;
begin
  InternalLoadFromFile;
end;


procedure TConfigFileStorage.Flush;
begin
  InternalSaveToFile;
end;


////////////////////////////////////////////////////////////////////////////////
//  TConfigStorage = class
////////////////////////////////////////////////////////////////////////////////
constructor TConfigStorage.Create;
begin
  inherited Create;
  m_slSections := TStringList.Create;
  m_slSections.Sorted := True;
  m_slSections.Duplicates := dupIgnore;
end;


destructor TConfigStorage.Destroy;
begin
  InternalClear;
  m_slSections.Free;
  inherited Destroy;
end;


procedure TConfigStorage.SetSections(sSectionName: String; s: String);
var
  slSource: TStringList;
begin
  slSource := InternalGetSectionList(sSectionName, True);
  slSource.CommaText := s;
end;


function TConfigStorage.GetSections(sSectionName: String): String;
var
  slSource: TStringList;
begin
  slSource := InternalGetSectionList(sSectionName, False);
  if slSource <> nil then begin
    Result := slSource.CommaText;
  end else Result := '';
end;


procedure TConfigStorage.EraseSection(sSection: String);
var
  idx: Integer;
begin
  idx := m_slSections.IndexOf(sSection);
  if idx > -1 then begin
    m_slSections.Objects[idx].Free;
    m_slSections.Delete(idx);
  end;
end;


procedure TConfigStorage.ReadSection(sSection: String; sl: TStringList);
var
  slSource: TStringList;
  i: Integer;
begin
  sl.Clear;
  slSource := InternalGetSectionList(sSection, False);
  if slSource <> nil then begin
    for i := 0 to slSource.Count - 1 do sl.Add(slSource.Names[i]);
  end else sl.Clear;
end;


function TConfigStorage.GetSectionNames: String;
begin
  Result := m_slSections.CommaText;
end;


procedure TConfigStorage.Clear;
begin
  InternalClear;
end;


procedure TConfigStorage.Flush;
begin
end;


procedure TConfigStorage.Refresh;
begin
end;


procedure TConfigStorage.InternalClear;
var
  i: Integer;
begin
  for i := 0 to m_slSections.Count - 1 do m_slSections.Objects[i].Free;
  m_slSections.Clear;
end;


function TConfigStorage.InternalGetSectionList(sSection: String; bCreateIfNotExists: Boolean): TStringList;
var
  idx: Integer;
begin
  idx := m_slSections.IndexOf(sSection);
  if idx > -1 then begin
    Result := TStringList(m_slSections.Objects[idx]);
  end else begin
    if bCreateIfNotExists then begin
      Result := TStringList.Create;
      m_slSections.AddObject(sSection, Result);
    end else Result := nil;
  end;
end;


function TConfigStorage.ReadString(sSection, sEntry, sDefaultValue: String): String;
var
  sl: TStringList;
begin
  sl := InternalGetSectionList(sSection, False);
  if sl <> nil then begin
    Result := sl.Values[sEntry];
    if Result = '' then Result := sDefaultValue;
  end else begin
    Result := sDefaultValue;
  end;
end;


function TConfigStorage.ReadInteger(sSection, sEntry: String; nDefaultValue: Integer): Integer;
var
  sl: TStringList;
begin
  sl := InternalGetSectionList(sSection, False);
  if sl <> nil then begin
    Result := StrToIntDef(sl.Values[sEntry], nDefaultValue);
  end else begin
    Result := nDefaultValue;
  end;
end;


procedure TConfigStorage.WriteString(sSection, sEntry, sValue: String);
var
  sl: TStringList;
begin
  sl := InternalGetSectionList(sSection, True);
  sl.Values[sEntry] := sValue;
end;


procedure TConfigStorage.WriteInteger(sSection, sEntry: String; nValue: Integer);
var
  sl: TStringList;
begin
  sl := InternalGetSectionList(sSection, True);
  sl.Values[sEntry] := IntToStr(nValue);
end;


end.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美日韩在线| 26uuu成人网一区二区三区| 色诱视频网站一区| 91麻豆自制传媒国产之光| 99精品欧美一区二区三区综合在线| 美女视频网站久久| 九一久久久久久| 国产91精品精华液一区二区三区| 国产成+人+日韩+欧美+亚洲| 国产成人综合视频| 色婷婷亚洲一区二区三区| 欧美日韩一区二区三区在线 | 91精品国模一区二区三区| 777欧美精品| 中文字幕第一区综合| 亚洲一区电影777| 国产一区二区看久久| 91麻豆产精品久久久久久| 欧美日韩国产bt| 久久久天堂av| 亚洲成人一区在线| 国产精品69毛片高清亚洲| 色狠狠综合天天综合综合| 日韩欧美一级二级三级| 亚洲免费在线看| 国产一区二区三区精品视频| 欧美日韩久久一区二区| 久久久国产精品不卡| 亚洲综合999| 国产成人精品免费| 欧美大片国产精品| 国产精品进线69影院| 国产精品系列在线观看| 精品1区2区3区| 日韩精品一区二区三区视频在线观看| 91在线免费视频观看| 日韩一卡二卡三卡四卡| 亚洲激情第一区| 波多野结衣中文字幕一区 | 最近中文字幕一区二区三区| 免费观看成人鲁鲁鲁鲁鲁视频| 不卡欧美aaaaa| 国产视频视频一区| 久久不见久久见免费视频1| 91色porny蝌蚪| 综合久久综合久久| 国产精品中文有码| 亚洲精品一区二区三区蜜桃下载| 一区二区欧美在线观看| 在线观看日韩国产| 亚洲永久精品大片| 欧美高清视频一二三区| 亚洲精品乱码久久久久久久久| 韩国视频一区二区| 91麻豆精品国产91久久久久| 午夜精品久久久久久久久| 欧美日本乱大交xxxxx| 亚洲444eee在线观看| 欧美性受极品xxxx喷水| 亚洲bt欧美bt精品777| 欧美群妇大交群中文字幕| 亚洲欧美日韩国产综合| 欧美日韩国产另类一区| 免费观看在线色综合| 久久久久久久久久久99999| 国产精品进线69影院| 91网站视频在线观看| 麻豆成人久久精品二区三区红| 精品国精品国产| 国产suv精品一区二区三区| 亚洲欧美经典视频| 欧美一区二区大片| 国产成人午夜精品5599| 亚洲综合精品自拍| 国产精品网曝门| 欧美二区三区的天堂| 国产成人鲁色资源国产91色综 | 日韩免费在线观看| 欧美在线免费观看视频| 国产一区二区女| 婷婷激情综合网| 国产精品传媒入口麻豆| 欧美一区二区在线视频| 91麻豆自制传媒国产之光| 九九九久久久精品| 日日夜夜一区二区| 夜夜夜精品看看| 国产精品人妖ts系列视频| 日韩一区欧美二区| wwwwxxxxx欧美| 欧美亚洲动漫另类| 99久久伊人网影院| 国产九九视频一区二区三区| 一区二区三区成人在线视频| 中文字幕乱码久久午夜不卡 | 一区二区三区日韩欧美| 成人欧美一区二区三区白人| 2019国产精品| 久久久精品tv| 国产精品成人午夜| 国产精品久久99| 一区二区理论电影在线观看| 国产日产精品1区| 91精品国产免费| 日韩欧美一级精品久久| 欧美精品 日韩| 国产午夜精品一区二区三区四区| 91精品国产黑色紧身裤美女| 日韩欧美中文字幕精品| 久久久精品免费观看| 综合色中文字幕| 亚洲午夜av在线| 精品伊人久久久久7777人| 精品一区二区三区不卡| 成人黄色小视频| 欧美日韩激情在线| 久久久99久久精品欧美| 亚洲三级电影网站| 久久精品国产色蜜蜜麻豆| 91香蕉视频mp4| 欧美不卡激情三级在线观看| 久久奇米777| 午夜精品爽啪视频| 99免费精品在线| 欧美三级欧美一级| 国产日产亚洲精品系列| 美国毛片一区二区| 91国偷自产一区二区三区成为亚洲经典 | 91农村精品一区二区在线| 91精品国产综合久久福利软件| 欧美欧美欧美欧美首页| 国产色爱av资源综合区| 久久国内精品自在自线400部| 一本大道久久a久久精品综合| 精品美女一区二区| 日本最新不卡在线| 这里是久久伊人| 天天影视网天天综合色在线播放 | 欧美日韩专区在线| 亚洲欧洲成人av每日更新| 日韩国产一区二| 欧美揉bbbbb揉bbbbb| 亚洲电影视频在线| 在线这里只有精品| 午夜精品一区二区三区电影天堂| 在线观看国产日韩| 欧亚一区二区三区| 精品久久久久久无| 国产资源精品在线观看| 日韩欧美一区二区在线视频| 免费观看91视频大全| 国产成人精品亚洲午夜麻豆| 在线成人高清不卡| 国产精品一区二区久久精品爱涩| 久久婷婷综合激情| va亚洲va日韩不卡在线观看| 亚洲欧美电影一区二区| 欧美影视一区在线| 国产综合一区二区| 中文字幕一区二区三区在线观看 | 一区二区高清视频在线观看| 91久久久免费一区二区| 国产精品久久国产精麻豆99网站| 欧美三级三级三级| 不卡一区二区三区四区| 日韩激情一区二区| 国产精品国产三级国产aⅴ原创| 91麻豆免费观看| 午夜视频一区在线观看| 欧美精品一区在线观看| 在线视频一区二区三| 精品一区二区在线播放| 亚洲一区二区av在线| 国产精品久久久久影院| 91麻豆精品国产91久久久久久久久| jlzzjlzz欧美大全| 精品一区二区在线播放| 中文字幕精品一区二区精品绿巨人| 欧美精品自拍偷拍| 91黄色免费观看| 欧美性视频一区二区三区| 成人av网站在线观看免费| 韩国女主播一区| 日韩一区精品视频| 三级久久三级久久久| 亚洲综合精品久久| 一级中文字幕一区二区| 亚洲乱码精品一二三四区日韩在线| 26uuu国产一区二区三区 | 一区二区三区精品视频| 最好看的中文字幕久久| 国产精品私人影院| 国产精品视频yy9299一区| 精品国产91亚洲一区二区三区婷婷| 欧美性一区二区| 日韩女同互慰一区二区| 欧美午夜精品电影| 精品国产露脸精彩对白 | 一区二区三区四区蜜桃 | 亚洲国产精品久久人人爱|