mirror of
https://bitbucket.org/Dennis07/lina-components.git
synced 2024-11-24 08:02:12 +02:00
Version 1.0 DEV 1.07d
Signed-off-by: Dennis07 <den.goehlert@t-online.de>
This commit is contained in:
parent
fa2676aea5
commit
5665aa60c7
BIN
Information/Resource/Logo.jpg
Normal file
BIN
Information/Resource/Logo.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 28 KiB |
@ -1,4 +1,4 @@
|
||||
These statistics cover the official repository of Lina Components.
|
||||
|
||||
Total lines of code (LoC): 4000+
|
||||
Total lines of code (LoC): 4300+
|
||||
Total visual components (VC): 11
|
@ -1,44 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<BorlandProject>
|
||||
<Transactions>
|
||||
<Transaction>1899.12.30 00:00:00.000.932,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\uFileCtrls.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.325,=dbrtl.dcp</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.508,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uBase.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.576,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uSysTools.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.592,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uFileTools.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.412,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.675,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.809,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Resource\Lina.rc</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.681,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Resource\Lina.rc=</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.204,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\uFileCtrls.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uFileCtrls.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.592,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uFileTools.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.325,=dbrtl.dcp</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.411,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uAdvCtrls.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.582,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uWebCtrls.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.932,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\uFileCtrls.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.837,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.508,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uBase.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.621,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uLinaTest.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.556,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uLocalMgr.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.577,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uBattery.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.650,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uSysCtrls.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uBattery.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.414,C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uLinaTest.pas=</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.318,=vcl.dcp</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.518,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uBattery.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.576,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uSysTools.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.621,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uLinaTest.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.577,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uBattery.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.633,C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\LINA_D_XE5.dproj=C:\Users\Dennis\Documents\RAD Studio\Projekte\Package1.dproj</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.204,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uFileCtrls.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\uFileCtrls.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.648,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uScriptMgr.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.650,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uBattery.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uSysCtrls.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.555,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uBase.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.525,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uCrypt.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.971,=IndySystem.dcp</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.518,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uBattery.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.556,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uLocalMgr.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.318,=vcl.dcp</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.196,=rtl.dcp</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.686,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\uSysTools.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.555,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uBase.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.971,=IndySystem.dcp</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.672,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\uFrmCtrls.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.118,=IndyCore.dcp</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.535,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uFileTools.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.672,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\uFrmCtrls.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.633,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uLocalMgr.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.584,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uVirtObj.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.791,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.566,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uScriptMgr.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.675,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.412,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.582,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uWebCtrls.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.525,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uCrypt.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.546,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uFrmCtrls.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.411,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uAdvCtrls.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.791,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.837,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.566,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uScriptMgr.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.045,=IndyProtocols.dcp</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.633,C:\Users\Dennis\Documents\RAD Studio\Projekte\Package1.dproj=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\LINA_D_XE5.dproj</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.857,=PascalScript_Core_D19.dcp</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.584,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uVirtObj.pas</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.799,=PascalScript_Core_D19.dcp</Transaction>
|
||||
<Transaction>1899.12.30 00:00:00.000.857,=PascalScript_Core_D19.dcp</Transaction>
|
||||
</Transactions>
|
||||
<ProjectSortOrder AutoSort="0" SortType="0">
|
||||
<File Path="..\..\..\LinaComponents"/>
|
||||
@ -55,6 +55,7 @@
|
||||
<File Path="..\..\Source\uAdvCtrls.pas"/>
|
||||
<File Path="..\..\Source\uBase.pas"/>
|
||||
<File Path="..\..\Source\uCrypt.pas"/>
|
||||
<File Path="..\..\Source\uFileCtrls.pas"/>
|
||||
<File Path="..\..\Source\uFileTools.pas"/>
|
||||
<File Path="..\..\Source\uFrmCtrls.pas"/>
|
||||
<File Path="..\..\Source\uLocalMgr.pas"/>
|
||||
@ -63,7 +64,6 @@
|
||||
<File Path="..\..\Source\uSysTools.pas"/>
|
||||
<File Path="..\..\Source\uVirtObj.pas"/>
|
||||
<File Path="..\..\Source\uWebCtrls.pas"/>
|
||||
<File Path="..\..\Source\uFileCtrls.pas"/>
|
||||
<File Path="dbrtl.dcp"/>
|
||||
<File Path="IndyCore.dcp"/>
|
||||
<File Path="IndyProtocols.dcp"/>
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -10,60 +10,307 @@ interface
|
||||
|
||||
uses
|
||||
{ Standard-Units }
|
||||
Classes;
|
||||
SysUtils, Classes,
|
||||
{ Andere Package-Units }
|
||||
uSysTools;
|
||||
|
||||
type
|
||||
{ Fehlermeldungen }
|
||||
EInvalidKey = class(Exception);
|
||||
|
||||
type
|
||||
{ Hilfsklassen }
|
||||
TCryptMode = (cmEncrypt,cmDecrypt);
|
||||
|
||||
type
|
||||
{ Ereignisse }
|
||||
TCryptWorkEvent = procedure(Sender: TObject; const Mode: TCryptMode) of object;
|
||||
TCryptKeyChangeEvent = procedure(Sender: TObject) of object;
|
||||
TCryptKeyChangeQueryEvent = procedure(Sender: TObject; var CanChange: Boolean) of object;
|
||||
|
||||
type
|
||||
{ Hauptklassen }
|
||||
TCrypt = class
|
||||
private
|
||||
{ Private-Deklarationen }
|
||||
FKeyString: String;
|
||||
FKeyChar: Char;
|
||||
FKeyInteger: Integer;
|
||||
FLines: TStrings;
|
||||
FWorkEvent: TCryptWorkEvent;
|
||||
FKeyChangeEvent: TCryptKeyChangeEvent;
|
||||
FKeyChangeQueryEvent: TCryptKeyChangeQueryEvent;
|
||||
{ Methoden }
|
||||
procedure SetKeyString(Value: String);
|
||||
procedure SetKeyChar(Value: Char);
|
||||
procedure SetKeyInteger(Value: Integer);
|
||||
{ Eigenschaften }
|
||||
property KeyString: String read FKeyString write SetKeyString;
|
||||
property KeyChar: Char read FKeyChar write SetKeyChar;
|
||||
property KeyInteger: Integer read FKeyInteger write SetKeyInteger;
|
||||
public
|
||||
{ Public-Deklarationen }
|
||||
constructor Create;
|
||||
destructor Destroy;
|
||||
destructor Destroy; override;
|
||||
property Lines: TStrings read FLines write FLines;
|
||||
procedure Decrypt;
|
||||
procedure Encrypt;
|
||||
procedure Decrypt; virtual;
|
||||
procedure Encrypt; virtual;
|
||||
{ Ereignisse }
|
||||
property OnWork: TCryptWorkEvent read FWorkEvent write FWorkEvent;
|
||||
property OnKeyChange: TCryptKeyChangeEvent read FKeyChangeEvent write FKeyChangeEvent;
|
||||
property OnKeyChangeQuery: TCryptKeyChangeQueryEvent read FKeyChangeQueryEvent write FKeyChangeQueryEvent;
|
||||
end;
|
||||
|
||||
{ Spezifische Kryptologie-Verfahren }
|
||||
|
||||
TXorCrypt = class(TCrypt)
|
||||
|
||||
private
|
||||
{ Private-Deklarationen }
|
||||
procedure SetKeyInteger(Value: Integer);
|
||||
public
|
||||
{ Public-Deklarationen }
|
||||
procedure Decrypt;
|
||||
procedure Encrypt;
|
||||
{ Eigenschaften }
|
||||
property KeyInteger;
|
||||
end;
|
||||
|
||||
TVigenereCrypt = class(TCrypt)
|
||||
|
||||
private
|
||||
{ Private-Deklarationen }
|
||||
procedure SetKeyString(Value: String);
|
||||
public
|
||||
{ Public-Deklarationen }
|
||||
procedure Decrypt;
|
||||
procedure Encrypt;
|
||||
{ Eigenschaften }
|
||||
property KeyChar;
|
||||
end;
|
||||
|
||||
TCaesarCrypt = class(TCrypt)
|
||||
|
||||
private
|
||||
{ Private-Deklarationen }
|
||||
procedure SetKeyChar(Value: Char);
|
||||
public
|
||||
{ Public-Deklarationen }
|
||||
procedure Decrypt;
|
||||
procedure Encrypt;
|
||||
{ Eigenschaften }
|
||||
property KeyString;
|
||||
end;
|
||||
|
||||
TDynaCrypt = class(TCrypt)
|
||||
|
||||
end;
|
||||
//TDynaCrypt = class(TCrypt)
|
||||
//public
|
||||
{ Public-Deklarationen }
|
||||
//procedure Decrypt;
|
||||
//procedure Encrypt;
|
||||
{ Eigenschaften }
|
||||
//property KeyChar;
|
||||
//end;
|
||||
|
||||
implementation
|
||||
|
||||
{ ----------------------------------------------------------------------------
|
||||
TCrypt
|
||||
---------------------------------------------------------------------------- }
|
||||
|
||||
constructor TCrypt.Create;
|
||||
begin
|
||||
//...
|
||||
FLines := TStringList.Create;
|
||||
end;
|
||||
|
||||
destructor TCrypt.Destroy;
|
||||
begin
|
||||
//...
|
||||
FLines.Free;
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TCrypt.SetKeyString(Value: String);
|
||||
var
|
||||
CanChange: Boolean;
|
||||
begin
|
||||
CanChange := True;
|
||||
if Assigned(OnKeyChange) then
|
||||
begin
|
||||
OnKeyChangeQuery(Self,CanChange);
|
||||
end;
|
||||
if CanChange = True then
|
||||
begin
|
||||
FKeyString := Value;
|
||||
if Assigned(OnKeyChange) then
|
||||
begin
|
||||
OnKeyChange(Self);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCrypt.SetKeyChar(Value: Char);
|
||||
var
|
||||
CanChange: Boolean;
|
||||
begin
|
||||
CanChange := True;
|
||||
if Assigned(OnKeyChange) then
|
||||
begin
|
||||
OnKeyChangeQuery(Self,CanChange);
|
||||
end;
|
||||
if CanChange = True then
|
||||
begin
|
||||
FKeyChar := Value;
|
||||
if Assigned(OnKeyChange) then
|
||||
begin
|
||||
OnKeyChange(Self);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCrypt.SetKeyInteger(Value: Integer);
|
||||
var
|
||||
CanChange: Boolean;
|
||||
begin
|
||||
CanChange := True;
|
||||
if Assigned(OnKeyChange) then
|
||||
begin
|
||||
OnKeyChangeQuery(Self,CanChange);
|
||||
end;
|
||||
if CanChange = True then
|
||||
begin
|
||||
FKeyInteger := Value;
|
||||
if Assigned(OnKeyChange) then
|
||||
begin
|
||||
OnKeyChange(Self);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCrypt.Decrypt;
|
||||
begin
|
||||
//...
|
||||
if Assigned(OnWork) = True then
|
||||
begin
|
||||
OnWork(Self,cmDecrypt);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCrypt.Encrypt;
|
||||
begin
|
||||
//...
|
||||
if Assigned(OnWork) = True then
|
||||
begin
|
||||
OnWork(Self,cmEncrypt);
|
||||
end;
|
||||
end;
|
||||
|
||||
{ ----------------------------------------------------------------------------
|
||||
TXorCrypt
|
||||
---------------------------------------------------------------------------- }
|
||||
|
||||
procedure TXorCrypt.SetKeyInteger(Value: Integer);
|
||||
begin
|
||||
if not (KeyInteger in [0..31]) then
|
||||
begin
|
||||
raise EInvalidKey.Create('Invalid key value');
|
||||
end;
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TXorCrypt.Decrypt;
|
||||
begin
|
||||
{ Bei Xor entspricht der Entschlüsselungs-Algorithmus dem der
|
||||
Verschlüsselung. Deshalb genügt hier ein Verweis auf "TXorCrypt.Encrypt". }
|
||||
Encrypt;
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TXorCrypt.Encrypt;
|
||||
var
|
||||
Encrypted: TStrings;
|
||||
LineIndex: Integer;
|
||||
CharIndex: Integer;
|
||||
Line: String;
|
||||
begin
|
||||
Encrypted := TStringList.Create;
|
||||
try
|
||||
Encrypted.Assign(Lines);
|
||||
for LineIndex := 0 to Encrypted.Count do
|
||||
begin
|
||||
Line := Encrypted.Strings[LineIndex];
|
||||
for CharIndex := 1 to Length(Line) do
|
||||
begin
|
||||
if Line[CharIndex] > #31 then
|
||||
begin
|
||||
Line[CharIndex] := Chr(Ord(Line[CharIndex]) xor KeyInteger);
|
||||
end;
|
||||
end;
|
||||
Encrypted.Strings[LineIndex] := Line;
|
||||
end;
|
||||
Lines.Assign(Encrypted);
|
||||
finally
|
||||
Encrypted.Free;
|
||||
end;
|
||||
inherited;
|
||||
end;
|
||||
|
||||
{ ----------------------------------------------------------------------------
|
||||
TVigenereCrypt
|
||||
---------------------------------------------------------------------------- }
|
||||
|
||||
procedure TVigenereCrypt.SetKeyString(Value: String);
|
||||
var
|
||||
Index: Integer;
|
||||
begin
|
||||
Value := UpperCase(Value);
|
||||
for Index := 1 to Length(Value) do
|
||||
begin
|
||||
if not (Value[Index] in ['A'..'Z']) then
|
||||
begin
|
||||
raise EInvalidKey.Create('Invalid key value');
|
||||
end;
|
||||
end;
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TVigenereCrypt.Decrypt;
|
||||
begin
|
||||
//...
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TVigenereCrypt.Encrypt;
|
||||
{var
|
||||
Encrypted: TStrings;
|
||||
LineIndex: Integer;
|
||||
CharIndex: Integer;
|
||||
Line: String;
|
||||
Temp: Integer;
|
||||
NormedKey: Integer; }
|
||||
begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
{ ----------------------------------------------------------------------------
|
||||
TCaesarCrypt
|
||||
---------------------------------------------------------------------------- }
|
||||
|
||||
procedure TCaesarCrypt.SetKeyChar(Value: Char);
|
||||
begin
|
||||
Value := CharUpperCase(Value);
|
||||
if not (Value in ['A'..'Z']) then
|
||||
begin
|
||||
raise EInvalidKey.Create('Invalid key value');
|
||||
end;
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TCaesarCrypt.Decrypt;
|
||||
begin
|
||||
//...
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TCaesarCrypt.Encrypt;
|
||||
begin
|
||||
//...
|
||||
inherited;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
53
Source/uFileCtrls.pas
Normal file
53
Source/uFileCtrls.pas
Normal file
@ -0,0 +1,53 @@
|
||||
unit uFileCtrls;
|
||||
|
||||
//////////////////////////////////////
|
||||
/// Lina File Controls Unit ///
|
||||
/// **************************** ///
|
||||
/// (c) 2014 Dennis Göhlert a.o. ///
|
||||
//////////////////////////////////////
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
{ Standard-Units }
|
||||
SysUtils, Classes, ComCtrls, Menus,
|
||||
{ Andere Package-Units }
|
||||
uBase, uFileTools;
|
||||
|
||||
type
|
||||
{ Hauptklassen }
|
||||
TDirPopupMenu = class(TPopupMenu)
|
||||
|
||||
end;
|
||||
|
||||
TDirListView = class(TListView)
|
||||
private
|
||||
{ Private-Deklarationen }
|
||||
PopupMenu: TPopupMenu;
|
||||
FAbout: TComponentAbout;
|
||||
FFiles: TWinFileArray;
|
||||
public
|
||||
{ Public-Deklarationen }
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
published
|
||||
{ Published-Deklarationen }
|
||||
property About: TComponentAbout read FAbout;
|
||||
// property Files[Index: Integer]: TWinFile read FFiles;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
constructor TDirListView.Create(AOwner: TComponent);
|
||||
begin
|
||||
inherited;
|
||||
PopupMenu := TPopupMenu.Create(Self);
|
||||
end;
|
||||
|
||||
destructor TDirListView.Destroy;
|
||||
begin
|
||||
PopupMenu.Free;
|
||||
inherited;
|
||||
end;
|
||||
|
||||
end.
|
@ -89,6 +89,8 @@ type
|
||||
function ExtractUserName(const Owner: String): String;
|
||||
function ExtractUserDomain(const Owner: String): String;
|
||||
function RoundPos(Number: Extended; Pos: Byte): Extended;
|
||||
function CharLowerCase(Character: Char): Char;
|
||||
function CharUpperCase(Character: Char): Char;
|
||||
|
||||
const
|
||||
Spaces = [#9,#10,#13,#32,#160];
|
||||
@ -265,6 +267,30 @@ begin
|
||||
Result := Number / Factor;
|
||||
end;
|
||||
|
||||
function CharLowerCase(Character: Char): Char;
|
||||
{ Basierend auf der Technik von SysUtils.LowerCase, nur simpler/schneller }
|
||||
begin
|
||||
if Character in ['A'..'Z'] then
|
||||
begin
|
||||
Result := Char(Word(Character) or $0020);
|
||||
end else
|
||||
begin
|
||||
Result := Character;
|
||||
end;
|
||||
end;
|
||||
|
||||
function CharUpperCase(Character: Char): Char;
|
||||
{ Basierend auf der Technik von SysUtils.UpperCase, nur simpler/schneller }
|
||||
begin
|
||||
if Character in ['a'..'z'] then
|
||||
begin
|
||||
Result := Char(Word(Character) xor $0020);
|
||||
end else
|
||||
begin
|
||||
Result := Character;
|
||||
end;
|
||||
end;
|
||||
|
||||
function WinUserName: String;
|
||||
var
|
||||
Buffer: array [0..255] of Char;
|
||||
|
Loading…
Reference in New Issue
Block a user