C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[64165] 델파이 -> 빌더
김종철 [bellhit81] 1242 읽음    2011-04-14 19:55
델파이 소스를 빌더로 컨버팅 중입니다.

그런데 생각보다 쉽지가 않네요 ㅠㅠ

고수님들 시간되시면 부탁드립니다.


unit Unit_IniCompare;

interface

uses
  Windows, Classes, SysUtils, StdCtrls, Dialogs;

const
   MAX_SECTION = 500;   //Total Section Count
   MAX_KEY_VALUE = 500;  //(Key/Value Count)/1Section

type         //r : record
  rTSection = record
    Name : String;
    KeyCount : Integer;
    Key : array of String;
    Value_ : array of String;
  end;

  rTIni = record
    Name : String;
    Path : String;
    SectionCount : Byte;
    Section : array of rTSection;
  end;

TAppViewerFunc = Procedure(Data : String); stdcall;
 
type
  TMyCollectionItem = class(TCollectionItem)
  private
    FIni : rTIni;
    FSectionCount : Integer;
    FKeyCount : Integer;
    procedure SetIni(const AIni : rTIni);
  public
    procedure AssignParameter(const AIni: rTIni); virtual;
  published
    property Ini: rTIni read FIni write SetIni;
    property SectionCount: Integer read FSectionCount write FSectionCount;
    property KeyCount: Integer read FKeyCount write FKeyCount;
  end;

  TINILogCollection = class(TCollection)
  private
    mLogPath: String;
    mLogFileHeader: String;

    procedure Compare(User: String; OldItemsIndex, NewItemsIndex: Integer);
  protected
    function GetItem(Index: integer): TMyCollectionItem; virtual;
    procedure SetItem(Index: integer; Value: TMyCollectionItem); virtual;
    function IndexOf(const AIni : rTIni): integer; virtual;
  public
    constructor Create(LogPath: String; LogFileHeader:String);
    function Add: TMyCollectionItem;
    procedure AddParameter(const AIni : rTIni);
    procedure DeleteParameter(const AIni : rTIni);
    procedure AddData(const FilePath : String);
    procedure CompareItems(User: String);
    procedure AddLog(LogData: String);
    property Items[Index: integer] : TMyCollectionItem read GetItem write SetItem;
  published
  end;


implementation

var
  AppViewerFunc : TAppViewerFunc;

 
{ TMyCollectionItem }

procedure TMyCollectionItem.AssignParameter(const AIni : rTIni);
var
   i : Integer;
begin
   FIni := AIni;
   FSectionCount := FIni.SectionCount;
   for i := 0 to FSectionCount-1 do begin  
       FKeyCount := FKeyCount + FIni.Section[i].KeyCount;
   end;
end;

procedure TMyCollectionItem.SetIni(const AIni : rTIni);
begin
   FIni := AIni;
end;

+ -

관련 글 리스트
64165 델파이 -> 빌더 김종철 1242 2011/04/14
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.