initial commit
This commit is contained in:
commit
d38bb0ba22
30
.gitignore
vendored
Normal file
30
.gitignore
vendored
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
# Lazarus compiler-generated binaries (safe to delete)
|
||||||
|
*.exe
|
||||||
|
*.dll
|
||||||
|
*.so
|
||||||
|
*.dylib
|
||||||
|
*.lrs
|
||||||
|
*.res
|
||||||
|
*.compiled
|
||||||
|
*.dbg
|
||||||
|
*.ppu
|
||||||
|
*.o
|
||||||
|
*.or
|
||||||
|
*.a
|
||||||
|
|
||||||
|
# Lazarus autogenerated files (duplicated info)
|
||||||
|
*.rst
|
||||||
|
*.rsj
|
||||||
|
*.lrt
|
||||||
|
|
||||||
|
# Lazarus local files (user-specific info)
|
||||||
|
*.lps
|
||||||
|
|
||||||
|
# Lazarus backups and unit output folders.
|
||||||
|
# These can be changed by user in Lazarus/project options.
|
||||||
|
backup/
|
||||||
|
*.bak
|
||||||
|
lib/
|
||||||
|
|
||||||
|
# Application bundle for Mac OS
|
||||||
|
*.app/
|
153
b64.lpi
Normal file
153
b64.lpi
Normal file
@ -0,0 +1,153 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<CONFIG>
|
||||||
|
<ProjectOptions>
|
||||||
|
<Version Value="12"/>
|
||||||
|
<PathDelim Value="\"/>
|
||||||
|
<General>
|
||||||
|
<SessionStorage Value="InProjectDir"/>
|
||||||
|
<Title Value="Base64 Converter"/>
|
||||||
|
<Scaled Value="True"/>
|
||||||
|
<ResourceType Value="res"/>
|
||||||
|
<UseXPManifest Value="True"/>
|
||||||
|
<XPManifest>
|
||||||
|
<DpiAware Value="True"/>
|
||||||
|
<TextName Value="BastiSK.Base64Converter"/>
|
||||||
|
<TextDesc Value="Converts Base64 strings."/>
|
||||||
|
</XPManifest>
|
||||||
|
<Icon Value="0"/>
|
||||||
|
</General>
|
||||||
|
<BuildModes>
|
||||||
|
<Item Name="Default" Default="True"/>
|
||||||
|
<Item Name="Debug">
|
||||||
|
<CompilerOptions>
|
||||||
|
<Version Value="11"/>
|
||||||
|
<PathDelim Value="\"/>
|
||||||
|
<Target>
|
||||||
|
<Filename Value="b64"/>
|
||||||
|
</Target>
|
||||||
|
<SearchPaths>
|
||||||
|
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||||
|
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||||
|
</SearchPaths>
|
||||||
|
<Parsing>
|
||||||
|
<SyntaxOptions>
|
||||||
|
<IncludeAssertionCode Value="True"/>
|
||||||
|
</SyntaxOptions>
|
||||||
|
</Parsing>
|
||||||
|
<CodeGeneration>
|
||||||
|
<Checks>
|
||||||
|
<IOChecks Value="True"/>
|
||||||
|
<RangeChecks Value="True"/>
|
||||||
|
<OverflowChecks Value="True"/>
|
||||||
|
<StackChecks Value="True"/>
|
||||||
|
</Checks>
|
||||||
|
<VerifyObjMethodCallValidity Value="True"/>
|
||||||
|
</CodeGeneration>
|
||||||
|
<Linking>
|
||||||
|
<Debugging>
|
||||||
|
<DebugInfoType Value="dsDwarf3"/>
|
||||||
|
<UseHeaptrc Value="True"/>
|
||||||
|
<TrashVariables Value="True"/>
|
||||||
|
<UseExternalDbgSyms Value="True"/>
|
||||||
|
</Debugging>
|
||||||
|
<Options>
|
||||||
|
<Win32>
|
||||||
|
<GraphicApplication Value="True"/>
|
||||||
|
</Win32>
|
||||||
|
</Options>
|
||||||
|
</Linking>
|
||||||
|
</CompilerOptions>
|
||||||
|
</Item>
|
||||||
|
<Item Name="Release">
|
||||||
|
<CompilerOptions>
|
||||||
|
<Version Value="11"/>
|
||||||
|
<PathDelim Value="\"/>
|
||||||
|
<Target>
|
||||||
|
<Filename Value="b64"/>
|
||||||
|
</Target>
|
||||||
|
<SearchPaths>
|
||||||
|
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||||
|
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||||
|
</SearchPaths>
|
||||||
|
<CodeGeneration>
|
||||||
|
<SmartLinkUnit Value="True"/>
|
||||||
|
<Optimizations>
|
||||||
|
<OptimizationLevel Value="3"/>
|
||||||
|
</Optimizations>
|
||||||
|
</CodeGeneration>
|
||||||
|
<Linking>
|
||||||
|
<Debugging>
|
||||||
|
<GenerateDebugInfo Value="False"/>
|
||||||
|
<RunWithoutDebug Value="True"/>
|
||||||
|
</Debugging>
|
||||||
|
<LinkSmart Value="True"/>
|
||||||
|
<Options>
|
||||||
|
<Win32>
|
||||||
|
<GraphicApplication Value="True"/>
|
||||||
|
</Win32>
|
||||||
|
</Options>
|
||||||
|
</Linking>
|
||||||
|
</CompilerOptions>
|
||||||
|
</Item>
|
||||||
|
</BuildModes>
|
||||||
|
<PublishOptions>
|
||||||
|
<Version Value="2"/>
|
||||||
|
<UseFileFilters Value="True"/>
|
||||||
|
</PublishOptions>
|
||||||
|
<RunParams>
|
||||||
|
<FormatVersion Value="2"/>
|
||||||
|
</RunParams>
|
||||||
|
<RequiredPackages>
|
||||||
|
<Item>
|
||||||
|
<PackageName Value="LCL"/>
|
||||||
|
</Item>
|
||||||
|
</RequiredPackages>
|
||||||
|
<Units>
|
||||||
|
<Unit>
|
||||||
|
<Filename Value="b64.lpr"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
</Unit>
|
||||||
|
<Unit>
|
||||||
|
<Filename Value="main.pas"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<ComponentName Value="MainForm"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceBaseClass Value="Form"/>
|
||||||
|
</Unit>
|
||||||
|
</Units>
|
||||||
|
</ProjectOptions>
|
||||||
|
<CompilerOptions>
|
||||||
|
<Version Value="11"/>
|
||||||
|
<PathDelim Value="\"/>
|
||||||
|
<Target>
|
||||||
|
<Filename Value="b64"/>
|
||||||
|
</Target>
|
||||||
|
<SearchPaths>
|
||||||
|
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||||
|
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||||
|
</SearchPaths>
|
||||||
|
<Linking>
|
||||||
|
<Debugging>
|
||||||
|
<DebugInfoType Value="dsDwarf3"/>
|
||||||
|
</Debugging>
|
||||||
|
<Options>
|
||||||
|
<Win32>
|
||||||
|
<GraphicApplication Value="True"/>
|
||||||
|
</Win32>
|
||||||
|
</Options>
|
||||||
|
</Linking>
|
||||||
|
</CompilerOptions>
|
||||||
|
<Debugging>
|
||||||
|
<Exceptions>
|
||||||
|
<Item>
|
||||||
|
<Name Value="EAbort"/>
|
||||||
|
</Item>
|
||||||
|
<Item>
|
||||||
|
<Name Value="ECodetoolError"/>
|
||||||
|
</Item>
|
||||||
|
<Item>
|
||||||
|
<Name Value="EFOpenError"/>
|
||||||
|
</Item>
|
||||||
|
</Exceptions>
|
||||||
|
</Debugging>
|
||||||
|
</CONFIG>
|
26
b64.lpr
Normal file
26
b64.lpr
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
program b64;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
uses
|
||||||
|
{$IFDEF UNIX}
|
||||||
|
cthreads,
|
||||||
|
{$ENDIF}
|
||||||
|
{$IFDEF HASAMIGA}
|
||||||
|
athreads,
|
||||||
|
{$ENDIF}
|
||||||
|
Interfaces, // this includes the LCL widgetset
|
||||||
|
Forms, main
|
||||||
|
{ you can add units after this };
|
||||||
|
|
||||||
|
{$R *.res}
|
||||||
|
|
||||||
|
begin
|
||||||
|
RequireDerivedFormResource:=True;
|
||||||
|
Application.Title:='Base64 Converter';
|
||||||
|
Application.Scaled:=True;
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TMainForm, MainForm);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
||||||
|
|
78
main.lfm
Normal file
78
main.lfm
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
object MainForm: TMainForm
|
||||||
|
Left = 2194
|
||||||
|
Height = 374
|
||||||
|
Top = 238
|
||||||
|
Width = 467
|
||||||
|
Caption = 'Base64 Converter'
|
||||||
|
ClientHeight = 374
|
||||||
|
ClientWidth = 467
|
||||||
|
OnCreate = FormCreate
|
||||||
|
Position = poDesktopCenter
|
||||||
|
LCLVersion = '3.2.0.0'
|
||||||
|
object InputMemo: TMemo
|
||||||
|
AnchorSideBottom.Control = UISplitter
|
||||||
|
Left = 8
|
||||||
|
Height = 160
|
||||||
|
Top = 16
|
||||||
|
Width = 450
|
||||||
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object InputLabel: TLabel
|
||||||
|
Left = 8
|
||||||
|
Height = 15
|
||||||
|
Top = 0
|
||||||
|
Width = 28
|
||||||
|
Caption = 'Input'
|
||||||
|
end
|
||||||
|
object OutputLabel: TLabel
|
||||||
|
AnchorSideTop.Control = UISplitter
|
||||||
|
Left = 8
|
||||||
|
Height = 15
|
||||||
|
Top = 184
|
||||||
|
Width = 38
|
||||||
|
BorderSpacing.Top = 8
|
||||||
|
Caption = 'Output'
|
||||||
|
end
|
||||||
|
object OutputMemo: TMemo
|
||||||
|
AnchorSideTop.Control = UISplitter
|
||||||
|
Left = 8
|
||||||
|
Height = 132
|
||||||
|
Top = 200
|
||||||
|
Width = 450
|
||||||
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
|
BorderSpacing.Top = 24
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object EncodeButton: TButton
|
||||||
|
Left = 381
|
||||||
|
Height = 25
|
||||||
|
Top = 340
|
||||||
|
Width = 75
|
||||||
|
Anchors = [akRight, akBottom]
|
||||||
|
Caption = 'Encode'
|
||||||
|
TabOrder = 2
|
||||||
|
OnClick = EncodeButtonClick
|
||||||
|
end
|
||||||
|
object UISplitter: TSplitter
|
||||||
|
AnchorSideTop.Side = asrCenter
|
||||||
|
Cursor = crVSplit
|
||||||
|
Left = 8
|
||||||
|
Height = 8
|
||||||
|
Top = 176
|
||||||
|
Width = 450
|
||||||
|
Align = alNone
|
||||||
|
Anchors = [akTop, akLeft, akRight]
|
||||||
|
ResizeAnchor = akTop
|
||||||
|
end
|
||||||
|
object DecodeButton: TButton
|
||||||
|
Left = 301
|
||||||
|
Height = 25
|
||||||
|
Top = 340
|
||||||
|
Width = 75
|
||||||
|
Anchors = [akRight, akBottom]
|
||||||
|
Caption = 'Decode'
|
||||||
|
TabOrder = 4
|
||||||
|
OnClick = DecodeButtonClick
|
||||||
|
end
|
||||||
|
end
|
57
main.pas
Normal file
57
main.pas
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
unit main;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls, base64;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TMainForm }
|
||||||
|
|
||||||
|
TMainForm = class(TForm)
|
||||||
|
DecodeButton: TButton;
|
||||||
|
EncodeButton: TButton;
|
||||||
|
InputLabel: TLabel;
|
||||||
|
OutputLabel: TLabel;
|
||||||
|
InputMemo: TMemo;
|
||||||
|
OutputMemo: TMemo;
|
||||||
|
UISplitter: TSplitter;
|
||||||
|
procedure DecodeButtonClick(Sender: TObject);
|
||||||
|
procedure EncodeButtonClick(Sender: TObject);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
private
|
||||||
|
|
||||||
|
public
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
MainForm: TMainForm;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$R *.lfm}
|
||||||
|
|
||||||
|
{ TMainForm }
|
||||||
|
|
||||||
|
procedure TMainForm.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.EncodeButtonClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
OutputMemo.Text:= EncodeStringBase64(InputMemo.Text);
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.DecodeButtonClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
OutputMemo.Text:= DecodeStringBase64(InputMemo.Text);
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user