text stringlengths 14 6.51M |
|---|
unit BCEditor.Editor.LeftMargin.LineNumbers;
interface
uses
Classes, BCEditor.Types;
type
TBCEditorLeftMarginLineNumbers = class(TPersistent)
strict private
FAutosizeDigitCount: Integer;
FDigitCount: Integer;
FOnChange: TNotifyEvent;
FOptions: TBCEditorLeftMarginLineNumberOptions;
FStartFrom: Integer;
FVisible: Boolean;
procedure DoChange;
procedure SetDigitCount(Value: Integer);
procedure SetOptions(const Value: TBCEditorLeftMarginLineNumberOptions);
procedure SetStartFrom(const Value: Integer);
procedure SetVisible(const Value: Boolean);
public
constructor Create;
procedure Assign(Source: TPersistent); override;
property AutosizeDigitCount: Integer read FAutosizeDigitCount write FAutosizeDigitCount;
published
property DigitCount: Integer read FDigitCount write SetDigitCount default 4;
property OnChange: TNotifyEvent read FOnChange write FOnChange;
property Options: TBCEditorLeftMarginLineNumberOptions read FOptions write SetOptions default [lnoIntens];
property StartFrom: Integer read FStartFrom write SetStartFrom default 1;
property Visible: Boolean read FVisible write SetVisible default True;
end;
implementation
uses
BCEditor.Utils, Math;
const
MIN_DIGIT_COUNT = 2;
MAX_DIGIT_COUNT = 12;
{ TBCEditorLeftMarginLineNumbers }
constructor TBCEditorLeftMarginLineNumbers.Create;
begin
inherited;
FAutosizeDigitCount := 4;
FDigitCount := 4;
FOptions := [lnoIntens];
FStartFrom := 1;
FVisible := True;
end;
procedure TBCEditorLeftMarginLineNumbers.Assign(Source: TPersistent);
begin
if Assigned(Source) and (Source is TBCEditorLeftMarginLineNumbers) then
with Source as TBCEditorLeftMarginLineNumbers do
begin
Self.FAutosizeDigitCount := FAutosizeDigitCount;
Self.FDigitCount := FDigitCount;
Self.FOptions := FOptions;
Self.FStartFrom := FStartFrom;
Self.FVisible := FVisible;
Self.DoChange;
end
else
inherited;
end;
procedure TBCEditorLeftMarginLineNumbers.DoChange;
begin
if Assigned(FOnChange) then
FOnChange(Self);
end;
procedure TBCEditorLeftMarginLineNumbers.SetDigitCount(Value: Integer);
begin
Value := MinMax(Value, MIN_DIGIT_COUNT, MAX_DIGIT_COUNT);
if FDigitCount <> Value then
begin
FDigitCount := Value;
FAutosizeDigitCount := FDigitCount;
DoChange
end;
end;
procedure TBCEditorLeftMarginLineNumbers.SetOptions(const Value: TBCEditorLeftMarginLineNumberOptions);
begin
if Value <> FOptions then
begin
FOptions := Value;
DoChange
end;
end;
procedure TBCEditorLeftMarginLineNumbers.SetStartFrom(const Value: Integer);
begin
if Value <> FStartFrom then
begin
FStartFrom := Value;
if FStartFrom < 0 then
FStartFrom := 0;
DoChange
end;
end;
procedure TBCEditorLeftMarginLineNumbers.SetVisible(const Value: Boolean);
begin
if Value <> FVisible then
begin
FVisible := Value;
DoChange
end;
end;
end.
|
unit Unit2;
interface
type
tParams = class
class procedure save;
class procedure load;
class function getValue(key: string; default: string): string; overload;
class function getValue(key: string; default: boolean): boolean; overload;
class function getValue(key: string; default: integer): integer; overload;
class procedure setValue(key, value: string); overload;
class procedure setValue(key: string; value: boolean); overload;
class procedure setValue(key: string; value: integer); overload;
end;
implementation
uses
System.Generics.collections, System.IOUtils, System.SysUtils, System.JSON, System.Classes;
var
paramList : TJSONObject;
paramChanged: boolean;
function getParamsFileName: string;
var
folder : string;
filename: string;
app_name: string;
begin
app_name := TPath.GetFileNameWithoutExtension(paramstr(0));
folder := TPath.Combine(TPath.GetDocumentsPath, app_name);
if not tdirectory.Exists(folder) then
tdirectory.CreateDirectory(folder);
filename := app_name + '.json';
result := TPath.Combine(folder, filename);
end;
function getParamValue(key: string): TJSONValue;
begin
result := nil;
if assigned(paramList) then
if (paramList.Count > 0) then
result := paramList.getValue(key);
end;
procedure setParamValue(key: string; value: TJSONValue);
var
jsonvalue: TJSONValue;
begin
if not assigned(paramList) then
paramList := TJSONObject.Create
else if (paramList.Count > 0) then
begin
jsonvalue := paramList.getValue(key);
if assigned(paramList.getValue(key)) then
if (jsonvalue.value <> value.value) then
paramList.RemovePair(key).Free
else
exit;
end;
paramList.AddPair(key, value);
paramChanged := true;
end;
class function tParams.getValue(key: string; default: boolean): boolean;
var
jsonvalue: TJSONValue;
begin
jsonvalue := getParamValue(key);
if assigned(jsonvalue) then
result := jsonvalue.value.ToBoolean
else
result := default;
end;
class function tParams.getValue(key: string; default: string): string;
var
jsonvalue: TJSONValue;
begin
jsonvalue := getParamValue(key);
if assigned(jsonvalue) then
result := jsonvalue.value
else
result := default;
end;
class function tParams.getValue(key: string; default: integer): integer;
var
jsonvalue: TJSONValue;
begin
jsonvalue := getParamValue(key);
if assigned(jsonvalue) then
result := jsonvalue.value.ToInteger
else
result := default;
end;
class procedure tParams.load;
var
filename: string;
buffer : tStringStream;
begin
filename := getParamsFileName;
if tfile.Exists(filename) then
begin
if assigned(paramList) then
FreeAndNil(paramList);
buffer := tStringStream.Create(tfile.ReadAllText(filename, TEncoding.UTF8), TEncoding.UTF8);
try
paramList := TJSONObject.Create;
paramList.Parse(buffer.Bytes, 0);
finally
buffer.Free;
end;
end;
end;
class procedure tParams.save;
var
filename: string;
begin
if (paramChanged) then
begin
filename := getParamsFileName;
if assigned(paramList) and (paramList.Count > 0) then
tfile.WriteAllText(filename, paramList.ToJSON, TEncoding.UTF8)
else if tfile.Exists(filename) then
tfile.Delete(filename);
paramChanged := false;
end;
end;
class procedure tParams.setValue(key, value: string);
var
jsonvalue: TJSONString;
begin
jsonvalue := TJSONString.Create(value);
try
setParamValue(key, jsonvalue);
except
jsonvalue.Free;
end;
end;
class procedure tParams.setValue(key: string; value: boolean);
var
jsonvalue: TJSONBool;
begin
jsonvalue := TJSONBool.Create(value);
try
setParamValue(key, jsonvalue);
except
jsonvalue.Free;
end;
end;
class procedure tParams.setValue(key: string; value: integer);
var
jsonvalue: TJSONNumber;
begin
jsonvalue := TJSONNumber.Create(value);
try
setParamValue(key, jsonvalue);
except
jsonvalue.Free;
end;
end;
initialization
paramChanged := false;
paramList := TJSONObject.Create;
tParams.load;
finalization
tParams.save;
if assigned(paramList) then
FreeAndNil(paramList);
end.
|
unit iTunesClient;
interface
uses
SysUtils, Classes, httpsend, ssl_openssl;
type
TiTunesClient = class(TObject)
private
Session: String;
public
constructor Create(Session: String);
function Search(term, country: String; limit: Integer = 5; media: String = 'software'): String;
function Lookup(bundleId, country: String; limit: Integer = 1; media: String = 'software'): String;
end;
implementation
uses
HTTPUtils;
{ TiTunesClient }
constructor TiTunesClient.Create(Session: String);
begin
inherited Create;
end;
function TiTunesClient.Lookup(bundleId, country: String; limit: Integer;
media: String): String;
var
HTTP: THTTPSend;
MethodRes: Boolean;
Response: TStringList;
Params: String;
begin
HTTP := THTTPSend.Create;
Response := TStringList.Create;
try
HTTP.MimeType := 'application/x-www-form-urlencoded';
Params := '';
AddParams(Params, 'bundleId', bundleId);
AddParams(Params, 'country', country);
AddParams(Params, 'limit', IntToStr(limit));
AddParams(Params, 'media', media);
MethodRes := HTTP.HTTPMethod('GET', 'https://itunes.apple.com/lookup?'+Params);
if MethodRes then
begin
{$IFDEF FPC}
Response.LoadFromStream(HTTP.Document);
{$ELSE}
Response.LoadFromStream(HTTP.Document, TEncoding.UTF8);
{$ENDIF}
Result := Response.Text;
end;
finally
Response.Free;
HTTP.Free;
end;
end;
function TiTunesClient.Search(term, country: String; limit: Integer;
media: String): String;
var
HTTP: THTTPSend;
MethodRes: Boolean;
Response: TStringList;
Params: String;
begin
HTTP := THTTPSend.Create;
Response := TStringList.Create;
try
HTTP.MimeType := 'application/x-www-form-urlencoded';
Params := '';
AddParams(Params, 'term', term);
AddParams(Params, 'country', country);
AddParams(Params, 'limit', IntToStr(limit));
AddParams(Params, 'media', media);
MethodRes := HTTP.HTTPMethod('GET', 'https://itunes.apple.com/search?'+Params);
if MethodRes then
begin
{$IFDEF FPC}
Response.LoadFromStream(HTTP.Document);
{$ELSE}
Response.LoadFromStream(HTTP.Document, TEncoding.UTF8);
{$ENDIF}
Result := Response.Text;
end;
finally
Response.Free;
HTTP.Free;
end;
end;
end.
|
unit LCVectorialFillControl;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Controls, LCVectorialFillInterface,
LCVectorialFill, BGRABitmap, BGRABitmapTypes, BGRAGradientScanner,
LCVectorOriginal;
type
TLCFillTarget = LCVectorialFillInterface.TLCFillTarget;
const
ftPen = LCVectorialFillInterface.ftPen;
ftBack = LCVectorialFillInterface.ftBack;
ftOutline = LCVectorialFillInterface.ftOutline;
type
{ TLCVectorialFillControl }
TLCVectorialFillControl = class(TWinControl)
private
function GetCanAdjustToShape: boolean;
function GetFillType: TVectorialFillType;
function GetGradEndColor: TBGRAPixel;
function GetGradInterp: TBGRAColorInterpolation;
function GetGradRepetition: TBGRAGradientRepetition;
function GetGradStartColor: TBGRAPixel;
function GetGradType: TGradientType;
function GetSolidColor: TBGRAPixel;
function GetTexOpacity: byte;
function GetTexRepetition: TTextureRepetition;
function GetTexture: TBGRABitmap;
function GetToolIconSize: integer;
procedure SetCanAdjustToShape(AValue: boolean);
procedure SetFillType(AValue: TVectorialFillType);
procedure SetGradEndColor(AValue: TBGRAPixel);
procedure SetGradientType(AValue: TGradientType);
procedure SetGradInterpolation(AValue: TBGRAColorInterpolation);
procedure SetGradRepetition(AValue: TBGRAGradientRepetition);
procedure SetGradStartColor(AValue: TBGRAPixel);
procedure SetSolidColor(AValue: TBGRAPixel);
procedure SetTexture(AValue: TBGRABitmap);
procedure SetTextureOpacity(AValue: byte);
procedure SetTextureRepetition(AValue: TTextureRepetition);
procedure SetToolIconSize(AValue: integer);
protected
FInterface: TVectorialFillInterface;
FOnAdjustToShape: TNotifyEvent;
FOnFillChange: TNotifyEvent;
FOnFillTypeChange: TNotifyEvent;
FOnTextureChange: TNotifyEvent;
procedure CalculatePreferredSize(var PreferredWidth, PreferredHeight: integer;
{%H-}WithThemeSpace: Boolean); override;
procedure DoOnAdjustToShape(Sender: TObject);
procedure DoOnFillChange(Sender: TObject);
procedure DoOnFillTypeChange(Sender: TObject);
procedure DoOnTextureChange(Sender: TObject);
procedure DoOnResize; override;
public
constructor Create(TheOwner: TComponent); override;
destructor Destroy; override;
procedure AssignFill(AFill: TVectorialFill);
function CreateShapeFill(AShape: TVectorShape): TVectorialFill;
procedure UpdateShapeFill(AShape: TVectorShape; ATarget: TLCFillTarget);
property FillType: TVectorialFillType read GetFillType write SetFillType;
property SolidColor: TBGRAPixel read GetSolidColor write SetSolidColor;
property GradientType: TGradientType read GetGradType write SetGradientType;
property GradStartColor: TBGRAPixel read GetGradStartColor write SetGradStartColor;
property GradEndColor: TBGRAPixel read GetGradEndColor write SetGradEndColor;
property GradRepetition: TBGRAGradientRepetition read GetGradRepetition write SetGradRepetition;
property GradInterpolation: TBGRAColorInterpolation read GetGradInterp write SetGradInterpolation;
property Texture: TBGRABitmap read GetTexture write SetTexture;
property TextureRepetition: TTextureRepetition read GetTexRepetition write SetTextureRepetition;
property TextureOpacity: byte read GetTexOpacity write SetTextureOpacity;
property CanAdjustToShape: boolean read GetCanAdjustToShape write SetCanAdjustToShape;
property OnFillChange: TNotifyEvent read FOnFillChange write FOnFillChange;
property OnTextureChange: TNotifyEvent read FOnTextureChange write FOnTextureChange;
property OnAdjustToShape: TNotifyEvent read FOnAdjustToShape write FOnAdjustToShape;
property OnFillTypeChange: TNotifyEvent read FOnFillTypeChange write FOnFillTypeChange;
published
property AutoSize;
property Align;
property Enabled;
property Visible;
property ToolIconSize: integer read GetToolIconSize write SetToolIconSize;
end;
procedure Register;
implementation
uses Types;
procedure Register;
begin
RegisterComponents('Lazpaint Controls', [TLCVectorialFillControl]);
end;
{ TLCVectorialFillControl }
function TLCVectorialFillControl.GetCanAdjustToShape: boolean;
begin
result := FInterface.CanAdjustToShape;
end;
function TLCVectorialFillControl.GetFillType: TVectorialFillType;
begin
result := FInterface.FillType;
end;
function TLCVectorialFillControl.GetGradEndColor: TBGRAPixel;
begin
result := FInterface.GradEndColor;
end;
function TLCVectorialFillControl.GetGradInterp: TBGRAColorInterpolation;
begin
result := FInterface.GradInterpolation;
end;
function TLCVectorialFillControl.GetGradRepetition: TBGRAGradientRepetition;
begin
result := FInterface.GradRepetition;
end;
function TLCVectorialFillControl.GetGradStartColor: TBGRAPixel;
begin
result := FInterface.GradStartColor;
end;
function TLCVectorialFillControl.GetGradType: TGradientType;
begin
result := FInterface.GradientType;
end;
function TLCVectorialFillControl.GetSolidColor: TBGRAPixel;
begin
result := FInterface.SolidColor;
end;
function TLCVectorialFillControl.GetTexOpacity: byte;
begin
result := FInterface.TextureOpacity;
end;
function TLCVectorialFillControl.GetTexRepetition: TTextureRepetition;
begin
result := FInterface.TextureRepetition;
end;
function TLCVectorialFillControl.GetTexture: TBGRABitmap;
begin
result := FInterface.Texture;
end;
function TLCVectorialFillControl.GetToolIconSize: integer;
begin
result := FInterface.ImageListSize.cy;
end;
procedure TLCVectorialFillControl.SetCanAdjustToShape(AValue: boolean);
begin
FInterface.CanAdjustToShape := AValue;
end;
procedure TLCVectorialFillControl.SetFillType(AValue: TVectorialFillType);
begin
FInterface.FillType := AValue;
end;
procedure TLCVectorialFillControl.SetGradEndColor(AValue: TBGRAPixel);
begin
FInterface.GradEndColor := AValue;
end;
procedure TLCVectorialFillControl.SetGradientType(AValue: TGradientType);
begin
FInterface.GradientType := AValue;
end;
procedure TLCVectorialFillControl.SetGradInterpolation(
AValue: TBGRAColorInterpolation);
begin
FInterface.GradInterpolation := AValue;
end;
procedure TLCVectorialFillControl.SetGradRepetition(
AValue: TBGRAGradientRepetition);
begin
FInterface.GradRepetition := AValue;
end;
procedure TLCVectorialFillControl.SetGradStartColor(AValue: TBGRAPixel);
begin
FInterface.GradStartColor := AValue;
end;
procedure TLCVectorialFillControl.SetSolidColor(AValue: TBGRAPixel);
begin
FInterface.SolidColor := AValue;
end;
procedure TLCVectorialFillControl.SetTexture(AValue: TBGRABitmap);
begin
FInterface.Texture := AValue;
end;
procedure TLCVectorialFillControl.SetTextureOpacity(AValue: byte);
begin
FInterface.TextureOpacity := AValue;
end;
procedure TLCVectorialFillControl.SetTextureRepetition(
AValue: TTextureRepetition);
begin
FInterface.TextureRepetition := AValue;
end;
procedure TLCVectorialFillControl.SetToolIconSize(AValue: integer);
begin
FInterface.ImageListSize := Size(AValue,AValue);
end;
procedure TLCVectorialFillControl.CalculatePreferredSize(var PreferredWidth,
PreferredHeight: integer; WithThemeSpace: Boolean);
begin
with FInterface.PreferredSize do
begin
PreferredWidth := cx;
PreferredHeight := cy;
end;
end;
procedure TLCVectorialFillControl.DoOnAdjustToShape(Sender: TObject);
begin
if Assigned(FOnAdjustToShape) then FOnAdjustToShape(self);
end;
procedure TLCVectorialFillControl.DoOnFillChange(Sender: TObject);
begin
if Assigned(FOnFillChange) then FOnFillChange(self);
end;
procedure TLCVectorialFillControl.DoOnFillTypeChange(Sender: TObject);
begin
InvalidatePreferredSize;
AdjustSize;
if Assigned(FOnFillTypeChange) then FOnFillTypeChange(self);
end;
procedure TLCVectorialFillControl.DoOnTextureChange(Sender: TObject);
begin
if Assigned(FOnTextureChange) then FOnTextureChange(self);
end;
procedure TLCVectorialFillControl.DoOnResize;
begin
inherited DoOnResize;
FInterface.LoadImageList;
FInterface.ContainerSizeChanged;
end;
constructor TLCVectorialFillControl.Create(TheOwner: TComponent);
begin
inherited Create(TheOwner);
FInterface := TVectorialFillInterface.Create(nil, 16,16);
FInterface.OnFillChange:=@DoOnFillChange;
FInterface.OnTextureChange:=@DoOnTextureChange;
FInterface.OnAdjustToShape:=@DoOnAdjustToShape;
FInterface.OnFillTypeChange:=@DoOnFillTypeChange;
FInterface.Container := self;
end;
destructor TLCVectorialFillControl.Destroy;
begin
FreeAndNil(FInterface);
inherited Destroy;
end;
procedure TLCVectorialFillControl.AssignFill(AFill: TVectorialFill);
begin
FInterface.AssignFill(AFill);
end;
function TLCVectorialFillControl.CreateShapeFill(AShape: TVectorShape): TVectorialFill;
begin
result := FInterface.CreateShapeFill(AShape);
end;
procedure TLCVectorialFillControl.UpdateShapeFill(AShape: TVectorShape;
ATarget: TLCFillTarget);
begin
FInterface.UpdateShapeFill(AShape, ATarget);
end;
end.
|
unit uMarketing;
{$mode objfpc}{$H+}
interface
uses
SynCommons, mORMot, uForwardDeclaration;//Classes, SysUtils;
type
// 1
TSQLMarketingCampaign = class(TSQLRecord)
private
fParentCampaign: TSQLMarketingCampaignID;
fStatus: TSQLStatusItemID;
fCampaignName: RawUTF8;
fCampaignSummary: RawUTF8;
fBudgetedCost: Currency;
fActualCost: Currency;
fEstimatedCost: Currency;
fCurrencyUom: TSQLUomID;
fFromDate: TDateTime;
fThruDate: TDateTime;
fIsActive: Boolean;
fConvertedLeads: Integer;
fExpectedResponsePercent: Double;
fExpectedRevenue: Currency;
fNumSent: Integer;
fStartDate: TDateTime;
fCreatedByUserLogin: TSQLUserLoginID;
fLastModifiedByUserLogin: TSQLUserLoginID;
published
property ParentCampaign: TSQLMarketingCampaignID read fParentCampaign write fParentCampaign;
property Status: TSQLStatusItemID read fStatus write fStatus;
property CampaignName: RawUTF8 read fCampaignName write fCampaignName;
property CampaignSummary: RawUTF8 read fCampaignSummary write fCampaignSummary;
property BudgetedCost: Currency read fBudgetedCost write fBudgetedCost;
property ActualCost: Currency read fActualCost write fActualCost;
property EstimatedCost: Currency read fEstimatedCost write fEstimatedCost;
property CurrencyUom: TSQLUomID read fCurrencyUom write fCurrencyUom;
property FromDate: TDateTime read fFromDate write fFromDate;
property ThruDate: TDateTime read fThruDate write fThruDate;
property IsActive: Boolean read fIsActive write fIsActive;
property ConvertedLeads: Integer read fConvertedLeads write fConvertedLeads;
property ExpectedResponsePercent: Double read fExpectedResponsePercent write fExpectedResponsePercent;
property ExpectedRevenue: Currency read fExpectedRevenue write fExpectedRevenue;
property NumSent: Integer read fNumSent write fNumSent;
property StartDate: TDateTime read fStartDate write fStartDate;
property CreatedByUserLogin: TSQLUserLoginID read fCreatedByUserLogin write fCreatedByUserLogin;
property LastModifiedByUserLogin: TSQLUserLoginID read fLastModifiedByUserLogin write fLastModifiedByUserLogin;
end;
// 2
TSQLMarketingCampaignNote = class(TSQLRecord)
private
fMarketingCampaign: TSQLMarketingCampaignID;
fNote: TSQLNoteDataID;
published
property MarketingCampaign: TSQLMarketingCampaignID read fMarketingCampaign write fMarketingCampaign;
property Note: TSQLNoteDataID read fNote write fNote;
end;
// 3
TSQLMarketingCampaignPrice = class(TSQLRecord)
private
fMarketingCampaign: TSQLMarketingCampaignID;
fProductPriceRule: TSQLProductPriceRuleID;
fFromDate: TDateTime;
fThruDate: TDateTime;
published
property MarketingCampaign: TSQLMarketingCampaignID read fMarketingCampaign write fMarketingCampaign;
property ProductPriceRule: TSQLProductPriceRuleID read fProductPriceRule write fProductPriceRule;
property FromDate: TDateTime read fFromDate write fFromDate;
property ThruDate: TDateTime read fThruDate write fThruDate;
end;
// 4
TSQLMarketingCampaignPromo = class(TSQLRecord)
private
fMarketingCampaign: TSQLMarketingCampaignID;
fProductPromo: TSQLProductPromoID;
fFromDate: TDateTime;
fThruDate: TDateTime;
published
property MarketingCampaign: TSQLMarketingCampaignID read fMarketingCampaign write fMarketingCampaign;
property ProductPromo: TSQLProductPromoID read fProductPromo write fProductPromo;
property FromDate: TDateTime read fFromDate write fFromDate;
property ThruDate: TDateTime read fThruDate write fThruDate;
end;
// 5
TSQLMarketingCampaignRole = class(TSQLRecord)
private
fMarketingCampaign: TSQLMarketingCampaignID;
fParty: TSQLPartyID;
fRoleType: TSQLRoleTypeID;
fFromDate: TDateTime;
fThruDate: TDateTime;
published
property MarketingCampaign: TSQLMarketingCampaignID read fMarketingCampaign write fMarketingCampaign;
property Party: TSQLPartyID read fParty write fParty;
property RoleType: TSQLRoleTypeID read fRoleType write fRoleType;
property FromDate: TDateTime read fFromDate write fFromDate;
property ThruDate: TDateTime read fThruDate write fThruDate;
end;
// 6
TSQLContactList = class(TSQLRecord)
private
fContactListType: TSQLContactListTypeID;
fContactMechType: TSQLContactMechTypeID;
fMarketingCampaign: TSQLMarketingCampaignID;
fContactListName: RawUTF8;
fDescription: RawUTF8;
fComments: RawUTF8;
fIsPublic: Boolean;
fSingleUse: Boolean;
fOwnerParty: TSQLPartyID;
fVerifyEmailFrom: RawUTF8;
fVerifyEmailScreen: RawUTF8;
fVerifyEmailSubject: RawUTF8;
fVerifyEmailWebSite: Integer;
fOptOutScreen: RawUTF8;
fCreatedByUserLogin: TSQLUserLoginID;
fLastModifiedByUserLogin: TSQLUserLoginID;
published
property ContactListType: TSQLContactListTypeID read fContactListType write fContactListType;
property ContactMechType: TSQLContactMechTypeID read fContactMechType write fContactMechType;
property MarketingCampaign: TSQLMarketingCampaignID read fMarketingCampaign write fMarketingCampaign;
property ContactListName: RawUTF8 read fContactListName write fContactListName;
property Description: RawUTF8 read fDescription write fDescription;
property Comments: RawUTF8 read fComments write fComments;
property IsPublic: Boolean read fIsPublic write fIsPublic;
property SingleUse: Boolean read fSingleUse write fSingleUse;
property OwnerParty: TSQLPartyID read fOwnerParty write fOwnerParty;
property VerifyEmailFrom: RawUTF8 read fVerifyEmailFrom write fVerifyEmailFrom;
property VerifyEmailScreen: RawUTF8 read fVerifyEmailScreen write fVerifyEmailScreen;
property VerifyEmailSubject: RawUTF8 read fVerifyEmailSubject write fVerifyEmailSubject;
property VerifyEmailWebSite: Integer read fVerifyEmailWebSite write fVerifyEmailWebSite;
property OptOutScreen: RawUTF8 read fOptOutScreen write fOptOutScreen;
property CreatedByUserLogin: TSQLUserLoginID read fCreatedByUserLogin write fCreatedByUserLogin;
property LastModifiedByUserLogin: TSQLUserLoginID read fLastModifiedByUserLogin write fLastModifiedByUserLogin;
end;
// 7
TSQLWebSiteContactList = class(TSQLRecord)
private
fWebSite: TSQLWebSiteID;
fContactList: TSQLContactListID;
fFromDate: TDateTime;
fThruDate: TDateTime;
published
property WebSite: TSQLWebSiteID read fWebSite write fWebSite;
property ContactList: TSQLContactListID read fContactList write fContactList;
property FromDate: TDateTime read fFromDate write fFromDate;
property ThruDate: TDateTime read fThruDate write fThruDate;
end;
// 8
TSQLContactListCommStatus = class(TSQLRecord)
private
fContactList: TSQLContactListID;
fCommunicationEvent: TSQLCommunicationEventID;
fContactMech: TSQLContactMechID;
fParty: TSQLPartyID;
fMessage: RawUTF8;
fStatus: TSQLStatusItemID;
fChangeByUserLogin: TSQLUserLoginID;
published
property ContactList: TSQLContactListID read fContactList write fContactList;
property CommunicationEvent: TSQLCommunicationEventID read fCommunicationEvent write fCommunicationEvent;
property ContactMech: TSQLContactMechID read fContactMech write fContactMech;
property Party: TSQLPartyID read fParty write fParty;
property Message: RawUTF8 read fMessage write fMessage;
property Status: TSQLStatusItemID read fStatus write fStatus;
property ChangeByUserLogin: TSQLUserLoginID read fChangeByUserLogin write fChangeByUserLogin;
end;
// 9
TSQLContactListParty = class(TSQLRecord)
private
fContactList: TSQLContactListID;
fParty: TSQLPartyID;
fFromDate: TDateTime;
fThruDate: TDateTime;
fStatus: TSQLStatusItemID;
fpreferredContactMech: TSQLContactMechID;
published
property ContactList: TSQLContactListID read fContactList write fContactList;
property Party: TSQLPartyID read fParty write fParty;
property FromDate: TDateTime read fFromDate write fFromDate;
property ThruDate: TDateTime read fThruDate write fThruDate;
property Status: TSQLStatusItemID read fStatus write fStatus;
property preferredContactMech: TSQLContactMechID read fpreferredContactMech write fpreferredContactMech;
end;
// 10
TSQLContactListPartyStatus = class(TSQLRecord)
private
fContactList: TSQLContactListID;
fParty: TSQLPartyID;
fFromDate: TDateTime;
fThruDate: TDateTime;
fStatus: TSQLStatusItemID;
fSetByUserLogin: TSQLUserLoginID;
fOptInVerifyCode: RawUTF8;
published
property ContactList: TSQLContactListID read fContactList write fContactList;
property Party: TSQLPartyID read fParty write fParty;
property FromDate: TDateTime read fFromDate write fFromDate;
property ThruDate: TDateTime read fThruDate write fThruDate;
property Status: TSQLStatusItemID read fStatus write fStatus;
property SetByUserLogin: TSQLUserLoginID read fSetByUserLogin write fSetByUserLogin;
property OptInVerifyCode: RawUTF8 read fOptInVerifyCode write fOptInVerifyCode;
end;
// 11
TSQLContactListType = class(TSQLRecord)
private
fName: RawUTF8;
fDescription: RawUTF8;
published
property Name: RawUTF8 read fName write fName;
property Description: RawUTF8 read fDescription write fDescription;
end;
// 12
TSQLSegmentGroup = class(TSQLRecord)
private
fSegmentGroupType: TSQLSegmentGroupTypeID;
fDescription: RawUTF8;
fProductStore: TSQLProductStoreID;
published
property SegmentGroupType: TSQLSegmentGroupTypeID read fSegmentGroupType write fSegmentGroupType;
property Description: RawUTF8 read fDescription write fDescription;
property ProductStore: TSQLProductStoreID read fProductStore write fProductStore;
end;
// 13
TSQLSegmentGroupClassification = class(TSQLRecord)
private
fSegmentGroup: TSQLSegmentGroupID;
fPartyClassificationGroup: TSQLPartyClassificationGroupID;
published
property SegmentGroup: TSQLSegmentGroupID read fSegmentGroup write fSegmentGroup;
property PartyClassificationGroup: TSQLPartyClassificationGroupID read fPartyClassificationGroup write fPartyClassificationGroup;
end;
// 14
TSQLSegmentGroupGeo = class(TSQLRecord)
private
fSegmentGroup: TSQLSegmentGroupID;
fGeo: TSQLGeoID;
published
property SegmentGroup: TSQLSegmentGroupID read fSegmentGroup write fSegmentGroup;
property Geo: TSQLGeoID read fGeo write fGeo;
end;
// 15
TSQLSegmentGroupRole = class(TSQLRecord)
private
fSegmentGroup: TSQLSegmentGroupID;
fParty: TSQLPartyID;
fRoleType: TSQLRoleTypeID;
published
property SegmentGroup: TSQLSegmentGroupID read fSegmentGroup write fSegmentGroup;
property Party: TSQLPartyID read fParty write fParty;
property RoleType: TSQLRoleTypeID read fRoleType write fRoleType;
end;
// 16
TSQLSegmentGroupType = class(TSQLRecord)
private
fName: RawUTF8;
fDescription: RawUTF8;
published
property Name: RawUTF8 read fName write fName;
property Description: RawUTF8 read fDescription write fDescription;
end;
// 17
TSQLTrackingCode = class(TSQLRecord)
private
fTrackingCodeType: TSQLTrackingCodeTypeID;
fMarketingCampaign: TSQLMarketingCampaignID;
fRedirectUrl: RawUTF8;
fOverrideLogo: RawUTF8;
fOverrideCss: RawUTF8;
fProdCatalogId: Integer;
fComments: RawUTF8;
fDescription: RawUTF8;
fTrackableLifetime: Integer;
fBillableLifetime: Integer;
fFromDate: TDateTime;
fThruDate: TDateTime;
fGroupId: Integer;
fSubgroupId: Integer;
fCreatedDate: TDateTime;
fCreatedByUserLogin: TSQLUserLoginID;
fLastModifiedDate: TDateTime;
fLastModifiedByUserLogin: TSQLUserLoginID;
published
property TrackingCodeType: TSQLTrackingCodeTypeID read fTrackingCodeType write fTrackingCodeType;
property MarketingCampaign: TSQLMarketingCampaignID read fMarketingCampaign write fMarketingCampaign;
property RedirectUrl: RawUTF8 read fRedirectUrl write fRedirectUrl;
property OverrideLogo: RawUTF8 read fOverrideLogo write fOverrideLogo;
property OverrideCss: RawUTF8 read fOverrideCss write fOverrideCss;
property ProdCatalogId: Integer read fProdCatalogId write fProdCatalogId;
property Comments: RawUTF8 read fComments write fComments;
property Description: RawUTF8 read fDescription write fDescription;
property TrackableLifetime: Integer read fTrackableLifetime write fTrackableLifetime;
property BillableLifetime: Integer read fBillableLifetime write fBillableLifetime;
property FromDate: TDateTime read fFromDate write fFromDate;
property ThruDate: TDateTime read fThruDate write fThruDate;
property GroupId: Integer read fGroupId write fGroupId;
property SubgroupId: Integer read fSubgroupId write fSubgroupId;
property CreatedDate: TDateTime read fCreatedDate write fCreatedDate;
property CreatedByUserLogin: TSQLUserLoginID read fCreatedByUserLogin write fCreatedByUserLogin;
property LastModifiedDate: TDateTime read fLastModifiedDate write fLastModifiedDate;
property LastModifiedByUserLogin: TSQLUserLoginID read fLastModifiedByUserLogin write fLastModifiedByUserLogin;
end;
// 18
TSQLTrackingCodeOrder = class(TSQLRecord)
private
fOrderId: TSQLOrderHeaderID;
fTrackingCodeType: TSQLTrackingCodeTypeID;
fTrackingCode: TSQLTrackingCodeID;
fIsBillable: Boolean;
fSiteId: RawUTF8;
fHasExported: Boolean;
fAffiliateReferredTimeStamp: TDateTime;
published
property OrderId: TSQLOrderHeaderID read fOrderId write fOrderId;
property TrackingCodeType: TSQLTrackingCodeTypeID read fTrackingCodeType write fTrackingCodeType;
property TrackingCode: TSQLTrackingCodeID read fTrackingCode write fTrackingCode;
property IsBillable: Boolean read fIsBillable write fIsBillable;
property SiteId: RawUTF8 read fSiteId write fSiteId;
property HasExported: Boolean read fHasExported write fHasExported;
property AffiliateReferredTimeStamp: TDateTime read fAffiliateReferredTimeStamp write fAffiliateReferredTimeStamp;
end;
// 19
TSQLTrackingCodeOrderReturn = class(TSQLRecord)
private
fReturnId: TSQLReturnHeaderID;
fOrderId: TSQLOrderHeaderID;
fOrderItemSeqId: Integer;
fTrackingCodeType: TSQLTrackingCodeTypeID;
fTrackingCode: TSQLTrackingCodeID;
fIsBillable: Boolean;
fSiteId: RawUTF8;
fHasExported: Boolean;
fAffiliateReferredTimeStamp: TDateTime;
published
property ReturnId: TSQLReturnHeaderID read fReturnId write fReturnId;
property OrderId: TSQLOrderHeaderID read fOrderId write fOrderId;
property OrderItemSeqId: Integer read fOrderItemSeqId write fOrderItemSeqId;
property TrackingCodeType: TSQLTrackingCodeTypeID read fTrackingCodeType write fTrackingCodeType;
property TrackingCode: TSQLTrackingCodeID read fTrackingCode write fTrackingCode;
property IsBillable: Boolean read fIsBillable write fIsBillable;
property SiteId: RawUTF8 read fSiteId write fSiteId;
property HasExported: Boolean read fHasExported write fHasExported;
property AffiliateReferredTimeStamp: TDateTime read fAffiliateReferredTimeStamp write fAffiliateReferredTimeStamp;
end;
// 20
TSQLTrackingCodeType = class(TSQLRecord)
private
fName: RawUTF8;
fDescription: RawUTF8;
published
property Name: RawUTF8 read fName write fName;
property Description: RawUTF8 read fDescription write fDescription;
end;
// 21
TSQLTrackingCodeVisit = class(TSQLRecord)
private
fTrackingCode: TSQLTrackingCodeID;
fVisitId: Integer;
fFromDate: TDateTime;
fSourceEnum: TSQLEnumerationID;
published
property TrackingCode: TSQLTrackingCodeID read fTrackingCode write fTrackingCode;
property VisitId: Integer read fVisitId write fVisitId;
property FromDate: TDateTime read fFromDate write fFromDate;
property SourceEnum: TSQLEnumerationID read fSourceEnum write fSourceEnum;
end;
// 22
TSQLSalesOpportunity = class(TSQLRecord)
private
fOpportunityName: RawUTF8;
fDescription: RawUTF8;
fNextStep: TSQLRawBlob;
fNextStepDate: TDateTime;
fEstimatedAmount: Currency;
fEstimatedProbability: Double;
fCurrencyUom: TSQLUomID;
fMarketingCampaign: TSQLMarketingCampaignID;
fDataSourceId: Integer;
fEstimatedCloseDate: TDateTime;
fOpportunityStage: TSQLSalesOpportunityStageID;
fTypeEnum: TSQLEnumerationID;
fCreatedByUserLogin: TSQLUserLoginID;
published
property OpportunityName: RawUTF8 read fOpportunityName write fOpportunityName;
property Description: RawUTF8 read fDescription write fDescription;
property NextStep: TSQLRawBlob read fNextStep write fNextStep;
property NextStepDate: TDateTime read fNextStepDate write fNextStepDate;
property EstimatedAmount: Currency read fEstimatedAmount write fEstimatedAmount;
property EstimatedProbability: Double read fEstimatedProbability write fEstimatedProbability;
property CurrencyUom: TSQLUomID read fCurrencyUom write fCurrencyUom;
property MarketingCampaign: TSQLMarketingCampaignID read fMarketingCampaign write fMarketingCampaign;
property DataSourceId: Integer read fDataSourceId write fDataSourceId;
property EstimatedCloseDate: TDateTime read fEstimatedCloseDate write fEstimatedCloseDate;
property OpportunityStage: TSQLSalesOpportunityStageID read fOpportunityStage write fOpportunityStage;
property TypeEnum: TSQLEnumerationID read fTypeEnum write fTypeEnum;
property CreatedByUserLogin: TSQLUserLoginID read fCreatedByUserLogin write fCreatedByUserLogin;
end;
// 23
TSQLSalesOpportunityHistory = class(TSQLRecord)
private
fSalesOpportunity: TSQLSalesOpportunityID;
fDescription: RawUTF8;
fNextStep: TSQLRawBlob;
fEstimatedAmount: Currency;
fEstimatedProbability: Double;
fCurrencyUom: TSQLUomID;
fEstimatedCloseDate: TDateTime;
fOpportunityStage: TSQLSalesOpportunityStageID;
fChangeNote: TSQLRawBlob;
published
property SalesOpportunity: TSQLSalesOpportunityID read fSalesOpportunity write fSalesOpportunity;
property Description: RawUTF8 read fDescription write fDescription;
property NextStep: TSQLRawBlob read fNextStep write fNextStep;
property EstimatedAmount: Currency read fEstimatedAmount write fEstimatedAmount;
property EstimatedProbability: Double read fEstimatedProbability write fEstimatedProbability;
property CurrencyUom: TSQLUomID read fCurrencyUom write fCurrencyUom;
property EstimatedCloseDate: TDateTime read fEstimatedCloseDate write fEstimatedCloseDate;
property OpportunityStage: TSQLSalesOpportunityStageID read fOpportunityStage write fOpportunityStage;
property ChangeNote: TSQLRawBlob read fChangeNote write fChangeNote;
end;
// 24
TSQLSalesOpportunityRole = class(TSQLRecord)
private
fSalesOpportunity: TSQLSalesOpportunityID;
//fParty: TSQLPartyID;
//fRoleType: TSQLRoleTypeID;
fPartyRole: TSQLPartyRoleID;
published
property SalesOpportunity: TSQLSalesOpportunityID read fSalesOpportunity write fSalesOpportunity;
//property Party: TSQLPartyID read fParty write fParty;
//property RoleType: TSQLRoleTypeID read fRoleType write fRoleType;
property PartyRole: TSQLPartyRoleID read fPartyRole write fPartyRole;
end;
// 25
TSQLSalesOpportunityStage = class(TSQLRecord)
private
fDescription: RawUTF8;
fDefaultProbability: Double;
fSequenceNum: Integer;
published
property Description: RawUTF8 read fDescription write fDescription;
property DefaultProbability: Double read fDefaultProbability write fDefaultProbability;
property SequenceNum: Integer read fSequenceNum write fSequenceNum;
end;
// 26
TSQLSalesOpportunityWorkEffort = class(TSQLRecord)
private
fSalesOpportunity: TSQLSalesOpportunityID;
fWorkEffort: TSQLWorkEffortID;
published
property SalesOpportunity: TSQLSalesOpportunityID read fSalesOpportunity write fSalesOpportunity;
property WorkEffort: TSQLWorkEffortID read fWorkEffort write fWorkEffort;
end;
// 27
TSQLSalesOpportunityQuote = class(TSQLRecord)
private
fSalesOpportunity: TSQLSalesOpportunityID;
fQuote: TSQLQuoteID;
published
property SalesOpportunity: TSQLSalesOpportunityID read fSalesOpportunity write fSalesOpportunity;
property Quote: TSQLQuoteID read fQuote write fQuote;
end;
// 28
TSQLSalesForecast = class(TSQLRecord)
private
fParentSalesForecast: TSQLSalesForecastID;
fOrganizationParty: TSQLPartyID;
fInternalParty: TSQLPartyID;
fCustomTimePeriod: TSQLCustomTimePeriodID;
fCurrencyUom: TSQLUomID;
fQuotaAmount: Currency;
fForecastAmount: Currency;
fBestCaseAmount: Currency;
fClosedAmount: Currency;
fPercentOfQuotaForecast: Double;
fPercentOfQuotaClosed: Double;
fPipelineAmount: Currency;
fCreatedByUserLogin: TSQLUserLoginID;
fModifiedByUserLogin: TSQLUserLoginID;
published
property ParentSalesForecast: TSQLSalesForecastID read fParentSalesForecast write fParentSalesForecast;
property OrganizationParty: TSQLPartyID read fOrganizationParty write fOrganizationParty;
property InternalParty: TSQLPartyID read fInternalParty write fInternalParty;
property CustomTimePeriod: TSQLCustomTimePeriodID read fCustomTimePeriod write fCustomTimePeriod;
property CurrencyUom: TSQLUomID read fCurrencyUom write fCurrencyUom;
property QuotaAmount: Currency read fQuotaAmount write fQuotaAmount;
property ForecastAmount: Currency read fForecastAmount write fForecastAmount;
property BestCaseAmount: Currency read fBestCaseAmount write fBestCaseAmount;
property ClosedAmount: Currency read fClosedAmount write fClosedAmount;
property PercentOfQuotaForecast: Double read fPercentOfQuotaForecast write fPercentOfQuotaForecast;
property PercentOfQuotaClosed: Double read fPercentOfQuotaClosed write fPercentOfQuotaClosed;
property PipelineAmount: Currency read fPipelineAmount write fPipelineAmount;
property CreatedByUserLogin: TSQLUserLoginID read fCreatedByUserLogin write fCreatedByUserLogin;
property ModifiedByUserLogin: TSQLUserLoginID read fModifiedByUserLogin write fModifiedByUserLogin;
end;
// 29
TSQLSalesForecastDetail = class(TSQLRecord)
private
fSalesForecast: TSQLSalesForecastID;
fAmount: Currency;
fQuantityUom: TSQLUomID;
fQuantity: Double;
fProduct: TSQLProductID;
fProductCategory: TSQLProductCategoryID;
published
property SalesForecast: TSQLSalesForecastID read fSalesForecast write fSalesForecast;
property Amount: Currency read fAmount write fAmount;
property QuantityUom: TSQLUomID read fQuantityUom write fQuantityUom;
property Quantity: Double read fQuantity write fQuantity;
property Product: TSQLProductID read fProduct write fProduct;
property ProductCategory: TSQLProductCategoryID read fProductCategory write fProductCategory;
end;
// 30
TSQLSalesForecastHistory = class(TSQLRecord)
private
fSalesForecast: TSQLSalesForecastID;
fParentSalesForecast: TSQLSalesForecastID;
fOrganizationParty: TSQLPartyID;
fInternalParty: TSQLPartyID;
fCustomTimePeriod: TSQLCustomTimePeriodID;
fCurrencyUom: TSQLUomID;
fQuotaAmount: Currency;
fForecastAmount: Currency;
fBestCaseAmount: Currency;
fClosedAmount: Currency;
fPercentOfQuotaForecast: Double;
fPercentOfQuotaClosed: Double;
fChangeNote: TSQLRawBlob;
published
property SalesForecast: TSQLSalesForecastID read fSalesForecast write fSalesForecast;
property ParentSalesForecast: TSQLSalesForecastID read fParentSalesForecast write fParentSalesForecast;
property OrganizationParty: TSQLPartyID read fOrganizationParty write fOrganizationParty;
property InternalParty: TSQLPartyID read fInternalParty write fInternalParty;
property CustomTimePeriod: TSQLCustomTimePeriodID read fCustomTimePeriod write fCustomTimePeriod;
property CurrencyUom: TSQLUomID read fCurrencyUom write fCurrencyUom;
property QuotaAmount: Currency read fQuotaAmount write fQuotaAmount;
property ForecastAmount: Currency read fForecastAmount write fForecastAmount;
property BestCaseAmount: Currency read fBestCaseAmount write fBestCaseAmount;
property ClosedAmount: Currency read fClosedAmount write fClosedAmount;
property PercentOfQuotaForecast: Double read fPercentOfQuotaForecast write fPercentOfQuotaForecast;
property PercentOfQuotaClosed: Double read fPercentOfQuotaClosed write fPercentOfQuotaClosed;
property ChangeNote: TSQLRawBlob read fChangeNote write fChangeNote;
end;
// 31
TSQLSalesOpportunityCompetitor = class(TSQLRecord)
private
fSalesOpportunity: TSQLSalesOpportunityID;
fCompetitorParty: TSQLPartyID;
fPositionEnum: Integer;
fStrengths: TSQLRawBlob;
fWeaknesses: TSQLRawBlob;
published
property SalesOpportunity: TSQLSalesOpportunityID read fSalesOpportunity write fSalesOpportunity;
property CompetitorParty: TSQLPartyID read fCompetitorParty write fCompetitorParty;
property PositionEnum: Integer read fPositionEnum write fPositionEnum;
property Strengths: TSQLRawBlob read fStrengths write fStrengths;
property Weaknesses: TSQLRawBlob read fWeaknesses write fWeaknesses;
end;
// 32
TSQLSalesOpportunityTrckCode = class(TSQLRecord)
private
fSalesOpportunity: TSQLSalesOpportunityID;
fReceivedDate: TDateTime;
published
property SalesOpportunity: TSQLSalesOpportunityID read fSalesOpportunity write fSalesOpportunity;
property ReceivedDate: TDateTime read fReceivedDate write fReceivedDate;
end;
implementation
end.
|
unit UHash;
interface
uses
SysUtils, Windows, Messages, Classes, Graphics, Controls, Forms, Dialogs,
Variants,UlkJSON;
type
{
hjprErrorParsing - ошибка парсинга json. json - не валидный
hjprErrorCreate - ошибка создания узла при разборе ( возможно проблемы
с преобразованием типа
cJson:=aChild as TlkJSONobject;)
}
THashJsonResult = (hjprOk,hjprErrorParsing,hjprErrorCreate);
THash = class;
THashParam = class(TObject)
public
hash: THash;
name: string;
value: string;
constructor Create;
destructor Destroy; override;
procedure assign(from: THashParam);
procedure union(source: THashParam);
end;
THash = class(TObject)
private
fList: TList;
function getCount: Integer;
function getFloat(NameOrIndex:Variant): Double;
function getHash(name:string): THash;
function getInt(NameOrIndex:Variant): Integer;
function getItem(NameOrIndex: Variant): THashParam;
function getName(Index: Integer): string;
function getValue(NameOrIndex:Variant): string;
function getValueVariant(NameOrIndex:Variant): Variant;
procedure setFloat(NameOrIndex:Variant; const NewValue: Double);
procedure setInt(NameOrIndex:Variant; const NewValue: Integer);
procedure setName(Index: Integer; const NewValue: string);
procedure setValue(NameOrIndex:Variant; const Value: string);
procedure setValueVariant(NameOrIndex:Variant; const Value: Variant);
function _toJSON(cr: string = ''): string;
public
constructor Create;
destructor Destroy; override;
procedure add(NameValue: array of variant); overload;
function add(aObject: THashParam = nil): THashParam; overload;
procedure assign(from: THash);
function asString(cr: string = #13#10; space: string = ' '; level:
Integer = 0): string;
procedure clear;
procedure delete(aIndex: Integer = -1); overload;
procedure delete(const name: string); overload;
function exists(const Name: string): Boolean; overload;
function exists(aObject: THashParam): Boolean; overload;
function fromJSON(aStr: string; enCodeRus: Boolean = true):
THashJsonResult;
function indexOf(aObject: THashParam): Integer;
function nameToIndex(const name: string): Integer;
procedure remove(aObject:THashParam);
function toJSON(const cr: string = ''; codeRus: Boolean = true): string;
procedure union(source: THash);
function _fromJSON(aChild: TlkJSONbase; aParent: THash; enCodeRus:
Boolean = true): THashJsonResult;
property Count: Integer read getCount;
property Float[NameOrIndex:Variant]: Double read getFloat write
setFloat;
property Hash[name:string]: THash read getHash;
property Int[NameOrIndex:Variant]: Integer read getInt write setInt;
property Item[NameOrIndex: Variant]: THashParam read getItem;
property Name[Index: Integer]: string read getName write setName;
property Value[NameOrIndex:Variant]: string read getValue write
setValue; default;
property ValueVariant[NameOrIndex:Variant]: Variant read
getValueVariant write setValueVariant;
end;
function Hash(NameValue: array of variant): THash;overload;
procedure FreeHash(var aHash: THash);
function Hash: THash; overload;
implementation
uses UUtils;
function Hash(NameValue: array of variant): THash;
begin
result:=THash.create;
result.add(NameValue);
end;
procedure FreeHash(var aHash: THash);
begin
if (aHash<>nil) then
aHash.Free();
aHash:=nil;
end;
function Hash: THash;
begin
Result := Hash([]);
end;
{
********************************** THashParam **********************************
}
constructor THashParam.Create;
begin
inherited Create;
hash:=THash.Create();
end;
destructor THashParam.Destroy;
begin
hash.Free();
inherited Destroy;
end;
procedure THashParam.assign(from: THashParam);
begin
name :=from.name;
value :=from.value;
hash.assign(from.hash);
end;
procedure THashParam.union(source: THashParam);
begin
value :=source.value;
if (source.hash.count>0) then
hash.union(source.hash)
else
hash.clear();
end;
{
************************************ THash *************************************
}
constructor THash.Create;
begin
fList:=TList.Create;
end;
destructor THash.Destroy;
begin
Clear;
fList.Free;
inherited Destroy;
end;
procedure THash.add(NameValue: array of variant);
var
i: Integer;
begin
for i:= 0 to (Length(NameValue) div 2-1) do
Value[NameValue[i*2]]:=NameValue[i*2+1];
end;
function THash.add(aObject: THashParam = nil): THashParam;
begin
try
if (aObject = nil) then
aObject:=THashParam.Create();
result:=aObject;
fList .Add(result);
except
result:=nil;
end;
end;
procedure THash.assign(from: THash);
var
i: Integer;
begin
clear();
for i:=0 to from.Count-1 do
add().assign(from.Item[i]);
end;
function THash.asString(cr: string = #13#10; space: string = ' '; level:
Integer = 0): string;
var
item: THashParam;
i: Integer;
otstup: string;
begin
result:='';
otstup:='';
for i:=0 to level do
otstup:=otstup+space;
for i:=0 to Count-1 do begin
item:=self.Item[i];
if (item.hash.count = 0) then
result:=result + otstup+item.name+' = "'+item.value+'" '+cr
else begin
result:= result + otstup+item.name+' = ['+cr+item.hash.asString(cr,space,level+1)+'] '+cr;
end;
end;
end;
procedure THash.clear;
begin
Delete(-1);
end;
procedure THash.delete(aIndex: Integer = -1);
var
obj: THashParam;
begin
if aIndex = -1 then
begin
while fList.Count>0 do
begin
obj:=THashParam(fList.Items[fList.Count-1]);
obj.Free;
fList.Delete(fList.Count-1);
end
end
else
begin
obj:=THashParam(fList.Items[aIndex]);
obj.Free;
fList.Delete(aIndex);
end;
end;
procedure THash.delete(const name: string);
var
index: Integer;
begin
index:=nameToIndex(name);
if (index<>-1) then
delete(index);
end;
function THash.exists(const Name: string): Boolean;
begin
result:=(nameToIndex(Name)<>-1);
end;
function THash.exists(aObject: THashParam): Boolean;
begin
result:=(IndexOf(aObject)<>-1);
end;
function THash.fromJSON(aStr: string; enCodeRus: Boolean = true):
THashJsonResult;
var
cJson: TlkJSONobject;
cChild: TlkJSONbase;
cName: string;
cValue: string;
i: Integer;
begin
result:=hjprOk;
clear();
if (enCodeRus) then
aStr:=Utils.rusCod(aStr);
try
cJson := TlkJSON.ParseText(aStr) as TlkJSONobject;
if (cJson=nil) then
raise Exception.Create('');
try
try
for i:=0 to cJson.Count-1 do begin
cName:=cJson.NameOf[i];
cChild:=cJson.FieldByIndex[i];
if (cChild.Count = 0) then begin
cValue:=varToStr(cJson.Field[cName].Value);
if (enCodeRus) then
cValue:=Utils.rusEnCod(cValue);
Value[cName]:=cValue;
end else begin
result:=_fromJSON(cChild,Hash[cName],enCodeRus);
if (result<>hjprOk) then
raise Exception.Create('');
end;
end;
except
on e:Exception do begin
result:=hjprErrorCreate;
end;
end;
finally
cJson.Free();
end;
except on e:Exception do begin
result:=hjprErrorParsing;
end;
end;
end;
function THash.getCount: Integer;
begin
result:=fList.Count;
end;
function THash.getFloat(NameOrIndex:Variant): Double;
begin
result:=Utils.StrToFloat(Value[NameOrIndex]);
end;
function THash.getHash(name:string): THash;
var
index: Integer;
new: THashParam;
begin
index := nameToIndex(name);
if (index<>-1) then begin
result:= Item[index].hash;
end else begin
new := add();
new.name := name;
result := new.hash;
end;
end;
function THash.getInt(NameOrIndex:Variant): Integer;
begin
result:=StrToInt(Value[NameOrIndex]);
end;
function THash.getItem(NameOrIndex: Variant): THashParam;
var
vt: TVarType;
index: Integer;
begin
vt := VarType(NameOrIndex);
if ( (vt = varString) or (vt = varUString) ) then
index := nameToIndex(NameOrIndex)
else
index:=NameOrIndex;
if (index>=0) then
result:=THashParam(fList.Items[index])
else
result:=nil;
end;
function THash.getName(Index: Integer): string;
begin
result:=Item[Index].name;
end;
function THash.getValue(NameOrIndex:Variant): string;
var
index: Integer;
item: THashParam;
vt: TVarType;
begin
vt := VarType(NameOrIndex);
if ( (vt = varString) or (vt = varUString) ) then
index := nameToIndex(NameOrIndex)
else
index:=NameOrIndex;
if (index<>-1) then begin
item:= self.Item[index];
if (item.hash.count>0) then
raise Exception.Create('["'+NameOrIndex+'"] is hash array, use .Hash["'+NameOrIndex+'"] property for use.')
else
result:= item.value;
end else
result:= '';
end;
function THash.getValueVariant(NameOrIndex:Variant): Variant;
var
index: Integer;
item: THashParam;
vt: TVarType;
begin
vt := VarType(NameOrIndex);
if ( (vt = varString) or (vt = varUString) ) then
index := nameToIndex(NameOrIndex)
else
index:=NameOrIndex;
if (index<>-1) then begin
item:= self.Item[index];
if (item.hash.count>0) then
raise Exception.Create('["'+NameOrIndex+'"] is hash array, use .Hash["'+NameOrIndex+'"] property for use.')
else begin
result:= item.value;
end;
end else
result:= '';
end;
function THash.indexOf(aObject: THashParam): Integer;
begin
result:=fList.IndexOf(aObject);
end;
function THash.nameToIndex(const name: string): Integer;
var
i: Integer;
param: THashParam;
begin
result:=-1;
for i:=0 to Count-1 do begin
param:=Item[i];
if (param.name = name) then begin
result:= i;
break;
end;
end;
end;
procedure THash.remove(aObject:THashParam);
begin
fList.Remove(aObject);
end;
procedure THash.setFloat(NameOrIndex:Variant; const NewValue: Double);
begin
Value[NameOrIndex]:=Utils.FloatToStr(NewValue);
end;
procedure THash.setInt(NameOrIndex:Variant; const NewValue: Integer);
begin
Value[NameOrIndex]:=IntToStr(NewValue);
end;
procedure THash.setName(Index: Integer; const NewValue: string);
begin
Item[Index].name := NewValue;
end;
procedure THash.setValue(NameOrIndex:Variant; const Value: string);
var
index: Integer;
new: THashParam;
item: THashParam;
vt: TVarType;
begin
vt := VarType(NameOrIndex);
if ( (vt = varString) or (vt = varUString) ) then
index := nameToIndex(NameOrIndex)
else
index:=NameOrIndex;
if (index<>-1) then begin
item:=self.Item[index];
item.value := Value;
item.hash.clear();
end else begin
new := add();
new.value := Value;
new.name := NameOrIndex;
end;
end;
procedure THash.setValueVariant(NameOrIndex:Variant; const Value: Variant);
var
index: Integer;
new: THashParam;
item: THashParam;
indexType: TVarType;
valueType: TVarType;
cValue: string;
begin
indexType := VarType(NameOrIndex);
valueType := VarType(Value);
cValue:='';
case valueType of
varString,varUString:
cValue:=varToStr(Value);
varSmallint,varInteger,varShortInt,varByte,varInt64,varUInt64:
cValue:=varToStr(Value);
varSingle,varDouble,varCurrency:
cValue:=varToStr(Value);
end;
if ( (indexType = varString) or (indexType = varUString) ) then
index := nameToIndex(NameOrIndex)
else
index:=NameOrIndex;
if (index<>-1) then begin
item:=self.Item[index];
item.value := Value;
item.hash.clear();
end else begin
new := add();
new.value := Value;
new.name := NameOrIndex;
end;
end;
function THash.toJSON(const cr: string = ''; codeRus: Boolean = true): string;
begin
result:=_toJSON(cr);
if (codeRus) then
result:=Utils.rusCod(result);
end;
procedure THash.union(source: THash);
var
i: Integer;
name: string;
param: THashParam;
begin
for i:=0 to source.Count-1 do begin
name:=source.Name[i];
param:=Item[name];
if (param = nil) then begin
param := add();
param.name := name;
end;
param.union(source.Item[i]);
end;
end;
function THash._fromJSON(aChild: TlkJSONbase; aParent: THash; enCodeRus:
Boolean = true): THashJsonResult;
var
i: Integer;
cChild: TlkJSONbase;
cJson: TlkJSONobject;
cList: TlkJSONlist;
cName: string;
cValue: string;
begin
result:=hjprErrorCreate;
if (aChild.SelfType = jsList) then begin
cList:=aChild as TlkJSONlist;
try
for i:=0 to cList.Count-1 do begin
cName:=IntToStr(i);
cChild:=cList.Child[i];
if (cChild.Count = 0) then begin
cValue:=VarToStr(cChild.Value);
if (enCodeRus) then
cValue:=Utils.rusEnCod(cValue);
aParent[cName]:=cValue;
end else begin
result:=_fromJSON(cChild,aParent.Hash[cName],enCodeRus);
if (result<>hjprOk) then
raise Exception.Create('');
end;
end;
result:=hjprOk;
except on e:Exception do
end;
end else begin
cJson:=aChild as TlkJSONobject;
try
for i:=0 to cJson.Count-1 do begin
cName:=cJson.NameOf[i];
cChild:=cJson.FieldByIndex[i];
if (cChild.Count = 0) then begin
cValue:=varToStr(cJson.Field[cName].Value);
if (enCodeRus) then
cValue:=Utils.rusEnCod(cValue);
aParent[cName]:=cValue;
end else begin
result:=_fromJSON(cChild,aParent.Hash[cName],enCodeRus);
if (result<>hjprOk) then
raise Exception.Create('');
end;
end;
result:=hjprOk;
except on e:Exception do
end;
end;
end;
function THash._toJSON(cr: string = ''): string;
var
i: Integer;
isArray: Boolean;
obj: THashParam;
begin
isArray:=true;
result:='';
for i:=0 to Count-1 do begin
if (IntToStr(i)<>Name[i]) then begin
isArray:=false;
break;
end;
end;
for i:=0 to Count-1 do begin
obj := Item[i];
if (i<>0) then
result:=result+','+cr;
if (obj.hash.Count = 0) then begin
if (not isArray) then
result:=result+'"'+obj.name+'":';
if ( Utils.isNumeric(obj.Value) ) then
result:=result+Value[i]
else
result:=result+'"'+Value[i]+'"';
end else begin
result:=result+'"'+obj.name+'":'+cr+obj.hash.toJSON(cr);
end;
end;
if (isArray) then
result:='['+cr+result+cr+']'+cr
else
result:='{'+cr+result+cr+'}'+cr;
end;
end.
|
unit Test.Escapes;
interface
uses
Deltics.Smoketest;
type
Escapes = class(TTest)
procedure UtilsAnsiHex;
procedure UtilsWideHex;
procedure Index;
procedure Json;
end;
implementation
uses
Deltics.Unicode,
Deltics.Unicode.Utils;
{ Escapes ---------------------------------------------------------------------------------------- }
{ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
procedure Escapes.UtilsAnsiHex;
begin
Test('AnsiHex(#$004a)').Assert(AnsiHex($004a, 4, TRUE)).Equals('004A');
Test('AnsiHex(#$804a)').Assert(AnsiHex($804a, 4, FALSE)).Equals('804a');
Test('AnsiHex($10000)').Assert(AnsiHex($10000, 5, FALSE)).Equals('10000');
Test('AnsiHex($100000)').Assert(AnsiHex($100000, 6, FALSE)).Equals('100000');
Test('AnsiHex($1000000)').Assert(AnsiHex($1000000, 7, FALSE)).Equals('1000000');
Test('AnsiHex($10000000)').Assert(AnsiHex($10000000, 8, FALSE)).Equals('10000000');
Test('AnsiHex($faedb4c7)').Assert(AnsiHex($faedb4c7, 8, FALSE)).Equals('faedb4c7');
Test('AnsiHex($faedb4c7)').Assert(AnsiHex($faedb4c7, 8, TRUE)).Equals('FAEDB4C7');
end;
{ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
procedure Escapes.UtilsWideHex;
begin
Test('WideHex(#$004a)').Assert(WideHex($004a, 4, TRUE)).Equals('004A');
Test('WideHex(#$804a)').Assert(WideHex($804a, 4, FALSE)).Equals('804a');
Test('WideHex($10000)').Assert(WideHex($10000, 5, FALSE)).Equals('10000');
Test('WideHex($100000)').Assert(WideHex($100000, 6, FALSE)).Equals('100000');
Test('WideHex($1000000)').Assert(WideHex($1000000, 7, FALSE)).Equals('1000000');
Test('WideHex($10000000)').Assert(WideHex($10000000, 8, FALSE)).Equals('10000000');
Test('WideHex($faedb4c7)').Assert(WideHex($faedb4c7, 8, FALSE)).Equals('faedb4c7');
Test('WideHex($faedb4c7)').Assert(WideHex($faedb4c7, 8, TRUE)).Equals('FAEDB4C7');
end;
{ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
procedure Escapes.Index;
begin
Test('Index(#$0041)').Assert(Unicode.Escape(WideChar(#$0041), UnicodeIndex)).Equals('U+0041');
Test('Index(#$dc00)').Assert(Unicode.Escape(#$dc00, UnicodeIndex)).Equals('U+DC00');
Test('Index($10000)').Assert(Unicode.Escape($10000, UnicodeIndex)).Equals('U+10000');
end;
{ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
procedure Escapes.Json;
begin
Test('Json(#$004a)').Assert(Unicode.Escape(WideChar(#$004a), JsonEscape)).Equals('\u004a');
Test('Json(#$804a)').Assert(Unicode.Escape(#$804a, JsonEscape)).Equals('\u804a');
Test('Json($10000)').Assert(Unicode.Escape($10000, JsonEscape)).Equals('\ud800\udc00');
Test('Json($100000)').Assert(Unicode.Escape($100000, JsonEscape)).Equals('\udbc0\udc00');
end;
end.
|
{*******************************************************}
{ }
{ Delphi REST Client Framework }
{ }
{ Copyright(c) 2014-2018 Embarcadero Technologies, Inc. }
{ All rights reserved }
{ }
{*******************************************************}
{$HPPEMIT LINKUNIT}
unit REST.Backend.KinveyServices;
interface
uses
System.Classes,
System.SysUtils,
System.JSON,
REST.Backend.Providers,
REST.Backend.PushTypes,
REST.Backend.ServiceTypes,
REST.Backend.MetaTypes,
REST.Backend.KinveyApi,
REST.Backend.KinveyProvider;
type
// Files service
TKinveyFilesAPI = class(TKinveyServiceAPIAuth, IBackendFilesApi)
protected
{ IBackendFilesAPI }
function GetMetaFactory: IBackendMetaFactory;
procedure UploadFile(const AFileName: string; const AContentType: string; out AFile: TBackendEntityValue); overload;
procedure UploadFile(const AFileName: string; const AStream: TStream; const AContentType: string; out AFile: TBackendEntityValue); overload;
function DeleteFile(const AFile: TBackendEntityValue): Boolean;
end;
TKinveyFilesService = class(TKinveyBackendService<TKinveyFilesAPI>, IBackendService, IBackendFilesService)
protected
{ IBackendFilesService }
function CreateFilesApi: IBackendFilesApi;
function GetFilesApi: IBackendFilesApi;
end;
// Push service
TKinveyPushAPI = class(TKinveyServiceAPIAuth, IBackendPushApi)
private
FPushEndpoint: string;
protected
{ IBackendPushAPI }
procedure PushBroadcast(const AData: TPushData);
end;
TKinveyPushService = class(TKinveyBackendService<TKinveyPushAPI>, IBackendService, IBackendPushService)
private
FPushEndpoint: string;
protected
function CreateBackendApi: TKinveyPushAPI; override;
{ IBackendPushService }
function CreatePushApi: IBackendPushApi;
function GetPushApi: IBackendPushApi;
public
constructor Create(const AProvider: IBackendProvider); override;
end;
// Query service
TKinveyQueryAPI = class(TKinveyServiceAPIAuth, IBackendQueryApi)
protected
{ IBackendQueryAPI }
function GetMetaFactory: IBackendMetaFactory;
procedure GetServiceNames(out ANames: TArray<string>);
procedure Query(const AClass: TBackendMetaClass; const AQuery: array of string; const AJSONArray: TJSONArray); overload;
procedure Query(const AClass: TBackendMetaClass; const AQuery: array of string;
const AJSONArray: TJSONArray; out AObjects: TArray<TBackendEntityValue>); overload;
end;
TKinveyQueryService = class(TKinveyBackendService<TKinveyQueryAPI>, IBackendService, IBackendQueryService)
protected
{ IBackendQueryService }
function CreateQueryApi: IBackendQueryApi;
function GetQueryApi: IBackendQueryApi;
end;
// Login service
TKinveyLoginAPI = class(TKinveyServiceAPIAuth, IBackendAuthApi)
protected
{ IBackendAuthApi }
function GetMetaFactory: IBackendMetaFactory;
procedure SignupUser(const AUserName, APassword: string; const AUserData: TJSONObject;
out ACreatedObject: TBackendEntityValue);
procedure LoginUser(const AUserName, APassword: string; AProc: TFindObjectProc); overload;
procedure LoginUser(const AUserName, APassword: string; out AUser: TBackendEntityValue; const AJSON: TJSONArray); overload;
function FindCurrentUser(const AObject: TBackendEntityValue; AProc: TFindObjectProc): Boolean; overload;
function FindCurrentUser(const AObject: TBackendEntityValue; out AUser: TBackendEntityValue; const AJSON: TJSONArray): Boolean; overload;
procedure UpdateUser(const AObject: TBackendEntityValue; const AUserData: TJSONObject;
out AUpdatedObject: TBackendEntityValue);
end;
TKinveyLoginService = class(TKinveyBackendService<TKinveyLoginAPI>, IBackendService, IBackendAuthService)
protected
{ IBackendAuthService }
function CreateAuthApi: IBackendAuthApi;
function GetAuthApi: IBackendAuthApi;
end;
TKinveyLoginAPIHelper = class helper for TKinveyLoginAPI
public
procedure LogoutUser;
end;
// Users service
TKinveyUsersAPI = class(TKinveyLoginApi, IBackendUsersApi)
private
protected
{ IBackendUsersAPI }
function DeleteUser(const AObject: TBackendEntityValue): Boolean; overload;
function FindUser(const AObject: TBackendEntityValue; AProc: TFindObjectProc): Boolean; overload;
function FindUser(const AObject: TBackendEntityValue; out AUser: TBackendEntityValue; const AJSON: TJSONArray): Boolean; overload;
function QueryUserName(const AUserName: string; AProc: TFindObjectProc): Boolean; overload;
function QueryUserName(const AUserName: string; out AUser: TBackendEntityValue; const AJSON: TJSONArray): Boolean; overload;
procedure QueryUsers(const AQuery: array of string; const AJSONArray: TJSONArray); overload;
procedure QueryUsers(const AQuery: array of string; const AJSONArray: TJSONArray; out AMetaArray: TArray<TBackendEntityValue>); overload;
end;
TKinveyUsersService = class(TKinveyBackendService<TKinveyUsersAPI>, IBackendService, IBackendUsersService)
protected
{ IBackendUsersService }
function CreateUsersApi: IBackendUsersApi;
function GetUsersApi: IBackendUsersApi;
end;
// Storage service
TKinveyStorageAPI = class(TKinveyServiceAPIAuth, IBackendStorageApi)
protected
{ IBackendStorageAPI }
function GetMetaFactory: IBackendMetaFactory;
procedure CreateObject(const AClass: TBackendMetaClass; const AACL, AJSON: TJSONObject;
out ACreatedObject: TBackendEntityValue);
function DeleteObject(const AObject: TBackendEntityValue): Boolean;
function FindObject(const AObject: TBackendEntityValue; AProc: TFindObjectProc): Boolean;
procedure UpdateObject(const AObject: TBackendEntityValue; const AJSONObject: TJSONObject;
out AUpdatedObject: TBackendEntityValue);
procedure QueryObjects(const AClass: TBackendMetaClass; const AQuery: array of string;
const AJSONArray: TJSONArray); overload;
procedure QueryObjects(const AClass: TBackendMetaClass; const AQuery: array of string;
const AJSONArray: TJSONArray; out AObjects: TArray<TBackendEntityValue>); overload;
end;
TKinveyStorageService = class(TKinveyBackendService<TKinveyStorageAPI>, IBackendService, IBackendStorageService)
protected
{ IBackendStorageService }
function CreateStorageApi: IBackendStorageApi;
function GetStorageApi: IBackendStorageApi;
end;
implementation
uses
System.TypInfo, System.Generics.Collections,
REST.Backend.ServiceFactory, REST.Backend.Exception,
REST.Backend.KinveyMetaTypes,
REST.Backend.Consts;
type
TKinveyProviderServiceFactory<T: IBackendService> = class(TProviderServiceFactory<T>)
var
FMethod: TFunc<IBackendProvider, IBackendService>;
protected
function CreateService(const AProvider: IBackendProvider; const IID: TGUID): IBackendService; override;
public
constructor Create(const AMethod: TFunc<IBackendProvider, IBackendService>);
end;
{ TKinveyProviderServiceFactory<T> }
constructor TKinveyProviderServiceFactory<T>.Create(const AMethod: TFunc<IBackendProvider, IBackendService>);
begin
inherited Create(TCustomKinveyProvider.ProviderID, 'REST.Backend.KinveyServices');
FMethod := AMethod;
end;
function TKinveyProviderServiceFactory<T>.CreateService(
const AProvider: IBackendProvider; const IID: TGUID): IBackendService;
begin
Result := FMethod(AProvider);
end;
{ TKinveyFilesService }
function TKinveyFilesService.CreateFilesApi: IBackendFilesApi;
begin
Result := CreateBackendApi;
end;
function TKinveyFilesService.GetFilesApi: IBackendFilesApi;
begin
EnsureBackendApi;
Result := BackendAPI;
end;
{ TKinveyPushAPI }
procedure TKinveyPushAPI.PushBroadcast(
const AData: TPushData);
var
LArray: TJSONArray;
LIOSAPS: TJSONObject;
LIOSExtras: TJSONObject;
LAndroidPayload: TJSONObject;
begin
if FPushEndPoint = '' then
raise EKinveyAPIError.Create(sKinveyRequiresCustomEndpoint);
if AData <> nil then
begin
LArray := TJSONArray.Create;
try
LIOSAPS := TJSONObject.Create;
LArray.AddElement(LIOSAPS);
AData.APS.Save(LIOSAPS, '');
if (AData.APS.Alert = '') and (AData.Message <> '') then
AData.SaveMessage(LIOSAPS, TPushData.TAPS.TNames.Alert);
LIOSExtras := TJSONObject.Create;
LArray.AddElement(LIOSExtras);
AData.Extras.Save(LIOSExtras, '');
LAndroidPayload := TJSONObject.Create;
LArray.AddElement(LAndroidPayload);
AData.Extras.Save(LAndroidPayload, '');
AData.GCM.Save(LAndroidPayload, '');
if (AData.GCM.Message = '') and (AData.GCM.Msg = '') and (AData.Message <> '') then
AData.SaveMessage(LAndroidPayload, TPushData.TGCM.TNames.Message);
KinveyAPI.BroadcastPayload(FPushEndPoint,
LIOSAPS, LIOSExtras, LAndroidPayload);
finally
LArray.Free;
end;
end
else
KinveyAPI.InvokeCustomEndpoint(FPushEndPoint, nil, nil)
end;
{ TKinveyPushService }
constructor TKinveyPushService.Create(const AProvider: IBackendProvider);
begin
inherited;
if AProvider is TCustomKinveyProvider then
FPushendPoint := TCustomKinveyProvider(AProvider).PushEndpoint
else
FPushendpoint := '';
end;
function TKinveyPushService.CreateBackendApi: TKinveyPushAPI;
begin
Result := inherited;
if ConnectionInfo <> nil then
Result.FPushEndpoint := ConnectionInfo.PushEndpoint
else
Result.FPushEndpoint := ''
end;
function TKinveyPushService.CreatePushApi: IBackendPushApi;
begin
Result := CreateBackendApi;
if Result is TKinveyPushAPI then
TKinveyPushAPI(Result).FPushEndpoint := FPushendpoint;
end;
function TKinveyPushService.GetPushApi: IBackendPushApi;
begin
EnsureBackendApi;
Result := BackendAPI;
end;
{ TKinveyQueryAPI }
procedure TKinveyQueryAPI.GetServiceNames(out ANames: TArray<string>);
begin
ANames := TArray<string>.Create(
TBackendQueryServiceNames.Storage,
TBackendQueryServiceNames.Users);
// Kinvey REST API does not support query of installations
//TBackendQueryServiceNames.Installation);
end;
function TKinveyQueryAPI.GetMetaFactory: IBackendMetaFactory;
begin
Result := TMetaFactory.Create;
end;
procedure TKinveyQueryAPI.Query(const AClass: TBackendMetaClass;
const AQuery: array of string; const AJSONArray: TJSONArray);
begin
if SameText(AClass.BackendDataType, TBackendQueryServiceNames.Storage) then
KinveyAPI.QueryAppData(
AClass.BackendClassName, AQuery, AJSONArray)
else if SameText(AClass.BackendDataType, TBackendQueryServiceNames.Users) then
KinveyAPI.QueryUsers(
AQuery, AJSONArray)
else if SameText(AClass.BackendDataType, TBackendQueryServiceNames.Files) then
KinveyAPI.QueryFiles(
AQuery, AJSONArray)
else
raise EKinveyAPIError.CreateFmt(sUnsupportedBackendQueryType, [AClass.BackendDataType]);
end;
procedure TKinveyQueryAPI.Query(const AClass: TBackendMetaClass;
const AQuery: array of string; const AJSONArray: TJSONArray; out AObjects: TArray<TBackendEntityValue>);
var
LObjectIDArray: TArray<TKinveyAPI.TObjectID>;
LUsersArray: TArray<TKinveyAPI.TUser>;
LObjectID: TKinveyAPI.TObjectID;
LList: TList<TBackendEntityValue>;
LUser: TKinveyAPI.TUser;
begin
if SameText(AClass.BackendDataType, TBackendQueryServiceNames.Storage) then
KinveyAPI.QueryAppData(
AClass.BackendClassName, AQuery, AJSONArray, LObjectIDArray)
else if SameText(AClass.BackendDataType, TBackendQueryServiceNames.Users) then
KinveyAPI.QueryUsers(
AQuery, AJSONArray, LUsersArray)
else
raise EKinveyAPIError.CreateFmt(sUnsupportedBackendQueryType, [AClass.BackendDataType]);
if Length(LUsersArray) > 0 then
begin
LList := TList<TBackendEntityValue>.Create;
try
for LUser in LUsersArray do
LList.Add(TKinveyMetaFactory.CreateMetaFoundUser(LUser));
AObjects := LList.ToArray;
finally
LList.Free;
end;
end;
if Length(LObjectIDArray) > 0 then
begin
LList := TList<TBackendEntityValue>.Create;
try
for LObjectID in LObjectIDArray do
LList.Add(TKinveyMetaFactory.CreateMetaClassObject(LObjectID));
AObjects := LList.ToArray;
finally
LList.Free;
end;
end;
end;
{ TKinveyQueryService }
function TKinveyQueryService.CreateQueryApi: IBackendQueryApi;
begin
Result := CreateBackendApi;
end;
function TKinveyQueryService.GetQueryApi: IBackendQueryApi;
begin
EnsureBackendApi;
Result := BackendAPI;
end;
{ TKinveyUsersService }
function TKinveyUsersService.CreateUsersApi: IBackendUsersApi;
begin
Result := CreateBackendApi;
end;
function TKinveyUsersService.GetUsersApi: IBackendUsersApi;
begin
EnsureBackendApi;
Result := BackendAPI;
end;
{ TKinveyLoginService }
function TKinveyLoginService.CreateAuthApi: IBackendAuthApi;
begin
Result := CreateBackendApi;
end;
function TKinveyLoginService.GetAuthApi: IBackendAuthApi;
begin
EnsureBackendApi;
Result := BackendAPI;
end;
{ TKinveyStorageAPI }
procedure TKinveyStorageAPI.CreateObject(const AClass: TBackendMetaClass;
const AACL, AJSON: TJSONObject; out ACreatedObject: TBackendEntityValue);
var
LNewObject: TKinveyAPI.TObjectID;
begin
KinveyAPI.CreateAppData(AClass.BackendClassName, AACL, AJSON, LNewObject);
ACreatedObject :=
//TBackendEntityValue.Create(TMetaCreatedObject.Create(LNewObject));
TKinveyMetaFactory.CreateMetaClassObject(LNewObject)
end;
function TKinveyStorageAPI.DeleteObject(
const AObject: TBackendEntityValue): Boolean;
var
LCount: Integer;
begin
if AObject.Data is TMetaObject then
begin
LCount := KinveyAPI.DeleteAppData((AObject.Data as TMetaObject).ObjectID);
if LCount > 1 then
raise EBackendServiceError.CreateFmt(sUnexpectedDeleteObjectCount, [LCount])
else
Result := LCount > 0;
end
else
raise EArgumentException.Create(sParameterNotMetaType);
end;
function TKinveyStorageAPI.FindObject(const AObject: TBackendEntityValue;
AProc: TFindObjectProc): Boolean;
var
LMetaObject: TMetaObject;
begin
if AObject.Data is TMetaObject then
begin
LMetaObject := TMetaObject(AObject.Data);
Result := KinveyAPI.FindAppData(LMetaObject.ObjectID,
procedure(const AID: TKinveyAPI.TObjectID; const AObj: TJSONObject)
begin
AProc(TKinveyMetaFactory.CreateMetaFoundObject(AID), AObj);
end);
end
else
raise EArgumentException.Create(sParameterNotMetaType);
end;
function TKinveyStorageAPI.GetMetaFactory: IBackendMetaFactory;
begin
Result := TMetaFactory.Create;
end;
procedure TKinveyStorageAPI.QueryObjects(const AClass: TBackendMetaClass;
const AQuery: array of string; const AJSONArray: TJSONArray);
begin
KinveyAPI.QueryAppData(AClass.BackendClassName, AQuery, AJSONArray);
end;
procedure TKinveyStorageAPI.QueryObjects(const AClass: TBackendMetaClass;
const AQuery: array of string; const AJSONArray: TJSONArray;
out AObjects: TArray<TBackendEntityValue>);
var
LObjectIDArray: TArray<TKinveyAPI.TObjectID>;
LObjectID: TKinveyAPI.TObjectID;
LList: TList<TBackendEntityValue>;
begin
KinveyAPI.QueryAppData(AClass.BackendClassName, AQuery, AJSONArray, LObjectIDArray);
if Length(LObjectIDArray) > 0 then
begin
LList := TList<TBackendEntityValue>.Create;
try
for LObjectID in LObjectIDArray do
LList.Add(TKinveyMetaFactory.CreateMetaClassObject(LObjectID));
AObjects := LList.ToArray;
finally
LList.Free;
end;
end;
end;
procedure TKinveyStorageAPI.UpdateObject(const AObject: TBackendEntityValue;
const AJSONObject: TJSONObject; out AUpdatedObject: TBackendEntityValue);
var
LObjectID: TKinveyAPI.TObjectID;
LMetaObject: TMetaObject;
begin
if AObject.Data is TMetaObject then
begin
LMetaObject := TMetaObject(AObject.Data);
KinveyAPI.UpdateAppData(LMetaObject.ObjectID, AJSONObject, LObjectID);
AUpdatedObject := TKinveyMetaFactory.CreateMetaUpdatedObject(LObjectID);
end
else
raise EArgumentException.Create(sParameterNotMetaType);
end;
{ TKinveyStorageService }
function TKinveyStorageService.CreateStorageApi: IBackendStorageApi;
begin
Result := CreateBackendApi;
end;
function TKinveyStorageService.GetStorageApi: IBackendStorageApi;
begin
EnsureBackendApi;
Result := BackendAPI;
end;
var
FFactories: TList<TProviderServiceFactory>;
procedure RegisterServices;
var
LFactory: TProviderServiceFactory;
begin
FFactories := TObjectList<TProviderServiceFactory>.Create;
// Files
LFactory := TKinveyProviderServiceFactory<IBackendFilesService>.Create(
function(AProvider: IBackendProvider): IBackendService
begin
Result := TKinveyFilesService.Create(AProvider);
end);
FFactories.Add(LFactory);
// Login
LFactory := TKinveyProviderServiceFactory<IBackendAuthService>.Create(
function(AProvider: IBackendProvider): IBackendService
begin
Result := TKinveyLoginService.Create(AProvider);
end);
FFactories.Add(LFactory);
// Users
LFactory := TKinveyProviderServiceFactory<IBackendUsersService>.Create(
function(AProvider: IBackendProvider): IBackendService
begin
Result := TKinveyUsersService.Create(AProvider);
end);
FFactories.Add(LFactory);
// Storage
LFactory := TKinveyProviderServiceFactory<IBackendStorageService>.Create(
function(AProvider: IBackendProvider): IBackendService
begin
Result := TKinveyStorageService.Create(AProvider);
end);
FFactories.Add(LFactory);
// Query
LFactory := TKinveyProviderServiceFactory<IBackendQueryService>.Create(
function(AProvider: IBackendProvider): IBackendService
begin
Result := TKinveyQueryService.Create(AProvider);
end);
FFactories.Add(LFactory);
// Push
LFactory := TKinveyProviderServiceFactory<IBackendPushService>.Create(
function(AProvider: IBackendProvider): IBackendService
begin
Result := TKinveyPushService.Create(AProvider);
end);
FFactories.Add(LFactory);
for LFactory in FFactories do
LFactory.Register;
end;
procedure UnregisterServices;
var
LFactory: TProviderServiceFactory;
begin
for LFactory in FFactories do
LFactory.Unregister;
FreeAndNil(FFactories);
end;
{ TKinveyLoginAPI }
function TKinveyLoginAPI.GetMetaFactory: IBackendMetaFactory;
begin
Result := TMetaFactory.Create;
end;
function TKinveyLoginAPI.FindCurrentUser(const AObject: TBackendEntityValue;
AProc: TFindObjectProc): Boolean;
var
LMetaLogin: TMetaLogin;
begin
if AObject.Data is TMetaLogin then
begin
LMetaLogin := TMetaLogin(AObject.Data);
KinveyAPI.Login(LMetaLogin.Login);
try
Result := KinveyAPI.RetrieveCurrentUser(
procedure(const AUser: TKinveyAPI.TUser; const AObj: TJSONObject)
begin
AProc(TKinveyMetaFactory.CreateMetaFoundUser(AUser), AObj);
end);
finally
KinveyAPI.Logout;
end;
end
else
raise EArgumentException.Create(sParameterNotMetaType);
end;
function TKinveyLoginAPI.FindCurrentUser(const AObject: TBackendEntityValue; out AUser: TBackendEntityValue; const AJSON: TJSONArray): Boolean;
var
LMetaLogin: TMetaLogin;
LUser: TKinveyApi.TUser;
begin
if AObject.Data is TMetaLogin then
begin
LMetaLogin := TMetaLogin(AObject.Data);
KinveyAPI.Login(LMetaLogin.Login);
try
Result := KinveyAPI.RetrieveCurrentUser(LUser, AJSON);
AUser := TKinveyMetaFactory.CreateMetaFoundUser(LUser)
finally
KinveyAPI.Logout;
end;
end
else
raise EArgumentException.Create(sParameterNotMetaType);
end;
procedure TKinveyLoginAPI.LoginUser(const AUserName, APassword: string;
AProc: TFindObjectProc);
begin
KinveyAPI.LoginUser(AUserName, APassword,
procedure(const ALogin: TKinveyAPI.TLogin; const AUserObject: TJSONObject)
begin
AProc(TKinveyMetaFactory.CreateMetaLoginUser(ALogin), AUserObject);
end);
end;
procedure TKinveyLoginAPI.LoginUser(const AUserName, APassword: string; out AUser: TBackendEntityValue; const AJSON: TJSONArray);
var
LLogin: TKinveyAPI.TLogin;
begin
KinveyAPI.LoginUser(AUserName, APassword, LLogin, AJSON);
AUser := TKinveyMetaFactory.CreateMetaLoginUser(LLogin);
end;
procedure TKinveyLoginAPIHelper.LogoutUser;
begin
KinveyAPI.LogoutUser;
end;
procedure TKinveyLoginAPI.SignupUser(const AUserName, APassword: string;
const AUserData: TJSONObject; out ACreatedObject: TBackendEntityValue);
var
LLogin: TKinveyAPI.TLogin;
begin
KinveyAPI.SignupUser(AUserName, APassword, AUserData, LLogin);
ACreatedObject := TKinveyMetaFactory.CreateMetaSignupUser(LLogin);
end;
procedure TKinveyLoginAPI.UpdateUser(const AObject: TBackendEntityValue; const AUserData: TJSONObject;
out AUpdatedObject: TBackendEntityValue);
var
LUpdated: TKinveyAPI.TUpdatedAt;
LMetaUser: TMetaUser;
begin
if AObject.Data is TMetaUser then
begin
LMetaUser := TMetaUser(AObject.Data);
KinveyAPI.UpdateUser(LMetaUser.User, AUserData, LUpdated);
AUpdatedObject := TKinveyMetaFactory.CreateMetaUpdatedUser(LUpdated);
end
else
raise EArgumentException.Create(sParameterNotMetaType);
end;
{ TKinveyUsersAPI }
function TKinveyUsersAPI.DeleteUser(const AObject: TBackendEntityValue): Boolean;
begin
if AObject.Data is TMetaUser then
Result := KinveyAPI.DeleteUser((AObject.Data as TMetaUser).User)
else
raise EArgumentException.Create(sParameterNotMetaType);
end;
function TKinveyUsersAPI.FindUser(const AObject: TBackendEntityValue;
AProc: TFindObjectProc): Boolean;
var
LMetaUser: TMetaUser;
begin
if AObject.Data is TMetaUser then
begin
LMetaUser := TMetaUser(AObject.Data);
Result := KinveyAPI.RetrieveUser(LMetaUser.User,
procedure(const AUser: TKinveyAPI.TUser; const AObj: TJSONObject)
begin
AProc(TKinveyMetaFactory.CreateMetaFoundUser(AUser), AObj);
end);
end
else
raise EArgumentException.Create(sParameterNotMetaType);
end;
function TKinveyUsersAPI.FindUser(const AObject: TBackendEntityValue; out AUser: TBackendEntityValue; const AJSON: TJSONArray): Boolean;
var
LMetaUser: TMetaUser;
LUser: TKinveyApi.TUser;
begin
if AObject.Data is TMetaUser then
begin
LMetaUser := TMetaUser(AObject.Data);
Result := KinveyAPI.RetrieveUser(LMetaUser.User, LUser, AJSON);
AUser := TKinveyMetaFactory.CreateMetaFoundUser(LUser);
end
else
raise EArgumentException.Create(sParameterNotMetaType);
end;
function TKinveyUsersAPI.QueryUserName(const AUserName: string;
AProc: TFindObjectProc): Boolean;
begin
Result := KinveyAPI.QueryUserName(AUserName,
procedure(const AUser: TKinveyAPI.TUser; const AObj: TJSONObject)
begin
AProc(TKinveyMetaFactory.CreateMetaFoundUser(AUser), AObj);
end);
end;
function TKinveyUsersAPI.QueryUserName(const AUserName: string; out AUser: TBackendEntityValue; const AJSON: TJSONArray): Boolean;
var
LUser: TKinveyAPI.TUser;
begin
Result := KinveyAPI.QueryUserName(AUserName, LUser, AJSON);
AUser := TKinveyMetaFactory.CreateMetaFoundUser(LUser);
end;
procedure TKinveyUsersAPI.QueryUsers(const AQuery: array of string;
const AJSONArray: TJSONArray);
begin
KinveyAPI.QueryUsers(AQuery, AJSONArray);
end;
procedure TKinveyUsersAPI.QueryUsers(
const AQuery: array of string; const AJSONArray: TJSONArray; out AMetaArray: TArray<TBackendEntityValue>);
var
LUserArray: TArray<TKinveyAPI.TUser>;
LUser: TKinveyAPI.TUser;
LList: TList<TBackendEntityValue>;
begin
KinveyAPI.QueryUsers(AQuery, AJSONArray, LUserArray);
if Length(LUserArray) > 0 then
begin
LList := TList<TBackendEntityValue>.Create;
try
for LUser in LUserArray do
LList.Add(TKinveyMetaFactory.CreateMetaUserObject(LUser));
AMetaArray := LList.ToArray;
finally
LList.Free;
end;
end;
end;
{ TKinveyFilesAPI }
procedure TKinveyFilesAPI.UploadFile(const AFileName, AContentType: string;
out AFile: TBackendEntityValue);
var
LFile: TKinveyAPI.TFile;
LFound: Boolean;
begin
// Upload public file, no custom fields
KinveyAPI.UploadFile(AFileName, AContentType, True, nil, LFile);
LFound := KinveyAPI.RetrieveFile(LFile.ID,
procedure(const AFile: TKinveyAPI.TFile; const AJSON: TJSONObject)
begin
LFile := AFile;
end);
Assert(LFound);
AFile := TKinveyMetaFactory.CreateMetaUploadedFile(LFile);
end;
function TKinveyFilesAPI.DeleteFile(const AFile: TBackendEntityValue): Boolean;
begin
Result := KinveyAPI.DeleteFile(AFile.FileID);
end;
function TKinveyFilesAPI.GetMetaFactory: IBackendMetaFactory;
begin
Result := TMetaFactory.Create;
end;
procedure TKinveyFilesAPI.UploadFile(const AFileName: string;
const AStream: TStream; const AContentType: string;
out AFile: TBackendEntityValue);
var
LFile: TKinveyAPI.TFile;
LFound: Boolean;
begin
// Upload public file, no custom fields
KinveyAPI.UploadFile(AFileName, AStream, AContentType, True, nil, LFile);
LFound := KinveyAPI.RetrieveFile(LFile.ID,
procedure(const AFile: TKinveyAPI.TFile; const AJSON: TJSONObject)
begin
LFile := AFile;
end);
Assert(LFound);
AFile := TKinveyMetaFactory.CreateMetaUploadedFile(LFile);
end;
initialization
RegisterLogoutProc(TKinveyLoginAPI,
procedure (AServiceAPI: TObject)
begin
(AServiceAPI as TKinveyLoginAPI).LogoutUser;
end);
RegisterServices;
finalization
UnregisterServices;
end.
|
unit BigWindowForm;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Frame.CurrentsDiagramBase, Frame.BigWindow, GMDock, dxDockControl,
IniFiles, GMGlobals, ControlFrame;
type
TBigWindowFormForDocking = class(TGMForm)
BigWindowFrame1: TBigWindowFrame;
private
{ Private declarations }
public
{ Public declarations }
end;
TBigWindowDockPanel = class(TGMDockPanel)
private
function GetBigWindowIndex: int;
public
constructor Create(AOwner: TComponent); override;
procedure LoadLayoutFromCustomIni(AIniFile: TCustomIniFile; AParentForm: TCustomForm;
AParentControl: TdxCustomDockControl; ASection: string); override;
procedure SaveLayoutToCustomIni(AIniFile: TCustomIniFile; ASection: string); override;
property BigWindowIndex: int read GetBigWindowIndex;
end;
function CreateDockableBigWindow(index: int): TGMDockPanel;
implementation
{$R *.dfm}
uses BigWindowData;
{ TBigWindowDockPanel }
constructor TBigWindowDockPanel.Create(AOwner: TComponent);
begin
inherited;
InsertForm(TBigWindowFormForDocking);
end;
function CreateDockableBigWindow(index: int): TGMDockPanel;
begin
Result := TBigWindowDockPanel.Create(Application.MainForm);
Result.Parent := Application.MainForm;
TBigWindowFormForDocking(Result.GMForm).BigWindowFrame1.BigWindowIndex := index;
Result.Caption := BigWindowList[index].Caption;
Result.GMForm.Caption := Result.Caption;
end;
function TBigWindowDockPanel.GetBigWindowIndex: int;
begin
Result := TBigWindowFormForDocking(GMForm).BigWindowFrame1.BigWindowIndex;
end;
procedure TBigWindowDockPanel.LoadLayoutFromCustomIni(AIniFile: TCustomIniFile; AParentForm: TCustomForm;
AParentControl: TdxCustomDockControl; ASection: string);
var idx: int;
begin
inherited;
idx := AIniFile.ReadInteger(ASection, 'Index', -1);
if (idx >= 0) and (idx < BigWindowList.Count) then
begin
TBigWindowFormForDocking(GMForm).BigWindowFrame1.BigWindowIndex := idx;
Caption := BigWindowList[idx].Caption;
GMForm.Caption := Caption;
end
else
Close();
end;
procedure TBigWindowDockPanel.SaveLayoutToCustomIni(AIniFile: TCustomIniFile; ASection: string);
begin
inherited;
AIniFile.WriteInteger(ASection, 'Index', GetBigWindowIndex());
end;
initialization
RegisterClass(TBigWindowDockPanel);
end.
|
unit FileProxy;
{x$DEFINE BAD_PATTERN_CHECK}
{x$DEFINE PX_DEBUG}
{x$DEFINE DISABLE_WRITES}
{$DEFINE ATS}
interface
uses System.Sysutils, debug, numbers, systemx, windows;
type
TAlignedTempSpace = record
aligned: Pbyte;
procedure Allocate;
procedure Unallocate;
end;
PAlignedTempSpace = ^TalignedTempSpace;
function FileReadPx(ats: PAlignedTempSpace; Handle: THandle; var Buffer; Count: LongWord): Integer;inline;
function FileWritePx(ats: PAlignedTempSpace; Handle: THandle; const Buffer; Count: LongWord): Integer;inline;
function FileSeekPx(Handle: THandle; const Offset: Int64; Origin: Integer): Int64;inline;
{$IFDEF BAD_PATTERN_CHECK}
const
BAD_PATTERN: array [0..9] of byte = ($0f, $00, $00, $00, $00, $00, $00, $00, $00, $18);
{$ENDIF}
implementation
function FileReadPx(ats: PAlignedTempSpace; Handle: THandle; var Buffer; Count: LongWord): Integer;inline;
begin
{$IFNDEF ATS}
ats := nil;
{$ENDIF}
if ats = nil then begin
result := FileRead(Handle, buffer, count);
{$IFDEF PX_DEBUG}
Debug.Log('FileReadPx '+memorytohex(pbyte(@buffer), lesserof(count, 64)));
{$ENDIF}
end else begin
result := FileRead(Handle, ats.aligned^, lesserof(count,262144));
Movemem32(@buffer, ats.aligned, result);
end;
end;
function FileWritePx(ats: PAlignedTempSpace; Handle: THandle; const Buffer; Count: LongWord): Integer;inline;
begin
{$IFNDEF ATS}
ats := nil;
{$ENDIF}
if ats = nil then begin
{$IFDEF BAD_PATTERN_CHECK}
AlertMemoryPattern(@BAD_PATTERN[0], sizeof(BAD_PATTERN), pbyte(@Buffer), count);
{$ENDIF}
{$IFDEF PX_DEBUG}
Debug.Log('FileWritePx '+memorytohex(pbyte(@buffer), lesserof(count, 64)));
{$ENDIF}
{$IFDEF DISABLE_WRITES}
Debug.Log('WRITES ARE DISABLED: '+memorytohex(pbyte(@buffer), lesserof(count, 64)));
result := count;
{$ELSE}
result := FileWrite(Handle, buffer, count);
{$ENDIF}
end
else begin
{$IFDEF DISABLE_WRITES}
Debug.Log('WRITES ARE DISABLED: '+memorytohex(pbyte(@buffer), lesserof(count, 64)));
result := count;
{$ELSE}
Movemem32(ats.aligned,@buffer, lesserof(count,262144));
result := fileWrite(Handle, ats.aligned^, count);
{$ENDIF}
end;
end;
function FileSeekPx(Handle: THandle; const Offset: Int64; Origin: Integer): Int64;inline;
begin
{$IFDEF PX_DEBUG}
Debug.Log('FileSeekPx 0x'+inttohex(offset, 16));
{$ENDIF}
result := FileSeek(Handle, offset, origin);
end;
procedure TAlignedTempSpace.Allocate;
begin
aligned := VirtualAlloc(nil, 262144, MEM_COMMIT or MEM_RESERVE, PAGE_READWRITE);
end;
procedure TAlignedTempSpace.Unallocate;
begin
VirtualFree(aligned, 262144, MEM_RELEASE);
end;
end.
|
unit CustomErrorTable;
interface
uses FireDAC.Comp.Client, ProgressInfo, System.Classes, NotifyEvents,
TableWithProgress, DSWrap;
type
TCustomErrorTableW = class(TDSWrap)
private
FError: TFieldWrap;
protected const
public
const
ErrorMessage: String = 'Ошибка';
WarringMessage: String = 'Предупреждение';
constructor Create(AOwner: TComponent); override;
property Error: TFieldWrap read FError;
end;
TCustomErrorTable = class(TTableWithProgress)
private
FClone: TFDMemTable;
FWrap: TCustomErrorTableW;
function GetClone: TFDMemTable;
function GetErrorCount(AFilter: string): Integer;
function GetTotalError: Integer;
function GetTotalErrorsAndWarrings: Integer;
function GetTotalWarrings: Integer;
protected
function CreateWrap: TCustomErrorTableW; virtual;
public
constructor Create(AOwner: TComponent); override;
property Clone: TFDMemTable read GetClone;
property TotalError: Integer read GetTotalError;
property TotalErrorsAndWarrings: Integer read GetTotalErrorsAndWarrings;
property TotalWarrings: Integer read GetTotalWarrings;
property Wrap: TCustomErrorTableW read FWrap;
end;
implementation
uses System.SysUtils;
constructor TCustomErrorTable.Create(AOwner: TComponent);
begin
inherited;
FWrap := CreateWrap;
end;
function TCustomErrorTable.CreateWrap: TCustomErrorTableW;
begin
Result := TCustomErrorTableW.Create(Self);
end;
function TCustomErrorTable.GetClone: TFDMemTable;
begin
if FClone = nil then
FClone := Wrap.AddClone('');
Result := FClone;
end;
function TCustomErrorTable.GetErrorCount(AFilter: string): Integer;
begin
Clone.Filter := AFilter;
Clone.Filtered := True;
Result := Clone.RecordCount;
end;
function TCustomErrorTable.GetTotalError: Integer;
begin
Result := GetErrorCount(Format('%s=%s', [Wrap.Error.FieldName,
QuotedStr(Wrap.ErrorMessage)]));
end;
function TCustomErrorTable.GetTotalErrorsAndWarrings: Integer;
begin
Result := TotalError + TotalWarrings;
end;
function TCustomErrorTable.GetTotalWarrings: Integer;
begin
Result := GetErrorCount(Format('%s=%s', [Wrap.Error.FieldName,
QuotedStr( Wrap.WarringMessage )]));
end;
constructor TCustomErrorTableW.Create(AOwner: TComponent);
begin
inherited;
FError := TFieldWrap.Create(Self, 'Error', 'Вид ошибки');
end;
end.
|
unit BrickCamp.Resources.TAnswer;
interface
uses
System.Classes,
System.SysUtils,
System.JSON,
Spring.Container.Common,
Spring.Container,
MARS.Core.Registry,
MARS.Core.Attributes,
MARS.Core.MediaType,
MARS.Core.JSON,
MARS.Core.MessageBodyWriters,
MARS.Core.MessageBodyReaders,
BrickCamp.Repositories.IAnswer,
BrickCamp.Resources.IAnswer,
BrickCamp.Model,
BrickCamp.Model.IAnswer,
BrickCamp.Model.TAnswer;
type
[Path('/answer'), Produces(TMediaType.APPLICATION_JSON_UTF8)]
TAnswerResource = class(TInterfacedObject, IAnswerResurce)
protected
function GetAnswerFromJSON(const Value: TJSONValue): TAnswer;
public
[GET, Path('/getone/{Id}')]
function GetOne(const [PathParam] Id: Integer): TAnswer;
[GET, Path('/getlist/')]
function GetList: TJSONArray;
[POST]
procedure Insert(const [BodyParam] Value: TJSONValue);
[PUT]
procedure Update(const [BodyParam] Value: TJSONValue);
[DELETE, Path('/{Id}')]
procedure Delete(const [PathParam] Id: Integer);
[GET, Path('/getlistbyquestionid/QuestionId')]
function GetListByQuestionId(const [PathParam] QuestionId: Integer): TJSONArray;
end;
implementation
{ THelloWorldResource }
function TAnswerResource.GetAnswerFromJSON(const Value: TJSONValue): TAnswer;
var
JSONObject: TJSONObject;
begin
Result := GlobalContainer.Resolve<TAnswer>;
JSONObject := TJSONObject.ParseJSONValue(Value.ToJSON) as TJSONObject;
try
Result.QuestionId := JSONObject.ReadIntegerValue('QuestionId', -1);
Result.UserId := JSONObject.ReadIntegerValue('UserId', -1);
Result.Text := JSONObject.ReadStringValue('Text', '');
Result.RankIndex := JSONObject.ReadIntegerValue('RankIndex', -1);
finally
JSONObject.Free;
end;
end;
function TAnswerResource.GetOne(const Id: Integer): TAnswer;
begin
Result := GlobalContainer.Resolve<IAnswerRepository>.GetOne(Id);
end;
procedure TAnswerResource.Delete(const Id: Integer);
begin
GlobalContainer.Resolve<IAnswerRepository>.Delete(Id);
end;
procedure TAnswerResource.Insert(const Value: TJSONValue);
var
Answer: TAnswer;
begin
Answer := GetAnswerFromJSON(Value);
try
if Assigned(Answer) then
GlobalContainer.Resolve<IAnswerRepository>.Insert(Answer);
finally
Answer.Free;
end;
end;
procedure TAnswerResource.Update(const Value: TJSONValue);
var
Answer: TAnswer;
begin
Answer := GetAnswerFromJSON(Value);
try
if Assigned(Answer) then
GlobalContainer.Resolve<IAnswerRepository>.Update(Answer);
finally
Answer.Free;
end;
end;
function TAnswerResource.GetList: TJSONArray;
begin
result := GlobalContainer.Resolve<IAnswerRepository>.GetList;
end;
function TAnswerResource.GetListByQuestionId(const QuestionId: Integer): TJSONArray;
begin
Result := GlobalContainer.Resolve<IAnswerRepository>.GetListByQuestionId(QuestionId);
end;
initialization
TMARSResourceRegistry.Instance.RegisterResource<TAnswerResource>;
end.
|
program IniMod;
{
Jacek Pazera
https://www.pazera-software.com
https://github.com/jackdp
----------------------------------------------------
IniMod - Console application for managing INI files.
----------------------------------------------------
Compile using FPC 3.2.0 or newer. Older FPC versions may have a character encoding problem.
}
{$IFDEF FPC}{$mode objfpc}{$H+}{$ENDIF}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF}
SysUtils,
LazUTF8,
JPL.Console,
IM.App in 'IM.App.pas',
IM.Types in 'IM.Types.pas',
IM.Procs in 'IM.Procs.pas';
var
App: TApp;
{$IFDEF MSWINDOWS}
// Na Linuxie czasami wyskakuje EAccessViolation
//procedure MyExitProcedure;
//begin
// if Assigned(App) then
// begin
// App.Done;
// //FreeAndNil(App);
// end;
//end;
{$ENDIF}
{$R *.res}
begin
{$IFDEF FPC}
{$IF DECLARED(UseHeapTrace)}
GlobalSkipIfNoLeaks := True; // supported as of debugger version 3.2.0
{$ENDIF}
{$ENDIF}
App := TApp.Create;
try
try
//{$IFDEF MSWINDOWS}App.ExitProcedure := @MyExitProcedure;{$ENDIF}
App.Init;
App.Run;
if Assigned(App) then App.Done;
except
on E: Exception do
begin
Writeln(E.ClassName, ': ', E.Message);
if GetLastOSError <> 0 then Writeln('OS Error No. ', GetLastOSError, ': ', SysErrorMessage(GetLastOSError));
ExitCode := TConsole.ExitCodeError;
end;
end;
finally
if Assigned(App) then FreeAndNil(App);
end;
end.
|
{ These functions calculate the greatest common divisor of two numbers, using Euclid’s Algorithm. }
{ Here is a simple to understand implementation of the algorithm (which as a downside takes longer to execute) }
function gcd(x,y:longint):longint;
begin
while x<>y do
begin
if (x>y) then x := x-y
else y := y-x;
end;
gcd := x;
end;
{ And here is a faster implementation of the function, which instead of doing a subtraction each cycle,
it does all the subtractions at once by calculating the remainder (MOD) }
function gcd_faster(x,y:longint):longint;
var aux:longint;
begin
while y<>0 do
begin
aux := y;
y := x mod y;
x := aux;
end;
gcd_faster := x;
end;
|
unit fODDietLT;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
fAutoSz, ExtCtrls, StdCtrls, ORFn, fODBase, rODBase, VA508AccessibilityManager;
type
TfrmODDietLT = class(TfrmAutoSz)
lblMealCutoff: TStaticText;
Label2: TStaticText;
GroupBox1: TGroupBox;
cmdYes: TButton;
cmdNo: TButton;
radLT1: TRadioButton;
radLT2: TRadioButton;
radLT3: TRadioButton;
chkBagged: TCheckBox;
Bevel1: TBevel;
procedure cmdYesClick(Sender: TObject);
procedure cmdNoClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
FOutpatient: boolean;
YesPressed: Boolean;
public
{ Public declarations }
end;
TLateTrayFields = record
LateMeal: Char;
LateTime: string;
IsBagged: Boolean;
end;
procedure CheckLateTray(const StartTime: string; var LateTrayFields: TLateTrayFields; IsOutpatient: boolean; AMeal: char = #0);
procedure LateTrayCheck(SomeResponses: TResponses; EventId: integer; IsOutpatient: boolean; var LateTrayFields: TLateTrayFields);
procedure LateTrayOrder(LateTrayFields: TLateTrayFields; IsInpatient: boolean);
implementation
{$R *.DFM}
uses rCore, uCore, rODDiet, uConst, rOrders;
const
TX_MEAL_REQ = 'A meal time must be selected.';
TC_MEAL_REQ = 'No Meal Time Selected';
procedure CheckLateTray(const StartTime: string; var LateTrayFields: TLateTrayFields; IsOutpatient: boolean; AMeal: char = #0);
var
frmODDietLT: TfrmODDietLT;
DietParams: TDietParams;
FMTime: TFMDateTime;
TimePart: Extended;
Meal: Char;
AvailTimes,ALocation: string;
TimeCount: Integer;
function AMPMToFMTime(const x: string): Extended;
var
IntTime: Integer;
begin
Result := 0;
if Pos(':', x) = 0 then Exit;
IntTime := StrToIntDef(Piece(x, ':', 1) + Copy(Piece(x, ':', 2), 1, 2), 0);
if (Pos('P', x) > 0) and (IntTime < 1200) then IntTime := IntTime + 1200;
if (Pos('A', x) > 0) and (IntTime > 1200) then IntTime := IntTime - 1200;
Result := IntTime / 10000;
end;
function FMTimeToAMPM(x: Extended): string;
var
TimePart: extended;
AMPMTime, Suffix: string;
begin
TimePart := Frac(x);
if TimePart > 0.1159 then
begin
if TimePart > 0.1259 then x := x - 0.12;
Suffix := 'P'
end
else Suffix := 'A';
AMPMTime := FormatFMDateTime('hh:nn', x);
Result := AMPMTime + Suffix;
end;
procedure SetAvailTimes(ATime: Extended; var ACount: Integer; var TimeList: string);
var
i: Integer;
ReturnList: string;
begin
ACount := 0;
ReturnList := '';
for i := 1 to 3 do
if AMPMToFMTime(Piece(TimeList, U, i)) > ATime then
begin
if Length(ReturnList) > 0 then ReturnList := ReturnList + U;
ReturnList := ReturnList + Piece(TimeList, U, i);
Inc(ACount);
end;
TimeList := ReturnList;
end;
begin
// initialize LateTrayFields
LateTrayFields.LateMeal := #0;
LateTrayFields.LateTime := '';
LateTrayFields.IsBagged := False;
// make sure the start time is today and not in the future
FMTime := StrToFMDateTime(StartTime);
if FMTime < 0 then Exit;
if Int(FMTime) <> FMToday then Exit;
TimePart := Frac(FMTime);
if TimePart = 0 then TimePart := Frac(FMNow);
if TimePart > Frac(FMNow) then Exit;
Meal := #0;
ALocation := IntToStr(Encounter.Location);
LoadDietParams(DietParams,ALocation);
// check to see if falling within the alarm range of a meal
if not IsOutpatient then
begin
if (TimePart > (StrToIntDef(Piece(DietParams.Alarms, U, 1), 0) / 10000)) and
(TimePart < (StrToIntDef(Piece(DietParams.Alarms, U, 2), 0) / 10000)) then Meal := 'B';
if (TimePart > (StrToIntDef(Piece(DietParams.Alarms, U, 3), 0) / 10000)) and
(TimePart < (StrToIntDef(Piece(DietParams.Alarms, U, 4), 0) / 10000)) then Meal := 'N';
if (TimePart > (StrToIntDef(Piece(DietParams.Alarms, U, 5), 0) / 10000)) and
(TimePart < (StrToIntDef(Piece(DietParams.Alarms, U, 6), 0) / 10000)) then Meal := 'E';
if Meal = #0 then Exit;
end
else // for outpatients
begin
(* From Rich Knoepfle, NFS developer
If they order a breakfast and it is after the LATE BREAKFAST ALARM END, I don't allow them to do it. (For special meals I don't allow them to order something for the following day).
If it's before the LATE BREAKFAST ALARM BEGIN than I accept the order.
If it's between the LATE BREAKFAST ALARM BEGIN and ALARM END then I ask if they want to order a Late breakfast tray.
*)
Meal := AMeal;
case AMeal of
'B': if (TimePart < (StrToIntDef(Piece(DietParams.Alarms, U, 1), 0) / 10000)) or
(TimePart > (StrToIntDef(Piece(DietParams.Alarms, U, 2), 0) / 10000)) then Meal := #0;
'N': if (TimePart < (StrToIntDef(Piece(DietParams.Alarms, U, 3), 0) / 10000)) or
(TimePart > (StrToIntDef(Piece(DietParams.Alarms, U, 4), 0) / 10000)) then Meal := #0;
'E': if (TimePart < (StrToIntDef(Piece(DietParams.Alarms, U, 5), 0) / 10000)) or
(TimePart > (StrToIntDef(Piece(DietParams.Alarms, U, 6), 0) / 10000)) then Meal := #0;
end;
if Meal = #0 then exit;
end;
// get the available late times for this meal
case Meal of
'B': AvailTimes := Pieces(DietParams.BTimes, U, 4, 6);
'E': AvailTimes := Pieces(DietParams.ETimes, U, 4, 6);
'N': AvailTimes := Pieces(DietParams.NTimes, U, 4, 6);
end;
SetAvailTimes(TimePart, TimeCount, AvailTimes);
if TimeCount = 0 then Exit;
// setup form to get the selected late tray
frmODDietLT := TfrmODDietLT.Create(Application);
try
ResizeFormToFont(TForm(frmODDietLT));
with frmODDietLT do
begin
FOutpatient := IsOutpatient;
if Length(Piece(AvailTimes, U, 1)) > 0 then radLT1.Caption := Piece(AvailTimes, U, 1);
if Length(Piece(AvailTimes, U, 2)) > 0 then radLT2.Caption := Piece(AvailTimes, U, 2);
if Length(Piece(AvailTimes, U, 3)) > 0 then radLT3.Caption := Piece(AvailTimes, U, 3);
radLT1.Visible := Length(radLT1.Caption) > 0;
radLT2.Visible := Length(radLT2.Caption) > 0;
radLT3.Visible := Length(radLT3.Caption) > 0;
radLT1.Checked := TimeCount = 1;
chkBagged.Visible := DietParams.Bagged;
with lblMealCutOff do case Meal of
'B': Caption := 'You have missed the breakfast cut-off.';
'E': Caption := 'You have missed the evening cut-off.';
'N': Caption := 'You have missed the noon cut-off.';
end;
// display the form
ShowModal;
if YesPressed then
begin
with radLT1 do if Checked then LateTrayFields.LateTime := Caption;
with radLT2 do if Checked then LateTrayFields.LateTime := Caption;
with radLT3 do if Checked then LateTrayFields.LateTime := Caption;
LateTrayFields.LateMeal := Meal;
LateTrayFields.IsBagged := chkBagged.Checked;
end;
end; {with frmODDietLT}
finally
frmODDietLT.Release;
end;
end;
procedure LateTrayCheck(SomeResponses: TResponses; EventId: integer; IsOutpatient: boolean; var LateTrayFields: TLateTrayFields);
var
AResponse, AnotherResponse: TResponse;
begin
if IsOutpatient then
begin
AResponse := SomeResponses.FindResponseByName('ORDERABLE', 1);
if (EventID = 0) and (AResponse <> nil) and (Copy(AResponse.EValue, 1, 3) <> 'NPO') then
begin
AResponse := SomeResponses.FindResponseByName('START', 1);
AnotherResponse := SomeResponses.FindResponseByName('MEAL', 1);
if (AResponse <> nil) and (AnotherResponse <> nil) then
CheckLateTray(AResponse.IValue, LateTrayFields, True, CharAt(AnotherResponse.IValue, 1));
end;
end
else
begin
AResponse := SomeResponses.FindResponseByName('ORDERABLE', 1);
if (EventID = 0) and (AResponse <> nil) and (Copy(AResponse.EValue, 1, 3) <> 'NPO') then
begin
AResponse := SomeResponses.FindResponseByName('START', 1);
if AResponse <> nil then CheckLateTray(AResponse.IValue, LateTrayFields, False);
end;
end;
end;
procedure LateTrayOrder(LateTrayFields: TLateTrayFields; IsInpatient: boolean);
const
TX_EL_SAVE_ERR = 'An error occurred while saving this late tray order.';
TC_EL_SAVE_ERR = 'Error Saving Late Tray Order';
var
NewOrder: TOrder;
CanSign: integer;
begin
NewOrder := TOrder.Create;
try
with LateTrayFields do OrderLateTray(NewOrder, LateMeal, LateTime, IsBagged);
if NewOrder.ID <> '' then
begin
if IsInpatient then
begin
if (Encounter.Provider = User.DUZ) and User.CanSignOrders
then CanSign := CH_SIGN_YES
else CanSign := CH_SIGN_NA;
end
else
begin
CanSign := CH_SIGN_NA;
end;
Changes.Add(CH_ORD, NewOrder.ID, NewOrder.Text, '', CanSign);
SendMessage(Application.MainForm.Handle, UM_NEWORDER, ORDER_NEW, Integer(NewOrder))
end
else InfoBox(TX_EL_SAVE_ERR, TC_EL_SAVE_ERR, MB_OK);
finally
NewOrder.Free;
end;
end;
// ---------- frmODDietLT procedures ---------------
procedure TfrmODDietLT.FormCreate(Sender: TObject);
begin
inherited;
YesPressed := False;
end;
procedure TfrmODDietLT.cmdYesClick(Sender: TObject);
begin
inherited;
if not FOutpatient then
if (radLT1.Checked = False) and (radLT2.Checked = False) and (radLT3.Checked = False) then
begin
InfoBox(TX_MEAL_REQ, TC_MEAL_REQ, MB_OK);
Exit;
end;
YesPressed := True;
Close;
end;
procedure TfrmODDietLT.cmdNoClick(Sender: TObject);
begin
inherited;
Close;
end;
end.
|
(*
XML基础解析
原始作者:王云涛
建立时间:2011-12-02
*)
unit BASEXMLAPI;
interface
uses
SysUtils, Classes, XMLDoc, Variants, xmldom, XMLIntf, msxmldom, MSXML;
type
TBASEXMLAPI = class(TObject)
private
//格式化节点值,不存在节点返回空白字符
function FormatXMLDOMNodeValue(const Node: IXMLDOMNode): string;
protected
FXD: TXMLDocument;
//返回单节点
function SelectSingleNode(const queryString: string): IXMLDOMNode; overload;
function SelectSingleNode(const ParentNode: IXMLDOMNode; const queryString: string): IXMLDOMNode; overload;
//选择节点,返回节点列表
function SelectNodes(const queryString: string): IXMLDOMNodeList; overload;
function SelectNodes(const ParentNode: IXMLDOMNode; const queryString: string): IXMLDOMNodeList; overload;
//获取单节点值,不存在节点返回空白字符
function GetSingleNodeValue(const queryString: string): string; overload;
function GetSingleNodeValue(const ParentNode: IXMLDOMNode; const queryString: string): string; overload;
//载入节点信息,子类实现
procedure ParserXML(); virtual;
public
constructor Create(AOwner: TComponent); virtual;
destructor Destroy; override;
//载入并解析
function LoadXMLFile(const XmlFile: string): Boolean;
//设置,并解析
function SetXML(const Xml: string): Boolean;
function GetXML(): string;
end;
implementation
{ TBASEXMLAPI }
function TBASEXMLAPI.FormatXMLDOMNodeValue(const Node: IXMLDOMNode): string;
begin
Result := '';
if not assigned(Node) then Exit;
Result := Node.text;
end;
function TBASEXMLAPI.GetSingleNodeValue(const queryString: string): string;
begin
Result := GetSingleNodeValue(nil, queryString);
end;
function TBASEXMLAPI.GetSingleNodeValue(const ParentNode: IXMLDOMNode; const queryString: string): string;
var
DomNode: IXMLDOMNode;
begin
DomNode := SelectSingleNode(ParentNode, queryString);
Result := FormatXMLDOMNodeValue(DomNode);
end;
function TBASEXMLAPI.SelectNodes(const ParentNode: IXMLDOMNode; const queryString: string): IXMLDOMNodeList;
begin
if Assigned(ParentNode) then
Result := ParentNode.selectNodes(queryString)
else
Result := (FXD.DocumentElement.DOMNode as IXMLDOMNodeRef).GetXMLDOMNode.selectNodes(queryString);
end;
function TBASEXMLAPI.SelectNodes(const queryString: string): IXMLDOMNodeList;
begin
Result := SelectNodes(nil, queryString);
end;
function TBASEXMLAPI.SelectSingleNode(const ParentNode: IXMLDOMNode; const queryString: string): IXMLDOMNode;
begin
if Assigned(ParentNode) then
Result := ParentNode.selectSingleNode(queryString)
else
Result := (FXD.DocumentElement.DOMNode as IXMLDOMNodeRef).GetXMLDOMNode.selectSingleNode(queryString);
end;
function TBASEXMLAPI.SelectSingleNode(const queryString: string): IXMLDOMNode;
begin
Result := SelectSingleNode(nil, queryString);
end;
function TBASEXMLAPI.GetXML: string;
begin
Result := FXD.XML.Text;
end;
//XML 解析器初始化
constructor TBASEXMLAPI.Create(AOwner: TComponent);
begin
FXD := TXMLDocument.Create(AOwner);
FXD.DOMVendor := GetDOMVendor(SMSXML);
end;
//XML 解析器释放
destructor TBASEXMLAPI.Destroy;
begin
FreeAndNil(FXD);
//FXD.Free;
end;
function TBASEXMLAPI.LoadXMLFile(const XmlFile: string): Boolean;
var
xmlFileList: TStringList;
Stream: TMemoryStream;
begin
Result := False;
if not FileExists(XmlFile) then exit;
xmlFileList := TStringList.Create;
Stream := TMemoryStream.Create;
try
xmlFileList.LoadFromFile(XmlFile);
xmlFileList.SaveToStream(Stream);
Stream.Position := 0;
FXD.Active := False;
FXD.LoadFromStream(Stream);
FXD.Active := True;
//子类实现解析方法
ParserXML();
Result := True;
finally
Stream.Free;
xmlFileList.Free;
end;
end;
procedure TBASEXMLAPI.ParserXML;
begin
;
end;
function TBASEXMLAPI.SetXML(const Xml: string): Boolean;
var
Stream: TStringStream;
begin
Stream := TStringStream.Create(Xml);
try
Stream.Position := 0;
FXD.Active := False;
FXD.LoadFromStream(Stream);
FXD.Active := True;
//子类实现解析方法
ParserXML();
Result := True;
finally
Stream.Free;
end;
end;
end.
|
{*******************************************************}
{ }
{ Delphi DBX Framework }
{ }
{ Copyright(c) 1995-2011 Embarcadero Technologies, Inc. }
{ }
{*******************************************************}
{$HPPEMIT '#pragma link "Data.DbxSybaseASA"'} {Do not Localize}
unit Data.DbxSybaseASA;
interface
uses
Data.DBXDynalink,
Data.DBXDynalinkNative,
Data.DBXCommon, Data.DbxSybaseASAReadOnlyMetaData, Data.DbxSybaseASAMetaData;
type
TDBXSybaseASAProperties = class(TDBXProperties)
strict private
const StrASATransIsolation = 'ASA TransIsolation';
function GetHostName: string;
function GetDBHostName: string;
function GetPassword: string;
function GetUserName: string;
function GetBlobSize: Integer;
function GetSybaseASATransIsolation: string;
procedure SetBlobSize(const Value: Integer);
procedure SetSybaseASATransIsolation(const Value: string);
procedure SetHostName(const Value: string);
procedure SetDBHostName(const Value: string);
procedure SetPassword(const Value: string);
procedure SetUserName(const Value: string);
public
constructor Create(DBXContext: TDBXContext); override;
published
property HostName: string read GetHostName write SetHostName;
property DBHostName: string read GetDBHostName write SetDBHostName;
property UserName: string read GetUserName write SetUserName;
property Password: string read GetPassword write SetPassword;
property BlobSize: Integer read GetBlobSize write SetBlobSize;
property SybaseASATransIsolation:string read GetSybaseASATransIsolation write SetSybaseASATransIsolation;
end;
TDBXSybaseASADriver = class(TDBXDynalinkDriverNative)
public
constructor Create(DBXDriverDef: TDBXDriverDef); override;
end;
implementation
uses
Data.DBXPlatform, System.SysUtils;
const
sDriverName = 'ASA';
{ TDBXSybaseASADriver }
constructor TDBXSybaseASADriver.Create(DBXDriverDef: TDBXDriverDef);
var
Props: TDBXSybaseASAProperties;
I, Index: Integer;
begin
Props := TDBXSybaseASAProperties.Create(DBXDriverDef.FDBXContext);
if DBXDriverDef.FDriverProperties <> nil then
begin
for I := 0 to DBXDriverDef.FDriverProperties.Count - 1 do
begin
Index := Props.Properties.IndexOfName(DBXDriverDef.FDriverProperties.Properties.Names[I]);
if Index > -1 then
Props.Properties.Strings[Index] := DBXDriverDef.FDriverProperties.Properties.Strings[I];
end;
Props.AddUniqueProperties(DBXDriverDef.FDriverProperties.Properties);
DBXDriverDef.FDriverProperties.AddUniqueProperties(Props.Properties);
end;
inherited Create(DBXDriverDef, TDBXDynalinkDriverLoader, Props);
rpr;
end;
{ TDBXSybaseASAProperties }
constructor TDBXSybaseASAProperties.Create(DBXContext: TDBXContext);
begin
inherited Create(DBXContext);
Values[TDBXPropertyNames.DriverUnit] := 'Data.DbxSybaseASA';
Values[TDBXPropertyNames.DriverPackageLoader] := 'TDBXDynalinkDriverLoader,DBXSybaseASADriver160.bpl';
Values[TDBXPropertyNames.DriverAssemblyLoader] := 'Borland.Data.TDBXDynalinkDriverLoader,Borland.Data.DbxCommonDriver,Version=16.0.0.0,Culture=neutral,PublicKeyToken=' + TDBXPlatform.GetPublicKeyToken;
Values[TDBXPropertyNames.MetaDataPackageLoader] := 'TDBXSybaseASAMetaDataCommandFactory,DbxSybaseASADriver160.bpl';
Values[TDBXPropertyNames.MetaDataAssemblyLoader] := 'Borland.Data.TDBXSybaseASAMetaDataCommandFactory,Borland.Data.DbxSybaseASADriver,Version=16.0.0.0,Culture=neutral,PublicKeyToken=' + TDBXPlatform.GetPublicKeyToken;
Values[TDBXPropertyNames.GetDriverFunc] := 'getSQLDriverASA';
Values[TDBXPropertyNames.LibraryName] := 'dbxasa.dll';
Values[TDBXPropertyNames.LibraryNameOsx] := 'libsqlasa.dylib';
Values[TDBXPropertyNames.VendorLib] := 'dbodbc*.dll';
Values[TDBXPropertyNames.VendorLibWin64] := 'dbodbc*.dll';
Values[TDBXPropertynames.VendorLibOsx] := 'libdbodbc12.dylib';
Values[TDBXPropertyNames.HostName] := 'ServerName';
Values[TDBXPropertyNames.DBHostName] := '';
Values[TDBXPropertyNames.Database] := 'DBNAME';
Values[TDBXPropertyNames.UserName] := 'user';
Values[TDBXPropertyNames.Password] := 'password';
Values[TDBXPropertyNames.MaxBlobSize] := '-1';
Values[TDBXPropertyNames.ErrorResourceFile] := '';
Values[TDBXDynalinkPropertyNames.LocaleCode] := '0000';
Values[TDBXPropertyNames.IsolationLevel] := 'ReadCommitted';
Values['ConnectionString'] := '';
end;
function TDBXSybaseASAProperties.GetBlobSize: Integer;
begin
Result := StrToIntDef(Values[TDBXPropertyNames.MaxBlobSize], -1);
end;
function TDBXSybaseASAProperties.GetSybaseASATransIsolation: string;
begin
Result := Values[StrASATransIsolation];
end;
function TDBXSybaseASAProperties.GetHostName: string;
begin
Result := Values[TDBXPropertyNames.HostName];
end;
function TDBXSybaseASAProperties.GetDBHostName: string;
begin
Result := Values[TDBXPropertyNames.DBHostName];
end;
function TDBXSybaseASAProperties.GetPassword: string;
begin
Result := Values[TDBXPropertyNames.Password];
end;
function TDBXSybaseASAProperties.GetUserName: string;
begin
Result := Values[TDBXPropertyNames.UserName];
end;
procedure TDBXSybaseASAProperties.SetBlobSize(const Value: Integer);
begin
Values[TDBXPropertyNames.MaxBlobSize] := IntToStr(Value);
end;
procedure TDBXSybaseASAProperties.SetSybaseASATransIsolation(const Value: string);
begin
Values[StrASATransIsolation] := Value;
end;
procedure TDBXSybaseASAProperties.SetHostName(const Value: string);
begin
Values[TDBXPropertyNames.HostName] := Value;
end;
procedure TDBXSybaseASAProperties.SetDBHostName(const Value: string);
begin
Values[TDBXPropertyNames.DBHostName] := Value;
end;
procedure TDBXSybaseASAProperties.SetPassword(const Value: string);
begin
Values[TDBXPropertyNames.Password] := Value;
end;
procedure TDBXSybaseASAProperties.SetUserName(const Value: string);
begin
Values[TDBXPropertyNames.UserName] := Value;
end;
initialization
TDBXDriverRegistry.RegisterDriverClass(sDriverName, TDBXSybaseASADriver);
end.
|
//网上找到的delphi hashtable, delphi7下通过测试,其它版本没有测试,弄到这只是因为,代码可以研究。
// 我看过了的都加了点注释,后面没看了。
//
//Java 中的 Hashtable 类小巧好用,尤其是因为采用了哈希算法,查找的速度奇快。后来因
//工作需要,使用 Delphi 实施一些项目,特别不习惯没有哈希表的日子。于是决定自己动手做
//一个。
//不必白手起家,Delphi 中有一个 THashedStringList 类,它位于 IniFiles 单元中。它里面
//有一个不错的哈希算法,解决冲突的机制是“链地址”。把这个类改装改装,就成了自己的
//了。新鲜热辣,火爆出炉。下面就来看看新的 Hashtable 长得何许模样。
//使用起来就简单了:
//HashTable := THashTable.Create(); //创建
//HashTable.Put(Key, Value); //赋值
//Value=HashTable.Get(Key); //取值
//HashTable.Destroy; //撤消
unit Hashtable;
interface
uses SysUtils, Classes;
type
{ THashTable }
PPHashItem = ^PHashItem; //指向指针的指针,这个暂不明白
PHashItem = ^THashItem; //这是下面定义的记录(结构体)的指针
THashItem = record //这定义了一个记录(结构体)
Next: PHashItem;
Key: string;
Value: String;
end; //看完这个结构,让我想起了单链表了
THashTable = class //开始定义类了
private
Buckets: array of PHashItem; //一个指针数组
protected
function Find(const Key: string): PPHashItem; //通过string,返回指向记录体的指针
function HashOf(const Key: string): Cardinal; virtual;//Cardinal不知道接触delphi时间还不长,virtual应该是申明此函数为虚函数吧
public
constructor Create(Size: Integer = 256);
destructor Destroy; override;
procedure Put(const Key: string; Value: String);
procedure Clear;
procedure Remove(const Key: string);
function Modify(const Key: string; Value: String): Boolean;
function Get(const Key: string): String;
end;
implementation
{ THashTable }
procedure THashTable.Put(const Key: string; Value: String);
var
Hash: Integer;
Bucket: PHashItem;
begin
Hash := HashOf(Key) mod Cardinal(Length(Buckets)); //计算hash值
New(Bucket); //新建一个节点
Bucket^.Key := Key;
Bucket^.Value := Value;
Bucket^.Next := Buckets[Hash];//这个指针貌视指到了自己,是我看错了?
Buckets[Hash] := Bucket; // 将节点指针存入到数组,根据hash值
end;
procedure THashTable.Clear; //很明显,循环释放空间,清空数组
var
I: Integer;
P, N: PHashItem;
begin
for I := 0 to Length(Buckets) - 1 do
begin
P := Buckets[I];
while P <> nil do
begin
N := P^.Next;
Dispose(P);
P := N;
end;
Buckets[I] := nil;
end;
end;
constructor THashTable.Create(Size: Integer);//初始化hashtable即那个指针数组
begin
inherited Create;
SetLength(Buckets, Size);
end;
destructor THashTable.Destroy;
begin
Clear;
inherited;
end;
function THashTable.Find(const Key: string): PPHashItem;
var
Hash: Integer;
begin
Hash := HashOf(Key) mod Cardinal(Length(Buckets));
Result := @Buckets[Hash];
while Result^ <> nil do
begin
if Result^.Key = Key then
Exit
else
Result := @Result^.Next;
end;
end;
function THashTable.HashOf(const Key: string): Cardinal;
var
I: Integer;
begin
Result := 0;
for I := 1 to Length(Key) do
Result := ((Result shl 2) or (Result shr (SizeOf(Result) * 8 - 2))) xor
Ord(Key[I]);
end;
function THashTable.Modify(const Key: string; Value: String): Boolean;
var
P: PHashItem;
begin
P := Find(Key)^;
if P <> nil then
begin
Result := True;
P^.Value := Value;
end
else
Result := False;
end;
procedure THashTable.Remove(const Key: string);
var
P: PHashItem;
Prev: PPHashItem;
begin
Prev := Find(Key);
P := Prev^;
if P <> nil then
begin
Prev^ := P^.Next;
Dispose(P);
end;
end;
function THashTable.Get(const Key: string): String;
var
P: PHashItem;
begin
P := Find(Key)^;
if P <> nil then
Result := P^.Value else
Result := '';
end;
end.
|
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
Buttons;
type
{ Tfrm2015Assignment15 }
Tfrm2015Assignment15 = class(TForm)
BitBtn1: TBitBtn;
btnDeleteSelected: TButton;
btnInitialiseStrArray: TButton;
btnAssignStrArray: TButton;
btnCapitalStrArray: TButton;
btnDisplayStrArray: TButton;
btnInitialiseIntArray: TButton;
btnAssignIntArray: TButton;
btnDoubleIntArray: TButton;
btnDisplayIntArray: TButton;
btnCombinedArrays: TButton;
edtDateTime: TEdit;
gpbStringArrayOptions: TGroupBox;
gbpIntegerArrayOptions: TGroupBox;
lstArrayData: TListBox;
lstBoxOptions: TGroupBox;
memIntro: TMemo;
procedure BitBtn1Click(Sender: TObject);
procedure btnAssignIntArrayClick(Sender: TObject);
procedure btnAssignStrArrayClick(Sender: TObject);
procedure btnCapitalStrArrayClick(Sender: TObject);
procedure btnDeleteSelectedClick(Sender: TObject);
procedure btnDeleteSelectedMouseMove(Sender: TObject; Shift: TShiftState;
X, Y: Integer);
procedure btnDisplayIntArrayClick(Sender: TObject);
procedure btnDisplayStrArrayClick(Sender: TObject);
procedure btnDoubleIntArrayClick(Sender: TObject);
procedure btnInitialiseIntArrayClick(Sender: TObject);
procedure btnInitialiseStrArrayClick(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ private declarations }
const
nItems = 5;
var
nBasicsIntArray: array[0..(nItems - 1)] of integer;
nBasicsStrArray: array[0..(nItems - 1)] of string;
public
{ public declarations }
end;
var
frm2015Assignment15: Tfrm2015Assignment15;
implementation
{$R *.lfm}
{ Tfrm2015Assignment15 }
procedure Tfrm2015Assignment15.FormShow(Sender: TObject);
var
dDateTime: TDateTime;
begin
//set the date to the current date and time
dDateTime:=Date() + Time();
edtDateTime.Text:=DateTimeToStr(dDateTime);
edtDateTime.ReadOnly:=TRUE;
end;
procedure Tfrm2015Assignment15.btnAssignIntArrayClick(Sender: TObject);
var
iCount: integer;
sString: string;
begin
for iCount:= 0 to (nItems - 1) do
begin
sString:=InputBox('Insert integer value', 'Value' + IntToStr(iCount), '0');
nBasicsIntArray[iCount]:=StrToInt(sString);
end;
end;
procedure Tfrm2015Assignment15.BitBtn1Click(Sender: TObject);
begin
lstArrayData.Clear;
btnAssignStrArray.Enabled:=TRUE;
btnCapitalStrArray.Enabled:=TRUE;
btnDisplayStrArray.Enabled:=TRUE;
btnAssignIntArray.Enabled:=TRUE;
btnDoubleIntArray.Enabled:=TRUE;
btnDisplayIntArray.Enabled:=TRUE;
end;
procedure Tfrm2015Assignment15.btnAssignStrArrayClick(Sender: TObject);
var
sCount: integer;
sString: string;
begin
for sCount:= 0 to (nItems - 1) do
begin
sString:=InputBox('Type something', 'Your string', '');
nBasicsStrArray[sCount]:=sString;
end;
btnAssignStrArray.Enabled:=FALSE;
end;
procedure Tfrm2015Assignment15.btnCapitalStrArrayClick(Sender: TObject);
var
Index: integer;
dDateTime: TDateTime;
begin
dDateTime:=Date() + Time();
lstArrayData.Items.Add(DateTimeToStr(dDateTime));
for Index:= 0 to (nItems - 1) do
begin
lstArrayData.Items.Add(AnsiUpperCase(nBasicsStrArray[Index]));
end;
btnCapitalStrArray.Enabled:=FALSE;
end;
procedure Tfrm2015Assignment15.btnDeleteSelectedClick(Sender: TObject);
var
ListIndex: integer;
begin
//get index of selected name
ListIndex:=lstArrayData.ItemIndex;
lstArrayData.Items.Delete(ListIndex);
end;
procedure Tfrm2015Assignment15.btnDeleteSelectedMouseMove(Sender: TObject;
Shift: TShiftState; X, Y: Integer);
begin
end;
procedure Tfrm2015Assignment15.btnDisplayIntArrayClick(Sender: TObject);
var
Index: integer;
begin
for Index:=0 to nItems -1 do
lstArrayData.Items.Add(IntToStr(nBasicsIntArray[Index]));
end;
procedure Tfrm2015Assignment15.btnDisplayStrArrayClick(Sender: TObject);
var
//declare date variable for date output
//declare Index variable for for-loop
Index: integer;
dDateTime: TDateTime;
begin
//output date first
dDateTime:=Date() + Time();
lstArrayData.Items.Add(DateTimeToStr(dDateTime));
//traverse the array of strings
for Index:= 0 to (nItems - 1) do
begin
//print each array value to listbox
lstArrayData.Items.Add(nBasicsStrArray[Index]);
end;
btnDisplayStrArray.Enabled:=FALSE;
end;
procedure Tfrm2015Assignment15.btnDoubleIntArrayClick(Sender: TObject);
var
Count: integer;
begin
for Count:= 0 to (nItems - 1) do
begin
lstArrayData.Items.Add(FloatToStrF(Real(nBasicsIntArray[Count]), ffNumber, 15, 2));
end;
end;
procedure Tfrm2015Assignment15.btnInitialiseIntArrayClick(Sender: TObject);
var
//initialize int array to 5 0
Count: integer;
begin
for Count:= 0 to (nItems - 1) do
nBasicsIntArray[Count]:=0;
end;
procedure Tfrm2015Assignment15.btnInitialiseStrArrayClick(Sender: TObject);
var
//initialize string array to blanks
Count: integer;
begin
for Count:= 0 to (nItems - 1) do
nBasicsStrArray[Count]:= '';
end;
end.
|
{*********************************************************************
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Autor: Brovin Y.D.
* E-mail: y.brovin@gmail.com
*
********************************************************************}
unit FGX.Images.Types;
interface
uses
System.Classes, FMX.Graphics, FGX.Types;
type
{ TfgImageCollection }
TfgImageCollectionItem = class;
TfgImageCollection = class(TfgCollection)
private
function GetImageCollectionItem(const Index: Integer): TfgImageCollectionItem; overload;
function GetImageCollectionItem(const Index: string): TfgImageCollectionItem; overload;
public
property Images[const Index: Integer]: TfgImageCollectionItem read GetImageCollectionItem; default;
property Images[const Index: string]: TfgImageCollectionItem read GetImageCollectionItem; default;
end;
{ TfgImageCollectionItem }
TfgImageCollectionItem = class(TCollectionItem)
strict private
FBitmap: TBitmap;
FName: string;
procedure SetName(const Value: string);
procedure SetBitmap(const Value: TBitmap);
procedure HandlerBitmapChanged(Sender: TObject);
protected
function GetDisplayName: string; override;
public
constructor Create(Collection: TCollection); override;
destructor Destroy; override;
published
property Bitmap: TBitmap read FBitmap write SetBitmap;
property Name: string read FName write SetName;
end;
implementation
uses
System.SysUtils;
{ TfgImageCollectionItem }
constructor TfgImageCollectionItem.Create(Collection: TCollection);
begin
inherited Create(Collection);
FBitmap := TBitmap.Create(0, 0);
FBitmap.OnChange := HandlerBitmapChanged;
end;
destructor TfgImageCollectionItem.Destroy;
begin
FBitmap.Free;
inherited Destroy;
end;
function TfgImageCollectionItem.GetDisplayName: string;
var
DefaultName: string;
begin
if Name.IsEmpty then
DefaultName := inherited
else
DefaultName := Name;
if Bitmap.IsEmpty then
Result := Format('[Empty] - %s ', [DefaultName])
else
Result := Format('[%d x %d] - %s ', [Bitmap.Width, Bitmap.Height, DefaultName]);
end;
procedure TfgImageCollectionItem.HandlerBitmapChanged(Sender: TObject);
begin
Changed(False);
end;
procedure TfgImageCollectionItem.SetBitmap(const Value: TBitmap);
begin
FBitmap.Assign(Value);
end;
procedure TfgImageCollectionItem.SetName(const Value: string);
begin
if Name <> Value then
begin
FName := Value;
Changed(False);
end;
end;
{ TfgImageCollection }
function TfgImageCollection.GetImageCollectionItem(const Index: Integer): TfgImageCollectionItem;
begin
Result := Items[Index] as TfgImageCollectionItem;
end;
function TfgImageCollection.GetImageCollectionItem(const Index: string): TfgImageCollectionItem;
var
Found: Boolean;
I: Integer;
begin
Found := False;
I := 0;
while (I < Count) and not Found do
if string.Compare(Images[I].Name, Index, True ) <> 0 then
Found := True
else
Inc(I);
if Found then
Result := Images[I]
else
Result := nil;
end;
end.
|
unit Ths.Erp.Database.Table.SysTaxpayerType;
interface
{$I ThsERP.inc}
uses
SysUtils, Classes, Dialogs, Forms, Windows, Controls, Types, DateUtils,
FireDAC.Stan.Param, System.Variants, Data.DB,
Ths.Erp.Database,
Ths.Erp.Database.Table;
type
TSysTaxpayerType = class(TTable)
private
FTaxpayerType: TFieldDB;
FIsDefault: TFieldDB;
protected
procedure BusinessInsert(out pID: Integer; var pPermissionControl: Boolean);
override;
procedure BusinessUpdate(pPermissionControl: Boolean); override;
published
constructor Create(OwnerDatabase:TDatabase);override;
public
procedure SelectToDatasource(pFilter: string; pPermissionControl: Boolean=True); override;
procedure SelectToList(pFilter: string; pLock: Boolean; pPermissionControl: Boolean=True); override;
procedure Insert(out pID: Integer; pPermissionControl: Boolean=True); override;
procedure Update(pPermissionControl: Boolean=True); override;
function Clone():TTable;override;
Property TaxpayerType: TFieldDB read FTaxpayerType write FTaxpayerType;
Property IsDefault: TFieldDB read FIsDefault write FIsDefault;
end;
implementation
uses
Ths.Erp.Constants,
Ths.Erp.Database.Singleton;
constructor TSysTaxpayerType.Create(OwnerDatabase:TDatabase);
begin
inherited Create(OwnerDatabase);
TableName := 'sys_taxpayer_type';
SourceCode := '1000';
FTaxpayerType := TFieldDB.Create('taxpayer_type', ftString, '');
FIsDefault := TFieldDB.Create('is_default', ftBoolean, False);
end;
procedure TSysTaxpayerType.SelectToDatasource(pFilter: string; pPermissionControl: Boolean=True);
begin
if IsAuthorized(ptRead, pPermissionControl) then
begin
with QueryOfDS do
begin
Close;
SQL.Clear;
SQL.Text := Database.GetSQLSelectCmd(TableName, [
TableName + '.' + Self.Id.FieldName,
TableName + '.' + FTaxpayerType.FieldName,
TableName + '.' + FIsDefault.FieldName
]) +
'WHERE 1=1 ' + pFilter;
Open;
Active := True;
Self.DataSource.DataSet.FindField(Self.Id.FieldName).DisplayLabel := 'Id';
Self.DataSource.DataSet.FindField(FTaxpayerType.FieldName).DisplayLabel := 'Taxpayer Type';
Self.DataSource.DataSet.FindField(FIsDefault.FieldName).DisplayLabel := 'Default?';
end;
end;
end;
procedure TSysTaxpayerType.SelectToList(pFilter: string; pLock: Boolean; pPermissionControl: Boolean=True);
begin
if IsAuthorized(ptRead, pPermissionControl) then
begin
if (pLock) then
pFilter := pFilter + ' FOR UPDATE OF ' + TableName + ' NOWAIT';
with QueryOfList do
begin
Close;
SQL.Text := Database.GetSQLSelectCmd(TableName, [
TableName + '.' + Self.Id.FieldName,
TableName + '.' + FTaxpayerType.FieldName,
TableName + '.' + FIsDefault.FieldName
]) +
'WHERE 1=1 ' + pFilter;
Open;
FreeListContent();
List.Clear;
while NOT EOF do
begin
Self.Id.Value := FormatedVariantVal(FieldByName(Self.Id.FieldName).DataType, FieldByName(Self.Id.FieldName).Value);
FTaxpayerType.Value := FormatedVariantVal(FieldByName(FTaxpayerType.FieldName).DataType, FieldByName(FTaxpayerType.FieldName).Value);
FIsDefault.Value := FormatedVariantVal(FieldByName(FIsDefault.FieldName).DataType, FieldByName(FIsDefault.FieldName).Value);
List.Add(Self.Clone());
Next;
end;
Close;
end;
end;
end;
procedure TSysTaxpayerType.Insert(out pID: Integer; pPermissionControl: Boolean=True);
begin
if IsAuthorized(ptAddRecord, pPermissionControl) then
begin
with QueryOfInsert do
begin
Close;
SQL.Clear;
SQL.Text := Database.GetSQLInsertCmd(TableName, QUERY_PARAM_CHAR, [
FTaxpayerType.FieldName,
FIsDefault.FieldName
]);
NewParamForQuery(QueryOfInsert, FTaxpayerType);
NewParamForQuery(QueryOfInsert, FIsDefault);
Open;
if (Fields.Count > 0) and (not Fields.FieldByName(Self.Id.FieldName).IsNull) then
pID := Fields.FieldByName(Self.Id.FieldName).AsInteger
else
pID := 0;
EmptyDataSet;
Close;
end;
Self.notify;
end;
end;
procedure TSysTaxpayerType.Update(pPermissionControl: Boolean=True);
begin
if IsAuthorized(ptUpdate, pPermissionControl) then
begin
with QueryOfUpdate do
begin
Close;
SQL.Clear;
SQL.Text := Database.GetSQLUpdateCmd(TableName, QUERY_PARAM_CHAR, [
FTaxpayerType.FieldName, FIsDefault.FieldName
]);
NewParamForQuery(QueryOfUpdate, FTaxpayerType);
NewParamForQuery(QueryOfUpdate, FIsDefault);
NewParamForQuery(QueryOfUpdate, Id);
ExecSQL;
Close;
end;
Self.notify;
end;
end;
procedure TSysTaxpayerType.BusinessInsert(out pID: Integer;
var pPermissionControl: Boolean);
var
mukellef: TSysTaxpayerType;
n1: Integer;
begin
if Self.IsDefault.Value then
begin
mukellef := TSysTaxpayerType.Create(Database);
try
mukellef.SelectToList('', False, False);
for n1 := 0 to mukellef.List.Count-1 do
begin
TSysTaxpayerType(mukellef.List[n1]).IsDefault.Value := False;
TSysTaxpayerType(mukellef.List[n1]).Update(pPermissionControl);
end;
finally
mukellef.Free;
end;
end;
Self.Insert(pID, pPermissionControl);
end;
procedure TSysTaxpayerType.BusinessUpdate(pPermissionControl: Boolean);
var
mukellef: TSysTaxpayerType;
n1: Integer;
begin
if Self.IsDefault.Value then
begin
mukellef := TSysTaxpayerType.Create(Database);
try
mukellef.SelectToList('', False, False);
for n1 := 0 to mukellef.List.Count-1 do
begin
TSysTaxpayerType(mukellef.List[n1]).IsDefault.Value := False;
TSysTaxpayerType(mukellef.List[n1]).Update(pPermissionControl);
end;
finally
mukellef.Free;
end;
end;
Self.Update(pPermissionControl);
end;
function TSysTaxpayerType.Clone():TTable;
begin
Result := TSysTaxpayerType.Create(Database);
Self.Id.Clone(TSysTaxpayerType(Result).Id);
FTaxpayerType.Clone(TSysTaxpayerType(Result).FTaxpayerType);
FIsDefault.Clone(TSysTaxpayerType(Result).FIsDefault);
end;
end.
|
unit BCEditor.Utils;
interface
uses
Windows, Math, Classes, Graphics, Dialogs, BCEditor.Consts, BCEditor.Types;
function CeilOfIntDiv(ADividend: Cardinal; ADivisor: Word): Word;
function DeleteWhiteSpace(const AStr: string): string;
function GetTabConvertProc(TabWidth: Integer): TBCEditorTabConvertProc;
function GetTextSize(AHandle: HDC; AText: PChar; ACount: Integer): TSize;
function MessageDialog(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons): Integer;
function MinMax(Value, MinValue, MaxValue: Integer): Integer;
function TextExtent(ACanvas: TCanvas; const Text: string): TSize;
function TextWidth(ACanvas: TCanvas; const Text: string): Integer;
function TextHeight(ACanvas: TCanvas; const Text: string): Integer;
procedure ClearList(var List: TList);
procedure FreeList(var List: TList);
implementation
uses
Forms, SysUtils, Clipbrd, Character;
procedure FreeList(var List: TList);
begin
ClearList(List);
if Assigned(List) then
begin
List.Free;
List := nil;
end;
end;
function CeilOfIntDiv(ADividend: Cardinal; ADivisor: Word): Word;
var
LRemainder: Word;
begin
DivMod(ADividend, ADivisor, Result, LRemainder);
if LRemainder > 0 then
Inc(Result);
end;
procedure ClearList(var List: TList);
var
i: Integer;
begin
if not Assigned(List) then
Exit;
for i := 0 to List.Count - 1 do
if Assigned(List[i]) then
begin
TObject(List[i]).Free;
List[i] := nil;
end;
List.Clear;
end;
function DeleteWhiteSpace(const AStr: string): string;
var
i, j: Integer;
begin
SetLength(Result, Length(AStr));
j := 0;
for i := 1 to Length(AStr) do
if not TCharacter.IsWhiteSpace(AStr[i]) then
begin
Inc(j);
Result[j] := AStr[i];
end;
SetLength(Result, j);
end;
function MessageDialog(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons): Integer;
begin
with CreateMessageDialog(Msg, DlgType, Buttons) do
try
HelpContext := 0;
HelpFile := '';
Position := poMainFormCenter;
Result := ShowModal;
finally
Free;
end;
end;
function MinMax(Value, MinValue, MaxValue: Integer): Integer;
begin
Value := Min(Value, MaxValue);
Result := Max(Value, MinValue);
end;
function GetHasTabs(Line: PChar; var CharsBefore: Integer): Boolean;
begin
Result := False;
CharsBefore := 0;
if Assigned(Line) then
begin
while Line^ <> BCEDITOR_NONE_CHAR do
begin
if Line^ = BCEDITOR_TAB_CHAR then
Exit(True);
Inc(CharsBefore);
Inc(Line);
end;
end
end;
function ConvertTabs(const Line: string; TabWidth: Integer; var HasTabs: Boolean): string;
var
PSource: PChar;
begin
HasTabs := False;
Result := '';
PSource := PChar(Line);
while PSource^ <> BCEDITOR_NONE_CHAR do
begin
if PSource^ = BCEDITOR_TAB_CHAR then
begin
HasTabs := True;
Result := Result + StringOfChar(BCEDITOR_SPACE_CHAR, TabWidth);
end
else
Result := Result + PSource^;
Inc(PSource);
end;
end;
function GetTabConvertProc(TabWidth: Integer): TBCEditorTabConvertProc;
begin
Result := TBCEditorTabConvertProc(@ConvertTabs);
end;
function GetTextSize(AHandle: HDC; AText: PChar; ACount: Integer): TSize;
begin
Result.cx := 0;
Result.cy := 0;
GetTextExtentPoint32W(AHandle, AText, ACount, Result);
end;
type
TAccessCanvas = class(TCanvas)
end;
function TextExtent(ACanvas: TCanvas; const Text: string): TSize;
begin
with TAccessCanvas(ACanvas) do
begin
RequiredState([csHandleValid, csFontValid]);
Result := GetTextSize(Handle, PChar(Text), Length(Text));
end;
end;
function TextWidth(ACanvas: TCanvas; const Text: string): Integer;
begin
Result := TextExtent(ACanvas, Text).cx;
end;
function TextHeight(ACanvas: TCanvas; const Text: string): Integer;
begin
Result := TextExtent(ACanvas, Text).cy;
end;
end.
|
unit ARelOrdemSerra;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, formularios,
Componentes1, ExtCtrls, PainelGradiente, StdCtrls, Buttons, Mask,
numericos, Localizacao, UnDadosProduto;
type
TFRelOrdemSerra = class(TFormularioPermissao)
PainelGradiente1: TPainelGradiente;
PanelColor1: TPanelColor;
PanelColor2: TPanelColor;
BImprimir: TBitBtn;
BFechar: TBitBtn;
Localiza: TConsultaPadrao;
Label2: TLabel;
SpeedButton1: TSpeedButton;
Label3: TLabel;
Label1: TLabel;
SpeedButton2: TSpeedButton;
Label4: TLabel;
Label5: TLabel;
SpeedButton3: TSpeedButton;
Label6: TLabel;
EFilial: TEditLocaliza;
EOrdemProducao: TEditLocaliza;
EFracao: TEditLocaliza;
Label7: TLabel;
EOrdemInicial: Tnumerico;
EOrdemFinal: Tnumerico;
Label8: TLabel;
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure BFecharClick(Sender: TObject);
procedure EOrdemProducaoSelect(Sender: TObject);
procedure EFracaoSelect(Sender: TObject);
procedure BImprimirClick(Sender: TObject);
private
{ Private declarations }
VprDOrdemProducao : TRBDordemProducao;
public
{ Public declarations }
procedure ImprimeOrdemSErra(VpaCodFilial,VpaSeqOrdem, VpaSeqFracao : Integer);
end;
var
FRelOrdemSerra: TFRelOrdemSerra;
implementation
uses APrincipal, unOrdemProducao;
{$R *.DFM}
{ ****************** Na criação do Formulário ******************************** }
procedure TFRelOrdemSerra.FormCreate(Sender: TObject);
begin
{ abre tabelas }
{ chamar a rotina de atualização de menus }
end;
{ ******************* Quando o formulario e fechado ************************** }
procedure TFRelOrdemSerra.FormClose(Sender: TObject; var Action: TCloseAction);
begin
{ fecha tabelas }
{ chamar a rotina de atualização de menus }
Action := CaFree;
end;
{(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
Ações Diversas
)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))}
{******************************************************************************}
procedure TFRelOrdemSerra.BFecharClick(Sender: TObject);
begin
close;
end;
{******************************************************************************}
procedure TFRelOrdemSerra.EOrdemProducaoSelect(Sender: TObject);
begin
EOrdemProducao.ASelectLocaliza.Text := 'Select ORD.SEQORD, ORD.DATEMI, CLI.C_NOM_CLI from ORDEMPRODUCAOCORPO ORD, CADCLIENTES CLI '+
' Where ORD.EMPFIL = '+ IntToStr(EFilial.AInteiro)+
' and ORD.CODCLI = CLI.I_COD_CLI '+
' AND CLI.C_NOM_CLI like ''@%''';
EOrdemProducao.ASelectValida.Text := 'Select ORD.SEQORD, ORD.DATEMI, CLI.C_NOM_CLI From ORDEMPRODUCAOCORPO ORD, CADCLIENTES CLI '+
' Where ORD.EMPFIL = '+ IntToStr(EFilial.AInteiro)+
' and ORD.CODCLI = CLI.I_COD_CLI '+
' AND ORD.SEQORD = @';
end;
{******************************************************************************}
procedure TFRelOrdemSerra.EFracaoSelect(Sender: TObject);
begin
EFracao.ASelectLocaliza.Text := 'SELECT FRA.SEQFRACAO, FRA.DATENTREGA, FRA.QTDPRODUTO, FRA.CODESTAGIO from FRACAOOP FRA '+
' Where FRA.SEQFRACAO LIKE ''@%'''+
' AND FRA.CODFILIAL = '+IntToStr(EFilial.AInteiro)+
' and FRA.SEQORDEM = '+IntToStr(EOrdemProducao.AInteiro);
EFracao.ASelectValida.Text := 'SELECT FRA.SEQFRACAO, FRA.DATENTREGA, FRA.QTDPRODUTO, FRA.CODESTAGIO from FRACAOOP FRA '+
' Where FRA.SEQFRACAO = @ '+
' AND FRA.CODFILIAL = '+IntToStr(EFilial.AInteiro)+
' and FRA.SEQORDEM = '+IntToStr(EOrdemProducao.AInteiro);
end;
{******************************************************************************}
procedure TFRelOrdemSerra.ImprimeOrdemSErra(VpaCodFilial,VpaSeqOrdem, VpaSeqFracao : Integer);
begin
EFilial.AInteiro := VpaCodFilial;
EFilial.Atualiza;
EOrdemProducao.AInteiro := VpaSeqOrdem;
EOrdemProducao.atualiza;
EFracao.AInteiro := VpaSeqFracao;
EFracao.Atualiza;
Showmodal;
end;
{******************************************************************************}
procedure TFRelOrdemSerra.BImprimirClick(Sender: TObject);
begin
VprDOrdemProducao.free;
VprDOrdemProducao := TRBDOrdemProducao.cria;
VprDOrdemProducao.CodEmpresafilial := EFilial.AInteiro;
VprDOrdemProducao.SeqOrdem := EOrdemProducao.AInteiro;
VprDOrdemProducao.DatEmissao := date;
FunOrdemProducao.CarDOrdemSerra(VprDOrdemProducao,EOrdemInicial.AsInteger,EOrdemFinal.AsInteger) ;
FunOrdemProducao.ImprimeEtiquetaOrdemSerra(VprDOrdemProducao);
end;
Initialization
{ *************** Registra a classe para evitar duplicidade ****************** }
RegisterClasses([TFRelOrdemSerra]);
end.
|
{*******************************************************}
{ }
{ Delphi LiveBindings Framework }
{ }
{ Copyright(c) 2011-2018 Embarcadero Technologies, Inc. }
{ All rights reserved }
{ }
{*******************************************************}
unit System.Bindings.Manager;
interface
uses
System.SysUtils, System.Generics.Collections,
System.Bindings.Expression;
type
/// <summary>
/// Manages all the binding expressions and notifies them of changes in the
/// objects that are contained by the expressions. Managers can notify
/// sub-managers (or owned managers) about changes in objects.</summary>
/// <remarks>
/// For example, the application-wide manager will notify all its owned managers
/// that a property changed in some object. In this way, all the sub-managers can
/// re-evaluate their expressions.
/// </remarks>
TBindingManager = class(TObject)
protected
type
/// <summary>The type of the internal list that stores the sub-managers.</summary>
TManagerList = TList<TBindingManager>;
/// <summary>The type of the internal list that stores the binding expressions.</summary>
TExprList = TObjectList<TBindingExpression>;
private
FManagers: TManagerList;
FExpressions: TExprList;
[weak] FOwner: TBindingManager;
function GetExprCount: Integer; inline;
function GetExpressions(Index: Integer): TBindingExpression; inline;
function GetManagerCount: Integer; inline;
function GetManagers(Index: Integer): TBindingManager; inline;
protected
/// <summary>Stores the sub-managers of this manager. It can be used
/// by descendant classes to have extensive control over the sub-managers.</summary>
property ManagerList: TManagerList read FManagers;
/// <summary>Stores the binding expressions that this manager owns. It is
/// useful to descendant classes that need more control over the way the
/// binding expressions are managed internally.</summary>
property ExprList: TExprList read FExpressions;
public
/// <summary>Creates an instance of a binding manager.</summary>
/// <param name="Owner">The binding manager that will own the new instance.</param>
/// <remarks>If Owner is nil, it uses the application-wide binding manager
/// as the owner of the new instance. The new instance adds itself automatically
/// to the internal list of the list of sub-managers of the specified Owner
/// manager.</remarks>
constructor Create(Owner: TBindingManager = nil);
/// <summary>Destroys a binding manager instance.</summary>
destructor Destroy; override;
/// <summary>Creates a new binding expression object based on the given
/// expression string and adds this binding expression object to the
/// list of binding expressions.</summary>
/// <param name="Expr">The actual expression string based on which
/// the binding expression object is created.</param>
/// <returns>The index of the binding expression object within the list of
/// binding expression.</returns>
function Add(const Expr: String): Integer;
/// <summary>Adds a new binding expression object based on the given expression
/// string to the list of binding expressions.</summary>
/// <param name="Expr">The actual expression string based on which the
/// binding expression object is created.</param>
/// <returns>The binding expression object created from the given expression string.</returns>
function AddExpr(const Expr: String): TBindingExpression; inline;
/// <summary>Deletes and destroys a binding expression object from the list
/// of binding expressions.</summary>
/// <param name="Index">The index of the binding expression object within
/// the list of binding expressions.</param>
procedure Delete(Index: Integer); inline;
/// <summary>Deletes and destroys a given binding expression object located
/// within the list of binding expressions.</summary>
/// <param name="Expr">The binding expression object that must be deleted
/// and destroyed.</param>
/// <returns>The index of the binding expression object that has been deleted
/// and destroyed.</returns>
/// <remarks>It returns -1 if the given expression object was not found among
/// the binding expressions within the list of binding expressions.</remarks>
function Remove(Expr: TBindingExpression): Integer; inline;
/// <summary>Obtains the index of a binding expression object within the list
/// of binding expressions.</summary>
/// <param name="Expr">The binding expression object to be searched.</param>
/// <returns>The index of the given binding expression object.</returns>
/// <remarks>It returns -1 if the given binding expression object was not
/// found in the internal list of binding expressions.</remarks>
function IndexOf(Expr: TBindingExpression): Integer; inline;
/// <summary>Deletes and destroys all the contained binding expressions.</summary>
procedure Clear;
function Extract(Expr: TBindingExpression): TBindingExpression; inline;
/// <summary>The manager that owns this binding manager.</summary>
/// <remarks>Only the application-wide binding manager cannot be owned. This
/// property is nil for the application-wide binding manager.</remarks>
property Owner: TBindingManager read FOwner;
/// <summary>The sub-managers owned by this manager.</summary>
/// <remarks>They can only be added or removed only when a submanager
/// is created/destroyed.</remarks>
property Managers[Index: Integer]: TBindingManager read GetManagers;
/// <summary>The number of owned sub-managers.</summary>
property ManagerCount: Integer read GetManagerCount;
/// <summary>Access to the owned binding expression objects..</summary>
property Expressions[Index: Integer]: TBindingExpression read GetExpressions;
/// <summary>The number of owned binding expression objects.</summary>
property ExprCount: Integer read GetExprCount;
end;
implementation
uses
System.Bindings.Factories;
{ TBindingManager }
function TBindingManager.Add(const Expr: String): Integer;
var
LExpr: TBindingExpression;
begin
LExpr := TBindingExpressionFactory.CreateExpression(Self);
LExpr.Source := Expr;
Result := FExpressions.Add(LExpr);
end;
function TBindingManager.AddExpr(const Expr: String): TBindingExpression;
begin
Result := Expressions[Add(Expr)];
end;
procedure TBindingManager.Clear;
begin
FExpressions.Clear;
end;
constructor TBindingManager.Create(Owner: TBindingManager);
begin
inherited Create;
// determine the owning manager and add it to the owners list;
// the app wide manager doesn't have any owner, so the first time it is
// created, it cannot be added in it's (inexistent) owner's list
if not Assigned(Owner) and Assigned(TBindingManagerFactory.AppManager) then
Owner := TBindingManagerFactory.AppManager;
// if this is the AppManager being created, we don't have to add anything
if Assigned(Owner) then
begin
Owner.ManagerList.Add(Self);
Self.FOwner := Owner;
end;
FManagers := TManagerList.Create;
FExpressions := TExprList.Create;
end;
procedure TBindingManager.Delete(Index: Integer);
begin
FExpressions.Delete(Index);
end;
destructor TBindingManager.Destroy;
{$IFNDEF NEXTGEN}
var
Mgr: TBindingManager;
{$ENDIF}
begin
// delete the manager from its owner's list if it's not the app wide manager
if Assigned(Owner) then
Owner.ManagerList.Remove(Self);
{$IFNDEF NEXTGEN}
for Mgr in ManagerList do
Mgr.Free;
{$ENDIF}
FManagers.Free;
FExpressions.Free;
inherited;
end;
function TBindingManager.GetExprCount: Integer;
begin
Result := FExpressions.Count;
end;
function TBindingManager.GetExpressions(Index: Integer): TBindingExpression;
begin
Result := FExpressions[Index];
end;
function TBindingManager.GetManagerCount: Integer;
begin
Result := FManagers.Count;
end;
function TBindingManager.GetManagers(Index: Integer): TBindingManager;
begin
Result := FManagers[Index];
end;
function TBindingManager.IndexOf(Expr: TBindingExpression): Integer;
begin
Result := FExpressions.IndexOf(Expr);
end;
function TBindingManager.Remove(Expr: TBindingExpression): Integer;
begin
Result := FExpressions.Remove(Expr);
end;
function TBindingManager.Extract(Expr: TBindingExpression): TBindingExpression;
begin
Result := FExpressions.Extract(Expr);
end;
end.
|
unit ncgClassicMenu;
interface
uses
SysUtils,
Windows;
(***********************************************************************
** Who wants to know more about the method how I discovered all this
** may have a look at the following URL (German) or contact me via my
** forum:
**
** http://www.delphipraxis.net/topic62087,0,asc,0.html
***********************************************************************)
type
SHELLSTATE = packed record
Data: WORD;
end;
(*
BOOL fShowAllObjects : 1;
BOOL fShowExtensions : 1;
BOOL fNoConfirmRecycle : 1;
BOOL fShowSysFiles : 1;
BOOL fShowCompColor : 1;
BOOL fDoubleClickInWebView : 1;
BOOL fDesktopHTML : 1;
BOOL fWin95Classic : 1;
BOOL fDontPrettyPath : 1;
BOOL fShowAttribCol : 1; // No longer used, dead bit
BOOL fMapNetDrvBtn : 1;
BOOL fShowInfoTip : 1;
BOOL fHideIcons : 1;
BOOL fWebView : 1;
BOOL fFilter : 1;
BOOL fShowSuperHidden : 1;
BOOL fNoNetCrawling : 1;
*)
{ dwWin95Unused: DWORD; // Win95 only - no longer supported pszHiddenFileExts
uWin95Unused: UINT; // Win95 only - no longer supported cbHiddenFileExts
// Note: Not a typo! This is a persisted structure so we cannot use LPARAM
lParamSort: Integer;
iSortDirection: Integer;
version: UINT;
// new for win2k. need notUsed var to calc the right size of ie4 struct
// FIELD_OFFSET does not work on bit fields
uNotUsed: UINT; // feel free to rename and use
Flags2: DWORD;
(*
BOOL fSepProcess: 1;
// new for Whistler.
BOOL fStartPanelOn: 1; //Indicates if the Whistler StartPanel mode is ON or OFF.
BOOL fShowStartPage: 1; //Indicates if the Whistler StartPage on desktop is ON or OFF.
UINT fSpareFlags : 13;
*)
end;}
LPSHELLSTATE = ^SHELLSTATE;
const
SSF_SHOWALLOBJECTS = $00000001;
SSF_SHOWEXTENSIONS = $00000002;
SSF_HIDDENFILEEXTS = $00000004;
SSF_SERVERADMINUI = $00000004;
SSF_SHOWCOMPCOLOR = $00000008;
SSF_SORTCOLUMNS = $00000010;
SSF_SHOWSYSFILES = $00000020;
SSF_DOUBLECLICKINWEBVIEW = $00000080;
SSF_SHOWATTRIBCOL = $00000100;
SSF_DESKTOPHTML = $00000200;
SSF_WIN95CLASSIC = $00000400;
SSF_DONTPRETTYPATH = $00000800;
SSF_SHOWINFOTIP = $00002000;
SSF_MAPNETDRVBUTTON = $00001000;
SSF_NOCONFIRMRECYCLE = $00008000;
SSF_HIDEICONS = $00004000;
SSF_FILTER = $00010000;
SSF_WEBVIEW = $00020000;
SSF_SHOWSUPERHIDDEN = $00040000;
SSF_SEPPROCESS = $00080000;
SSF_NONETCRAWLING = $00100000;
SSF_STARTPANELON = $00200000;
SSF_SHOWSTARTPAGE = $00400000;
procedure SHGetSetSettings(lpss: LPSHELLSTATE; dwMask: DWORD; bSet: BOOL) stdcall;
external 'shell32.dll';
procedure SwitchClassicMenu(aClassic: Boolean);
implementation
uses ncDebug;
procedure SwitchClassicMenu(aClassic: Boolean);
var
lpss: SHELLSTATE;
bClassic: Boolean;
begin
ZeroMemory(@lpss, SizeOf(lpss));
// Retrieve current style
SHGetSetSettings(@lpss, SSF_WIN95CLASSIC, False);
DebugMsg('SwitchClassicMenu: ' + IntToStr(lpss.Data));
{ // Check the current style
bClassic := ((lpss.Flags1 and SSF_WIN95CLASSIC) = SSF_WIN95CLASSIC);
// If a change occurred
if (bClassic <> aClassic) then
begin
// If the user wants XP style then set it, else reset it }
if (aClassic) then
lpss.Data := SSF_WIN95CLASSIC
else
lpss.Data := 0;
// Set new style
SHGetSetSettings(@lpss, SSF_WIN95CLASSIC, True);
// end;
end;
end.
|
programme le_garage_automobile
//but: Créer des garages (identifié par nom,adresse,avec entre 6 voiture min et 15 voiture max), créer des voitures(identifiée par marque,model,energie,puissance
// fiscal,puissance DYN, couleur, Option, Année model, prix modele, cote argus, date de mis en circulation, age, plaque d'immatriculation),generer les plaques,
// calculer la cote argus et age, valider les saisies(dates, mails),associer les voitures à vos garages, affichage garage(avec leur véhicules), affichage garage
// avec le plus de véhicules, Affichage véhicule le plus ancien, affichage de la moyenne des véhicules par garage, et des 2 garages, affichage du véhicule le plus
// cher en valeur a neuf puis en côte argus a 3 ans, recherche des véhicules selon leurs critères.
//entrer: garage (nom, adresse,choix voture), voiture(choix marque,modele), associer les voitures a un garage
//sortie: Voiture( energie,puissance fiscal,puissance DYN, couleur, Option, Année model, prix modele, cote argus, date de mis en circulation,
// age, plaque d'immatriculation ), menu interaction utilisateur, Affichage véhicule le plus ancien, affichage de la moyenne des véhicules par garage,
// et des 2 garages, affichage du véhicule le plus cher en valeur a neuf puis en côte argus a 3 ans, recherche des véhicules selon leurs critères.
//entrer/sortie: affichage garage, creation voiture
type
garage_parametre=enregistrement
nom :chaine
numero :chaine
voie :chaine
cp :chaine
ville :chaine
pays :chaine
telephone :chaine
email :chaine
finenregistrement
type
voiture_parametre=enregistrement
marque:chaine
modele:chaine
energie:chaine
puissance_fiscale:chaine
puissance_dyn:chaine
couleur:chaine
option:chaine
annee_mod:chaine
prix_mod:chaine
cote_argus:reel
date_mise_circulation:
age:chaine
plaque_imma:chaine
finenregistrement
type
VOITURE=enregistrement
tab_garage:tableau[1..15]de voiture_parametre
finenregistrement
type
GARAGE=enregistrement
tab_garage:tableau[1..2]de VOITURE
finenregistrement
procedure creation_garage(var para_garage:garage_parametre)
debut
ecrire('Entrer le nom du garage ',i)
lire para_garage[i].nom
ecrire('entrer le numero de voie du garage ',i)
lire para_garage[i].numero
ecrire('entrer le type de voie du garage ',i)
lire para_garage[i].voie
ecrire('entrer le code poste du garage ',i)
lire para_garage[i].cp
tab_garage[i].cp <- extraction(tab_garage[i].cp,1,5)
ecrire('entrer la ville du garage ',i)
lire para_garage[i].ville
ecrire('entrer le pays du garage ',i)
lire para_garage[i].pays
ecrire('entrer le numero de téléphone du garage ',i)
lire para_garage[i].telephone
ecrire('entrer l''email du garage ',i)
lire para_garage[i].email
finprocedure
procedure generation_plaque
procedure creation_voiture
debut
ecrire('ecrivez la marque de votre choix entre :')
ecrire('1=AUDI 2=RENAUD 3=PEUGEOT 4=CITROEN 5=OPEL')
cas tab_garage[i].tab_voiture[i].marque parmi
1:tab_garage[i].tab_voiture[i].marque<- 'AUDI'
2:tab_garage[i].tab_voiture[i].marque<- 'RENAULT'
3:tab_garage[i].tab_voiture[i].marque<- 'PEUGEOT'
4:tab_garage[i].tab_voiture[i].marque<- 'CITROEN'
5:tab_garage[i].tab_voiture[i].marque<- 'OPEL'
if tab_garage[i].tab_voiture[i].marque='AUDI' alors
ecrire ('Modele de la marque de votre choix entre:',tab_garage[i].tab_voiture[i].marque)
ecrire('1=A1 2=A2 3=A3 ')
cas tab_garage[i].tab_voiture[i].modele parmi
1:tab_garage[i].tab_voiture[i].modele <- 'A1'
2:tab_garage[i].tab_voiture[i].modele <- 'A2'
3:tab_garage[i].tab_voiture[i].modele <- 'A3'
finsi
if tab_garage[i].tab_voiture[i].marque='RENAULT' alors
ecrire ('Modele de la marque de votre choix entre:',tab_garage[i].tab_voiture[i].marque)
ecrire('1=CLIO 2=SCENIC 3=KANGOO ')
cas tab_garage[i].tab_voiture[i].modele parmi
1:tab_garage[i].tab_voiture[i].modele <- 'CLIO'
2:tab_garage[i].tab_voiture[i].modele <- 'SCENIC'
3:tab_garage[i].tab_voiture[i].modele <- 'KANGOO'
finsi
if tab_garage[i].tab_voiture[i].marque='PEUGEOT' alors
ecrire ('Modele de la marque de votre choix entre:',tab_garage[i].tab_voiture[i].marque)
ecrire('1=308 2=3008 3=208 ')
cas tab_garage[i].tab_voiture[i].modele parmi
1:tab_garage[i].tab_voiture[i].modele <- '308'
2:tab_garage[i].tab_voiture[i].modele <- '3008'
3:tab_garage[i].tab_voiture[i].modele <- '208'
finsi
if tab_garage[i].tab_voiture[i].marque='CITROEN' alors
ecrire ('Modele de la marque de votre choix entre:',tab_garage[i].tab_voiture[i].marque)
ecrire('1=C3 2=C4 3=C5 ')
cas tab_garage[i].tab_voiture[i].modele parmi
1:tab_garage[i].tab_voiture[i].modele <- 'C3'
2:tab_garage[i].tab_voiture[i].modele <- 'C4'
3:tab_garage[i].tab_voiture[i].modele <- 'C5'
finsi
if tab_garage[i].tab_voiture[i].marque='OPEL' alors
ecrire ('Modele de la marque de votre choix entre:',tab_garage[i].tab_voiture[i].marque)
ecrire('1=ASTRAL 2=CORSA 3=ZAFIRA ')
cas tab_garage[i].tab_voiture[i].modele parmi
1:tab_garage[i].tab_voiture[i].modele <- 'ASTRAL'
2:tab_garage[i].tab_voiture[i].modele <- 'CORSA'
3:tab_garage[i].tab_voiture[i].modele <- 'ZAFIRA'
finsi
ecrire('Energie de votre choix entre:')
ecrire('1=Essence 2=Diesel 3=GPL 4=Electrique 5=Hybride')
cas tab_garage[i].tab_voiture[i].energie parmi
1:tab_garage[i].tab_voiture[i].energie <- 'Essence'
2:tab_garage[i].tab_voiture[i].energie <- 'Diesel'
3:tab_garage[i].tab_voiture[i].energie <- 'GPL'
4:tab_garage[i].tab_voiture[i].energie <- 'Electrique'
5:tab_garage[i].tab_voiture[i].energie <- 'Hybride'
finprocedure
procedure calcule_cote
procedure affichage_garage
var
choix:caractere
sortie: booleen
para_garage:tableau[1..10] de garage_parametre
debut
repeter
ecrire ('1: Fiche garage 1')
ecrire ('2: Fiche garage 2')
ecrire ('3: creation voiture')
ecrire ('4: recherche voiture')
ecrire ('5: véhicule le plus ancien')
ecrire ('6: garage qui la le plus de véhicules')
ecrire ('7: moyenne des véhicules')
ecrire ('0: pour sortir')
choix <- lire //lire la touche sur laquelle l'utilisateur a appuier
jusqu'a choix=true
fin
|
unit PacketPriority;
interface
{
Copyright (c) 2014, Oculus VR, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same directory.
}
/// \file
/// \brief This file contains enumerations for packet priority and reliability enumerations.
///
/// These enumerations are used to describe when packets are delivered.
type
TPacketPriority = (
/// The highest possible priority. These message trigger sends immediately, and are generally not buffered or aggregated into a single datagram.
IMMEDIATE_PRIORITY,
/// For every 2 IMMEDIATE_PRIORITY messages, 1 HIGH_PRIORITY will be sent.
/// Messages at this priority and lower are buffered to be sent in groups at 10 millisecond intervals to reduce UDP overhead and better measure congestion control.
HIGH_PRIORITY,
/// For every 2 HIGH_PRIORITY messages, 1 MEDIUM_PRIORITY will be sent.
/// Messages at this priority and lower are buffered to be sent in groups at 10 millisecond intervals to reduce UDP overhead and better measure congestion control.
MEDIUM_PRIORITY,
/// For every 2 MEDIUM_PRIORITY messages, 1 LOW_PRIORITY will be sent.
/// Messages at this priority and lower are buffered to be sent in groups at 10 millisecond intervals to reduce UDP overhead and better measure congestion control.
LOW_PRIORITY,
/// \internal
NUMBER_OF_PRIORITIES
);
/// These enumerations are used to describe how packets are delivered.
/// \note Note to self: I write this with 3 bits in the stream. If I add more remember to change that
/// \note In ReliabilityLayer::WriteToBitStreamFromInternalPacket I assume there are 5 major types
/// \note Do not reorder, I check on >= UNRELIABLE_WITH_ACK_RECEIPT
TPacketReliability = (
/// Same as regular UDP, except that it will also discard duplicate datagrams. RakNet adds (6 to 17) + 21 bits of overhead, 16 of which is used to detect duplicate packets and 6 to 17 of which is used for message length.
UNRELIABLE,
/// Regular UDP with a sequence counter. Out of order messages will be discarded.
/// Sequenced and ordered messages sent on the same channel will arrive in the order sent.
UNRELIABLE_SEQUENCED,
/// The message is sent reliably, but not necessarily in any order. Same overhead as UNRELIABLE.
RELIABLE,
/// This message is reliable and will arrive in the order you sent it. Messages will be delayed while waiting for out of order messages. Same overhead as UNRELIABLE_SEQUENCED.
/// Sequenced and ordered messages sent on the same channel will arrive in the order sent.
RELIABLE_ORDERED,
/// This message is reliable and will arrive in the sequence you sent it. Out or order messages will be dropped. Same overhead as UNRELIABLE_SEQUENCED.
/// Sequenced and ordered messages sent on the same channel will arrive in the order sent.
RELIABLE_SEQUENCED,
/// Same as UNRELIABLE, however the user will get either ID_SND_RECEIPT_ACKED or ID_SND_RECEIPT_LOSS based on the result of sending this message when calling RakPeerInterface::Receive(). Bytes 1-4 will contain the number returned from the Send() function. On disconnect or shutdown, all messages not previously acked should be considered lost.
UNRELIABLE_WITH_ACK_RECEIPT,
/// Same as UNRELIABLE_SEQUENCED, however the user will get either ID_SND_RECEIPT_ACKED or ID_SND_RECEIPT_LOSS based on the result of sending this message when calling RakPeerInterface::Receive(). Bytes 1-4 will contain the number returned from the Send() function. On disconnect or shutdown, all messages not previously acked should be considered lost.
/// 05/04/10 You can't have sequenced and ack receipts, because you don't know if the other system discarded the message, meaning you don't know if the message was processed
// UNRELIABLE_SEQUENCED_WITH_ACK_RECEIPT,
/// Same as RELIABLE. The user will also get ID_SND_RECEIPT_ACKED after the message is delivered when calling RakPeerInterface::Receive(). ID_SND_RECEIPT_ACKED is returned when the message arrives, not necessarily the order when it was sent. Bytes 1-4 will contain the number returned from the Send() function. On disconnect or shutdown, all messages not previously acked should be considered lost. This does not return ID_SND_RECEIPT_LOSS.
RELIABLE_WITH_ACK_RECEIPT,
/// Same as RELIABLE_ORDERED_ACK_RECEIPT. The user will also get ID_SND_RECEIPT_ACKED after the message is delivered when calling RakPeerInterface::Receive(). ID_SND_RECEIPT_ACKED is returned when the message arrives, not necessarily the order when it was sent. Bytes 1-4 will contain the number returned from the Send() function. On disconnect or shutdown, all messages not previously acked should be considered lost. This does not return ID_SND_RECEIPT_LOSS.
RELIABLE_ORDERED_WITH_ACK_RECEIPT,
/// Same as RELIABLE_SEQUENCED. The user will also get ID_SND_RECEIPT_ACKED after the message is delivered when calling RakPeerInterface::Receive(). Bytes 1-4 will contain the number returned from the Send() function. On disconnect or shutdown, all messages not previously acked should be considered lost.
/// 05/04/10 You can't have sequenced and ack receipts, because you don't know if the other system discarded the message, meaning you don't know if the message was processed
// RELIABLE_SEQUENCED_WITH_ACK_RECEIPT,
/// \internal
NUMBER_OF_RELIABILITIES
);
implementation
end.
|
unit frmBindingEditorU;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics, System.UITypes,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.Mask,
Vcl.Buttons, System.Actions, Vcl.ActnList, System.Types,
Vcl.ExtCtrls, AdvEdit, AdvIPEdit, Vcl.Menus;
type
TfrmBindingEditor = class(TForm)
ActionList: TActionList;
ActionSave: TAction;
ActionCancel: TAction;
PopupMenuIPAddress: TPopupMenu;
NukePanel1: TPanel;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
NukePanel2: TPanel;
NukePanel3: TPanel;
btnIPAddress: TBitBtn;
NukeLabelPanel1: TPanel;
NukeLabelPanel2: TPanel;
editIP: TAdvIPEdit;
Label1: TLabel;
Label2: TLabel;
editPort: TEdit;
procedure ActionSaveExecute(Sender: TObject);
procedure ActionCancelExecute(Sender: TObject);
procedure btnIPAddressClick(Sender: TObject);
procedure PopupMenuIPAddressPopup(Sender: TObject);
private
function Validate(var AMessage: string): Boolean;
procedure OnIPAddressPopupClickClick(Sender: TObject);
public
function Execute(var AIP: string; var APort: integer): Boolean;
end;
implementation
{$R *.dfm}
uses
dmReflectorU, ToolsU;
{ TfrmBindingEditor }
procedure TfrmBindingEditor.ActionCancelExecute(Sender: TObject);
begin
Self.ModalResult := mrCancel;
end;
procedure TfrmBindingEditor.ActionSaveExecute(Sender: TObject);
var
LMessage: string;
begin
if Validate(LMessage) then
begin
Self.ModalResult := mrOk;
end
else
begin
MessageDlg(LMessage, mtError, [mbOK], 0);
end;
end;
procedure TfrmBindingEditor.btnIPAddressClick(Sender: TObject);
begin
if (Sender is TWinControl) then
begin
with (Sender as TWinControl).ClientToScreen
(point((Sender as TWinControl).Width, (Sender as TWinControl).Height)) do
begin
PopupMenuIPAddress.Popup(X, Y);
end;
end;
end;
function TfrmBindingEditor.Execute(var AIP: string; var APort: integer)
: Boolean;
begin
Result := False;
editIP.IPAddress := AIP;
editPort.Text := APort.ToString;
if Self.ShowModal = mrOk then
begin
APort := StrToIntDef(editPort.Text, 0);
AIP := editIP.IPAddress;
Result := True;
end;
end;
procedure TfrmBindingEditor.OnIPAddressPopupClickClick(Sender: TObject);
var
LIPAddress: string;
begin
if (Sender is TMenuItem) then
begin
LIPAddress := (Sender as TMenuItem).Hint;
editIP.IPAddress := LIPAddress;
end;
end;
procedure TfrmBindingEditor.PopupMenuIPAddressPopup(Sender: TObject);
var
LIPAddress: TStringList;
LIdx: integer;
LMenuItem: TMenuItem;
begin
LIPAddress := TStringList.Create;
try
PopupMenuIPAddress.Items.Clear;
LIPAddress.Add('0.0.0.0');
GetNetworkIPList(LIPAddress);
For LIdx := 0 to Pred(LIPAddress.Count) do
begin
LMenuItem := TMenuItem.Create(PopupMenuIPAddress);
LMenuItem.Caption := LIPAddress[LIdx];
LMenuItem.Hint := LIPAddress[LIdx];
LMenuItem.OnClick := OnIPAddressPopupClickClick;
PopupMenuIPAddress.Items.Add(LMenuItem);
end;
finally
FreeAndNil(LIPAddress);
end;
end;
function TfrmBindingEditor.Validate(var AMessage: string): Boolean;
begin
Result := True;
if StrToIntDef(editPort.Text, 0) <= 0 then
begin
AMessage := 'Please specify a valid port';
Result := False;
end;
end;
end.
|
{*******************************************************}
{ }
{ Borland Delphi Visual Component Library }
{ SOAP Support }
{ }
{ Copyright (c) 2001 Borland Software Corporation }
{ }
{*******************************************************}
unit OPConvert;
interface
uses IntfInfo, InvokeRegistry, SysUtils, Classes, XMLIntf, SOAPAttachIntf, Contnrs;
type
{ Various options that control how data is [de]serialized. }
TSOAPConvertOption = (soSendUntyped, { Skip "xsi:type="xxx:xxxx" attribute }
soSendMultiRefObj, { Use HREF/ID for remotable types }
soSendMultiRefArray, { Use HREF/ID for arrays }
soTryAllSchema, { Allow 1999/2010/2001 mixing }
soRootRefNodesToBody, { HREF/ID nodes are siblings }
soDocument, { Don't use sec. 5 Encoding }
soReturnSuccessForFault, { Don't set statuscode 500 upon error }
soUTF8InHeader, { Put charset="UTF-8" in header }
soDontSendEmptyNodes, { Skip empty string/array & nil object nodes }
soCacheMimeResponse, { Cache Mime Response to Disk - HACK }
soDontClearOutBoundHeaders, { Outbound headers are not cleared - Client only!! }
soCustomFaultAtDetailsNode, { Outbound faults are at <details> instead of child of <details> }
soLiteralParams, { We re serializing Literal parameters - they we not unwound }
soUTF8EncodeXML, { uTF8Encode XML packet }
soXXXXHdr);
TSOAPConvertOptions = set of TSOAPConvertOption;
IOPConvert = interface
['{1F955FE3-890B-474C-A3A4-5E072D30CC4F}']
{ Property Accessors }
function GetOptions: TSOAPConvertOptions;
procedure SetOptions(const Value: TSOAPConvertOptions);
function GetAttachments: TSoapDataList;
procedure SetAttachments(Value: TSoapDataList);
function GetTempDir: string;
procedure SetTempDir(const Value: string);
function GetEncoding: WideString;
procedure SetEncoding(const Encoding: WideString);
{ client methods }
function InvContextToMsg(const IntfMD: TIntfMetaData;
MethNum: Integer;
Con: TInvContext;
Headers: THeaderList): TStream;
procedure ProcessResponse(const Resp: TStream;
const IntfMD: TIntfMetaData;
const MD: TIntfMethEntry;
Context: TInvContext;
Headers: THeaderList); overload;
{ Obsolete - use version that takes a stream as first parameter }
procedure ProcessResponse(const Resp: InvString;
const IntfMD: TIntfMetaData;
const MD: TIntfMethEntry;
Context: TInvContext); overload; deprecated;
{ server methods }
procedure MsgToInvContext(const Request: InvString;
const IntfMD: TIntfMetaData;
var MethNum: Integer;
Context: TInvContext); overload;
procedure MsgToInvContext(const Request: TStream;
const IntfMD: TIntfMetaData;
var MethNum: Integer;
Context: TInvContext;
Headers: THeaderList); overload;
procedure MakeResponse(const IntfMD: TIntfMetaData;
const MethNum: Integer;
Context: TInvContext;
Response: TStream;
Headers: THeaderList);
procedure MakeFault(const Ex: Exception; EStream: TStream);
property Attachments: TSoapDataList read GetAttachments write SetAttachments;
property Options: TSOAPConvertOptions read GetOptions write SetOptions;
property TempDir: string read GetTempDir write SetTempDir;
property Encoding: WideString read GetEncoding write SetEncoding;
end;
implementation
end.
|
unit ContactMgr_BOM;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils,
tiObject, tiVisitor, tiOID, tiOIDInteger;
type
{FORWARD DECLARATIONS}
TContactMgr = class;
TPeople = class;
TPerson = class;
TAdrsList = class;
TEAdrsList = class;
TAdrs = class;
{ TContactMgr }
TContactMgr = class(TtiObject)
private
FPeople: TPeople;
protected
function GetCaption: string; override;
public
constructor Create; override;
destructor Destroy; override;
published
property People: TPeople read FPeople;
end;
{ TPeople }
TPeople = class(TtiObjectList)
private
protected
function GetItems(i: integer): TPerson; reintroduce;
procedure SetItems(i: integer; const Value: TPerson); reintroduce;
function GetOwner: TContactMgr; reintroduce;
procedure SetOwner(const Value: TContactMgr); reintroduce;
public
property Items[i:integer]: TPerson read GetItems write SetItems;
procedure Add(AObject: TPerson); reintroduce;
property Owner: TContactMgr read GetOwner write SetOwner;
published
end;
{ TPerson }
TPerson = class(TtiObject)
private
FAdrsList: TAdrsList;
FEAdrsList: TEAdrsList;
FFirstName: string;
FInitials: string;
FLastName: string;
FNotes: string;
FTitle: string;
protected
function GetOwner: TPeople; reintroduce;
procedure SetOwner(const Value: TPeople); reintroduce;
public
constructor Create; override;
property Owner: TPeople read GetOwner write SetOwner;
published
property LastName: string read FLastName write FLastName;
property FirstName: string read FFirstName write FFirstName;
property Title: string read FTitle write FTitle;
property Initials: string read FInitials write FInitials;
property Notes: string read FNotes write FNotes;
property AdrsList: TAdrsList read FAdrsList;
property EAdrsList: TEAdrsList read FEAdrsList;
end;
TAdrsAbs = class(TtiObject)
private
FAdrsType: string;
published
property AdrsType: string read FAdrsType write FAdrsType;
end;
TAdrs = class(TAdrsAbs)
private
FCountry: string;
FSuburb: string;
FLines: string;
FPCode: string;
FState: string;
protected
function GetCaption: string; override;
function GetOwner: TAdrsList; reintroduce;
procedure SetOwner(const Value: TAdrsList); reintroduce;
property Owner: TAdrsList read GetOwner write SetOwner;
published
property Lines: string read FLines write FLines;
property Suburb: string read FSuburb write FSuburb;
property State: string read FState write FState;
property PCode: string read FPCode write FPCode;
property Country: string read FCountry write FCountry;
end;
{ TAdrsListAbs }
TAdrsListAbs = class(TtiObjectList)
protected
function GetOwner: TPerson; reintroduce;
procedure SetOwner(const Value: TPerson); reintroduce;
public
property Owner: TPerson read GetOwner write SetOwner;
end;
{ TAdrsList }
TAdrsList = class(TAdrsListAbs)
private
protected
function GetItems(i: integer): TAdrs; reintroduce;
procedure SetItems(i: integer; const Value: TAdrs); reintroduce;
public
property Items[i:integer]: TAdrs read GetItems write SetItems;
procedure Add(AObject: TAdrs); reintroduce;
published
end;
implementation
{ TAdrsListAbs }
function TAdrsListAbs.GetOwner: TPerson;
begin
end;
procedure TAdrsListAbs.SetOwner(const Value: TPerson);
begin
end;
{ TAdrsList }
function TAdrsList.GetItems(i: integer): TAdrs;
begin
//I Stopped HEre....???????????????????/////////////////////
end;
procedure TAdrsList.SetItems(i: integer; const Value: TAdrs);
begin
end;
procedure TAdrsList.Add(AObject: TAdrs);
begin
end;
{ TPerson }
function TPerson.GetOwner: TPeople;
begin
result := TPeople(inherited GetOwner);
end;
procedure TPerson.SetOwner(const Value: TPeople);
begin
inherited SetOwner(Value);
end;
constructor TPerson.Create;
begin
inherited;
FAdrsList := TAdrsList.Create;
FAdrsList.Owner := self;
FAdrsList.ItemOwner := self;
FEAdrsList := TEAdrsList.Create;
FEAdrsList.Owner := self;
FAdrsList.ItemOwner := self;
end;
{ TContactMgr }
function TContactMgr.GetCaption: string;
begin
Result:=inherited GetCaption;
end;
constructor TContactMgr.Create;
begin
inherited Create;
FPeople := TPeople.Create;
end;
destructor TContactMgr.Destroy;
begin
FPeople.Free;
inherited Destroy;
end;
{ TPeople }
function TPeople.GetItems(i: integer): TPerson;
begin
result := TPerson(inherited GetItems(i));
end;
procedure TPeople.SetItems(i: integer; const Value: TPerson);
begin
inherited SetItems(i, Value);
end;
function TPeople.GetOwner: TContactMgr;
begin
result := TContactMgr(inherited GetOwner);
end;
procedure TPeople.SetOwner(const Value: TContactMgr);
begin
inherited SetOwner(Value);
end;
procedure TPeople.Add(AObject: TPerson);
begin
inherited Add(AObject);
end;
end.
|
{$A+,B-,D+,E-,F-,G+,I+,L+,N+,O-,P-,Q-,R-,S-,T-,V+,X+,Y+}
{$M 1024,0,0}
{
by Behdad Esfahbod
Algorithmic Problems Book
August '1999
Problem 15 O(N3) Bfs Method
}
program
GirthOfGraph;
const
MaxN = 100;
var
N, V : Integer;
A : array [1 .. MaxN, 1 .. MaxN] of Integer;
Q, P, D, Gir : array [1 .. MaxN] of Integer;
M : array [1 .. MaxN] of Boolean;
I, J, K, L, R, G : Integer;
F : Text;
procedure ReadInput;
begin
Assign(F, 'input.txt');
Reset(F);
Readln(F, N);
for I := 2 to N do
begin
for J := 1 to I - 1 do
begin
Read(F, A[I, J]); A[J, I] := A[I, J];
end;
Readln(F);
end;
Close(F);
end;
procedure Girth;
begin
G := MaxInt;
for V := 1 to N do
begin
FillChar(M, SizeOf(M), 0);
L := 1; R := 1; Q[1] := V; M[V] := True; D[V] := 0;
while L <= R do
begin
if D[Q[L]] > (G - 1) div 2 then Break;
for I := 1 to N do
if (A[I, Q[L]] = 1) then
if not M[I] then
begin
Inc(R);
Q[R] := I;
M[I] := True;
P[I] := Q[L];
D[I] := D[Q[L]] + 1;
end
else
if (D[Q[L]] + D[I] + 1 < G) and (I <> P[Q[L]]) then
begin
G := D[Q[L]] + D[I] + 1;
K := Q[L];
for J := D[Q[L]] + 1 downto 1 do
begin
Gir[J] := K;
K := P[K];
end;
K := I;
for J := D[Q[L]] + 2 to D[Q[L]] + 1 + D[I] do
begin
Gir[J] := K;
K := P[K];
end;
end;
Inc(L);
end;
end;
end;
procedure WriteOutput;
begin
Assign(F, 'output.txt');
ReWrite(F);
Writeln(F, G);
for I := 1 to G do
Write(F, Gir[I], ' ');
Close(F);
end;
begin
ReadInput;
Girth;
WriteOutput;
end.
|
unit Code01.RemoveRepetitions;
interface
{
@theme: Delphi Challenge
@subject: #01 Remove Character Repetitions
@author: Jacek Laskowski
@date: 2020-05-09 21:00
Funkcja przyjmująca na wejściu dwa parametry:
- łańcuch tekstowy oraz
- znak (char),
celem funkcji jest usunięcie z zadanego łańcucha wszystkich powtórzonych
znaków zgodnych z podanym charem i pozostawienie go tylko pojedynczo.
Przykładowo przekazuję do funkcji łańcuch:
"Wlazł koooootek na płoooooootek i mruga",
oraz jako char literę "o",
a funkcja zwraca: "Wlazł kotek na płotek i mruga".
}
type
TChallengeParticipants = (
cpLukaszHamera, // LukasHamera - LukaszHamera
cpJacekLaskowski, // jaclas - Jacek Laskowski
cpLukaszKotynski, // Clarc1984 - Łukasz Kotyński
cpPiotrSlomski, // pslomski - Piotr Słomski
cpWaldekGorajek, // wgorajek - Waldek Gorajek
cpOngakw); // ???
var
aChallengeParticipants: TChallengeParticipants;
function Challenge01(const aText: string; const aChar: char): string;
implementation
uses
System.SysUtils,
System.RegularExpressions;
// ----------------------------------------------------------------
// Łukasz Hamera - solution
// ----------------------------------------------------------------
function Challenge01_LukaszHamera(const aText: string;
const aChar: char): string;
var
lInputStringIndex, lOutputStringSize: Integer;
lInputStringPointer, lOutputStringPointer: PChar;
begin
if (aText.IsEmpty OR (Length(aText) = 1)) then
begin
Exit(aText);
end;
SetLength(Result, Length(aText));
lInputStringPointer := PChar(aText);
lOutputStringPointer := PChar(Result);
lOutputStringPointer^ := lInputStringPointer^;
Inc(lInputStringPointer);
Inc(lOutputStringPointer);
for lInputStringIndex := 2 to Length(aText) do
begin
if (((lInputStringPointer - 1)^ = aChar) AND (lInputStringPointer^ = aChar))
then
begin
Inc(lInputStringPointer);
Continue;
end;
lOutputStringPointer^ := lInputStringPointer^;
Inc(lInputStringPointer);
Inc(lOutputStringPointer);
end;
lOutputStringSize := (Integer(lOutputStringPointer) - Integer(PChar(Result)))
div SizeOf(char);
SetLength(Result, lOutputStringSize);
end;
// ----------------------------------------------------------------
// Jacek Laskowski - solution
// ----------------------------------------------------------------
function Challenge01_JacekLaskowski(const aText: string;
const aChar: char): string;
var
i: Integer;
lSB: TStringBuilder;
iStart: Integer;
iEnd: Integer;
iCopyStart: Integer;
begin
if Length(aText) < 2 then
begin
Exit(aText);
end;
lSB := TStringBuilder.Create(Length(aText));
try
i := 1;
iStart := 1;
iEnd := 1;
iCopyStart := 1;
while i < Length(aText) do
begin
if aText[i] = aChar then
begin
Inc(iEnd);
end
else
begin
if iStart <> iEnd then
begin
lSB.Append(Copy(aText, iCopyStart, iStart - iCopyStart + 1));
iCopyStart := iEnd;
Inc(iEnd);
iStart := iEnd;
end
else
begin
Inc(iStart);
Inc(iEnd);
end;
end;
Inc(i);
end;
if iCopyStart < iStart then
begin
lSB.Append(Copy(aText, iCopyStart, iStart - iCopyStart + 1));
end;
Result := lSB.ToString;
finally
lSB.Free;
end;
end;
// ----------------------------------------------------------------
// Clarc1984 - solution
// ----------------------------------------------------------------
function Challenge01_Clarc1984(const aText: string; const aChar: char): string;
begin
Result := '';
for var i := 1 to High(aText) do
if (aText[i] = aChar) then
begin
if (aText[i - 1] <> aChar) then
Result := Result + aText[i];
end
else
Result := Result + aText[i];
end;
// ----------------------------------------------------------------
// Piotr Slomski - solution
// ----------------------------------------------------------------
function Challenge01_PiotrSlomski(const aText: string;
const aChar: char): string;
var
CurrChar, PrevChar: char;
begin
Result := '';
PrevChar := #0;
for CurrChar in aText do
begin
if CurrChar <> PrevChar then
Result := Result + CurrChar;
PrevChar := CurrChar;
end;
end;
// ----------------------------------------------------------------
// Waldek Gorajek - solution
// ----------------------------------------------------------------
function Challenge01_WaldekGorajek(const aText: string;
const aChar: char): string;
begin
Result := System.RegularExpressions.TRegEx.Replace(aText, aChar + '+', aChar);
end;
// ----------------------------------------------------------------
// ongakw - solution
// ----------------------------------------------------------------
function Challenge01_ongakw(const aText: string; const aChar: char): string;
var
znak_numer: Integer;
begin
Result := aText;
if Trim(Result) = '' then
Exit;
znak_numer := 1;
while znak_numer <= Length(Result) - 1 do
begin
if Result[znak_numer] = aChar then
while Result[znak_numer] = Result[znak_numer + 1] do
Delete(Result, znak_numer + 1, 1);
Inc(znak_numer);
end;
end;
// ----------------------------------------------------------------
// ----------------------------------------------------------------
function Challenge01(const aText: string; const aChar: char): string;
begin
case aChallengeParticipants of
cpLukaszHamera:
Result := Challenge01_LukaszHamera(aText, aChar);
cpJacekLaskowski:
Result := Challenge01_JacekLaskowski(aText, aChar);
cpLukaszKotynski:
Result := Challenge01_Clarc1984(aText, aChar);
cpPiotrSlomski:
Result := Challenge01_PiotrSlomski(aText, aChar);
cpWaldekGorajek:
Result := Challenge01_WaldekGorajek(aText, aChar);
cpOngakw:
Result := Challenge01_ongakw(aText, aChar);
end;
end;
end.
|
object AudioFormatForm: TAudioFormatForm
Left = 0
Top = 0
BorderStyle = bsDialog
Caption = 'Audio Format'
ClientHeight = 461
ClientWidth = 170
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
Position = poOwnerFormCenter
OnCreate = FormCreate
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 13
object FormatGroupBox: TGroupBox
Left = 8
Top = 6
Width = 154
Height = 79
Caption = ' Format '
TabOrder = 0
object ChannelsLabel: TLabel
Left = 9
Top = 52
Width = 48
Height = 13
Caption = 'Channels:'
end
object FormatComboBox: TComboBox
Left = 9
Top = 19
Width = 136
Height = 21
Style = csDropDownList
ItemHeight = 0
TabOrder = 0
OnChange = FormatComboBoxChange
end
object ChannelsComboBox: TComboBox
Left = 61
Top = 48
Width = 84
Height = 21
Style = csDropDownList
ItemHeight = 0
TabOrder = 1
OnChange = ChannelsComboBoxChange
end
end
object SampleRatesGroupBox: TGroupBox
Left = 8
Top = 90
Width = 154
Height = 144
Caption = ' Sample rates '
TabOrder = 1
object SampleRateCheckBox0: TCheckBox
Left = 9
Top = 17
Width = 60
Height = 17
Caption = '32.0 kHz'
TabOrder = 0
OnClick = SampleRateCheckBoxClick
end
object SampleRateCheckBox1: TCheckBox
Tag = 1
Left = 9
Top = 34
Width = 60
Height = 17
Caption = '44.1 kHz'
TabOrder = 1
OnClick = SampleRateCheckBoxClick
end
object SampleRateCheckBox2: TCheckBox
Tag = 2
Left = 9
Top = 51
Width = 60
Height = 17
Caption = '48.0 kHz'
TabOrder = 2
OnClick = SampleRateCheckBoxClick
end
object SampleRateCheckBox3: TCheckBox
Tag = 3
Left = 9
Top = 68
Width = 60
Height = 17
Caption = '88.2 kHz'
TabOrder = 3
OnClick = SampleRateCheckBoxClick
end
object SampleRateCheckBox4: TCheckBox
Tag = 4
Left = 9
Top = 85
Width = 60
Height = 17
Caption = '96.0 kHz'
TabOrder = 4
OnClick = SampleRateCheckBoxClick
end
object SampleRateCheckBox5: TCheckBox
Tag = 5
Left = 9
Top = 102
Width = 66
Height = 17
Caption = '176.4 kHz'
TabOrder = 5
OnClick = SampleRateCheckBoxClick
end
object SampleRateCheckBox6: TCheckBox
Tag = 6
Left = 9
Top = 119
Width = 66
Height = 17
Caption = '192.0 kHz'
TabOrder = 6
OnClick = SampleRateCheckBoxClick
end
end
object BitDepthsGroupBox: TGroupBox
Left = 8
Top = 239
Width = 154
Height = 76
Caption = ' Bit depths '
TabOrder = 2
object BitDepthCheckBox0: TCheckBox
Left = 9
Top = 17
Width = 46
Height = 17
Caption = '16-bit'
TabOrder = 0
OnClick = BitDepthCheckBoxClick
end
object BitDepthCheckBox1: TCheckBox
Tag = 1
Left = 9
Top = 34
Width = 46
Height = 17
Caption = '20-bit'
TabOrder = 1
OnClick = BitDepthCheckBoxClick
end
object BitDepthCheckBox2: TCheckBox
Tag = 2
Left = 9
Top = 51
Width = 46
Height = 17
Caption = '24-bit'
TabOrder = 2
OnClick = BitDepthCheckBoxClick
end
end
object BitRateGroupBox: TGroupBox
Left = 8
Top = 320
Width = 154
Height = 50
Caption = ' Maximum bit rate '
TabOrder = 3
object BitRateLabel: TLabel
Left = 45
Top = 22
Width = 26
Height = 13
Caption = 'kbit/s'
end
object BitRate: TEdit
Left = 9
Top = 19
Width = 30
Height = 21
MaxLength = 4
TabOrder = 0
OnChange = BitRateChange
OnExit = BitRateExit
end
end
object FlagsGroupBox: TGroupBox
Left = 8
Top = 375
Width = 154
Height = 50
Caption = ' Flags '
TabOrder = 4
object FlagsRangeLabel: TLabel
Left = 39
Top = 22
Width = 36
Height = 13
Caption = '(0-255)'
end
object Flags: TEdit
Left = 9
Top = 19
Width = 24
Height = 21
MaxLength = 3
TabOrder = 0
OnChange = FlagsChange
OnExit = FlagsExit
end
end
object FormOKButton: TButton
Left = 7
Top = 431
Width = 75
Height = 23
Caption = 'OK'
Default = True
ModalResult = 1
TabOrder = 5
end
object FormCancelButton: TButton
Left = 88
Top = 431
Width = 75
Height = 23
Cancel = True
Caption = 'Cancel'
ModalResult = 2
TabOrder = 6
end
end
|
unit FIToolkit.ProjectGroupParser.Exceptions;
interface
uses
FIToolkit.Commons.Exceptions;
type
EProjectsParserException = class abstract (ECustomException);
{ Project group parser exceptions }
EProjectGroupParseError = class (EProjectsParserException);
{ Project parser exceptions }
EProjectParseError = class (EProjectsParserException);
implementation
uses
FIToolkit.ProjectGroupParser.Consts;
initialization
RegisterExceptionMessage(EProjectGroupParseError, RSProjectGroupParseError);
RegisterExceptionMessage(EProjectParseError, RSProjectParseError);
end.
|
{$A+,B-,D+,E-,F-,G+,I+,L+,N+,O-,P-,Q-,R-,S-,T-,V+,X+,Y+}
{$M 1024,0,0}
{
by Behdad Esfahbod
Algorithmic Problems Book
April '2000
Problem 76 Simulating
}
program
CarsCircle;
const
Pi = 2 * System.Pi;
MaxN = 100;
type
TCar = record
V, V2 : Extended;
P : Extended;
T, T2 : Extended;
end;
TCars = array [0 .. MaxN] of TCar;
TTable = array [0 .. MaxN] of Integer;
var
N : Integer;
EndT : Extended;
Time, MinTime, DT : Extended;
Car : TCars;
Table, Map, Map2 : TTable;
I, J, P, Q : Integer;
Te : Extended;
procedure ReadInput;
begin
Assign(Input, 'input.txt');
Reset(Input);
Readln(N);
for I := 1 to N do
with Car[I] do
begin
Readln(P, V);
P := P * Pi / 100;
V := V * Pi / 100;
V2 := V;
Map[I] := I;
Table[I] := I;
T := -1;
end;
for I := 1 to N do
for J := I + 1 to N do
if Car[Table[I]].P > Car[Table[J]].P then
begin
Te := Car[Table[I]].P;
Car[Table[I]].P := Car[Table[J]].P;
Car[Table[J]].P := Te;
P := Map[I];
Map[I] := Map[J];
Map[J] := P;
end;
for I := 1 to N do
Map2[Map[I]] := I;
Readln(EndT);
Assign(Output, 'output.txt');
ReWrite(Output);
end;
procedure CloseOutput;
begin
Close(Input);
Close(Output);
end;
procedure Simulate;
begin
Time := 0;
MinTime := 0;
DT := 0;
while True do
begin
for I := 1 to n do
with Car[I] do
begin
P := P + V * DT;
while P > Pi do P := P - Pi;
while P < 0 do P := P + Pi;
T2 := 1E30;
end;
Q := N;
if Q < 3 then Dec(Q);
for I := 1 to Q do
with Car[Table[I]] do
if P = Car[Table[I mod N + 1]].P then
begin
if V * Car[Table[I mod N + 1]].V < 0 then
begin
V2 := -V;
Car[Table[I mod N + 1]].V2 := -Car[Table[I mod N + 1]].V;
end
else
if Abs(V) > Abs(Car[Table[I mod N + 1]].V) then
V2 := -V
else
Car[Table[I mod N + 1]].V2 := -Car[Table[I mod N + 1]].V;
end;
for I := 1 to Q do
with Car[Table[I]] do
if V > Car[Table[I mod N + 1]].V then
begin
Te := Car[Table[I mod N + 1]].P - P;
if Te <= 0 then Te := Pi - Te;
Te := Time + Te / (V - Car[Table[I mod N + 1]].V);
if Te < T2 then T2 := Te;
if Te < Car[Table[I mod N + 1]].T2 then Car[Table[I mod N + 1]].T2 := Te;
end;
if Time = EndT then
begin
for I := 1 to N do
Writeln(Car[Map2[I]].P * 100 / Pi : 0 : 3);
Writeln;
if Eof then
Break
else
Readln(EndT);
end;
MinTime := 1E30;
for I := 1 to N do
with Car[I] do
begin
if T2 < MinTime then MinTime := T2;
T := T2;
V := V2;
end;
if MinTime > EndT then MinTime := EndT;
DT := MinTime - Time;
Time := MinTime;
end;
end;
begin
ReadInput;
Simulate;
CloseOutput;
end.
|
unit uOpstelling;
interface
uses
Contnrs, uSelectie, uPlayer, uHTPredictor, Forms, Classes;
type
TOpstelling = class
private
FFrameOpstelling: TFrame;
FSelectie: TSelectie;
FOpstellingPlayerArray: array[1..14] of TPlayer;
FOpstellingOrderArray: array[1..14] of TPlayerOrder;
FSpelhervatter: TPlayer;
FAanvoerder: TPlayer;
FMotivatie: TOpstellingMotivatie;
FTactiek: TOpstellingTactiek;
FCoach: TOpstellingCoach;
FTacticLevel: double;
FHandmatigRV: double;
FHandmatigCV: double;
FHandmatigLV: double;
FHandmatigRA: double;
FHandmatigCA: double;
FHandmatigLA: double;
FHandmatigMID: double;
FFormatie: String;
procedure UpdateRatings;
procedure SetSelectie(const Value: TSelectie);
procedure SetAanvoerder(const Value: TPlayer);
procedure SetSpelhervatter(const Value: TPlayer);
procedure SetMotivatie(const Value: TOpstellingMotivatie);
procedure SetTactiek(const Value: TOpstellingTactiek);
procedure SetCoach(const Value: TOpstellingCoach);
procedure SetHandmatigRV(const Value: double);
function VerrekenTypeCoach(aRating: double; aVerdediging: boolean): double;
function VerwerkTeamgeest(aRating: double): double;
function OverCrowdingDef: double;
function OverCrowdingMid: double;
function OverCrowdingAanval: double;
function GetTacticLevel: double;
procedure SetHandmatigCA(const Value: double);
procedure SetHandmatigCV(const Value: double);
procedure SetHandmatigLA(const Value: double);
procedure SetHandmatigLV(const Value: double);
procedure SetHandmatigMID(const Value: double);
procedure SetHandmatigRA(const Value: double);
public
property HandmatigMID: double write SetHandmatigMID;
property HandmatigRV: double write SetHandmatigRV;
property HandmatigCV: double write SetHandmatigCV;
property HandmatigLV: double write SetHandmatigLV;
property HandmatigRA: double write SetHandmatigRA;
property HandmatigCA: double write SetHandmatigCA;
property HandmatigLA: double write SetHandmatigLA;
property Formatie: String read FFormatie write FFormatie;
property Selectie: TSelectie read FSelectie write SetSelectie;
property Spelhervatter: TPlayer read FSpelhervatter write SetSpelhervatter;
property Aanvoerder: TPlayer read FAanvoerder write SetAanvoerder;
property Motivatie: TOpstellingMotivatie read FMotivatie write SetMotivatie;
property Tactiek: TOpstellingTactiek read FTactiek write SetTactiek;
property Coach: TOpstellingCoach read FCoach write SetCoach;
property TacticLevel: double read GetTacticLevel;
constructor Create(aFrameOpstelling: TFrame);
function GetPlayerOnPosition(aPositie: TPlayerPosition): TPlayer;
function GetPositionOfPlayer(aPlayer: TPlayer): TPlayerPosition;
procedure ZetPlayerIDOpPositie(aPlayerID: integer; aPositie: TPlayerPosition; aPlayerOrder: TPlayerOrder);
function AantalPositiesBezet: integer;
function RV: double;
function CV: double;
function LV: double;
function RA: double;
function CA: double;
function LA: double;
function MID: double;
function TeamZelfvertrouwen: double;
function AantalKoppers: integer;
function AantalQWingers: integer;
function AantalQForwards: integer;
function AantalUwingers: integer;
function AantalUForwards: integer;
end;
implementation
uses
FormOpstelling, uRatingBijdrage, Math;
{ TOpstelling }
{-----------------------------------------------------------------------------
Author: Pieter Bas
Datum: 17-04-2012
Doel:
<eventuele fixes>
-----------------------------------------------------------------------------}
function TOpstelling.AantalKoppers: integer;
var
vCount: integer;
begin
Result := 0;
for vCount := Low(FOpstellingPlayerArray) to High(FOpstellingPlayerArray) do
begin
if FOpstellingPlayerArray[vCount] <> nil then
begin
if (not (vCount in [Ord(pOnbekend), Ord(pKP)])) then
begin
if (FOpstellingPlayerArray[vCount].Spec = 'H') then
begin
Inc(Result);
end;
end;
end;
end;
end;
function TOpstelling.AantalPositiesBezet: integer;
var
vCount: integer;
begin
Result := 0;
for vCount := Low(FOpstellingPlayerArray) to High(FOpstellingPlayerArray) do
begin
if FOpstellingPlayerArray[vCount] <> nil then
begin
Inc(Result);
end;
end;
end;
{-----------------------------------------------------------------------------
Author: Pieter Bas
Datum: 17-04-2012
Doel:
<eventuele fixes>
-----------------------------------------------------------------------------}
function TOpstelling.AantalQForwards: integer;
var
vCount: integer;
begin
Result := 0;
for vCount := Low(FOpstellingPlayerArray) to High(FOpstellingPlayerArray) do
begin
if FOpstellingPlayerArray[vCount] <> nil then
begin
if (vCount in [Ord(pRCA), Ord(pCA), Ord(pLCA)]) then
begin
if (FOpstellingPlayerArray[vCount].Spec = 'Q') then
begin
Inc(Result);
end;
end;
end;
end;
end;
function TOpstelling.AantalQWingers: integer;
var
vCount: integer;
begin
Result := 0;
for vCount := Low(FOpstellingPlayerArray) to High(FOpstellingPlayerArray) do
begin
if FOpstellingPlayerArray[vCount] <> nil then
begin
if (vCount in [Ord(pRW), Ord(pLW)]) then
begin
if (FOpstellingPlayerArray[vCount].Spec = 'Q') then
begin
Inc(Result);
end;
end;
end;
end;
end;
function TOpstelling.AantalUForwards: integer;
var
vCount: integer;
begin
Result := 0;
for vCount := Low(FOpstellingPlayerArray) to High(FOpstellingPlayerArray) do
begin
if FOpstellingPlayerArray[vCount] <> nil then
begin
if (vCount in [Ord(pRCA), Ord(pCA), Ord(pLCA)]) then
begin
if (FOpstellingPlayerArray[vCount].Spec = 'U') then
begin
Inc(Result);
end;
end;
end;
end;
end;
function TOpstelling.AantalUwingers: integer;
var
vCount: integer;
begin
Result := 0;
for vCount := Low(FOpstellingPlayerArray) to High(FOpstellingPlayerArray) do
begin
if FOpstellingPlayerArray[vCount] <> nil then
begin
if (vCount in [Ord(pRW), Ord(pLW)]) then
begin
if (FOpstellingPlayerArray[vCount].Spec = 'U') then
begin
Inc(Result);
end;
end;
end;
end;
end;
function TOpstelling.CA: double;
var
vCount: integer;
begin
Result := 0;
if (FHandmatigCA > 0) then
begin
Result := FHandmatigCA;
end
else
begin
for vCount := Low(FOpstellingPlayerArray) to High(FOpstellingPlayerArray) do
begin
if FOpstellingPlayerArray[vCount] <> nil then
begin
if (vCount in [Ord(pRCA), Ord(pCA), Ord(pLCA)]) then
begin
Result := Result + (FOpstellingPlayerArray[vCount].AANV_C_Bijdrage(Self) * OverCrowdingAanval);
end
else if (vCount in [Ord(pRCM), Ord(pCM), Ord(pLCM)]) then
begin
Result := Result + (FOpstellingPlayerArray[vCount].AANV_C_Bijdrage(Self) * OverCrowdingMid);
end
else if (vCount in [Ord(pRCV), Ord(pCV), Ord(pLCV)]) then
begin
Result := Result + (FOpstellingPlayerArray[vCount].AANV_C_Bijdrage(Self) * OverCrowdingDef);
end
else
begin
Result := Result + FOpstellingPlayerArray[vCount].AANV_C_Bijdrage(Self);
end;
end;
end;
Result := Result + (0.011339 * Result * Result);
Result := Result + (-0.000029 * Result * Result * Result);
Result := Result / 4;
Result := Result * TeamZelfvertrouwen;
if (Tactiek = tAfstandsSchoten) then
begin
Result := Result * 0.970577;
end;
//PB toegevoegd dikke duim in samenwerking HO
Result := Result * 0.77;
Result := 1 + VerrekenTypeCoach(Result, FALSE);
end;
end;
constructor TOpstelling.Create(aFrameOpstelling: TFrame);
begin
FFrameOpstelling := aFrameOpstelling;
FMotivatie := mNormaal;
FTactiek := tNormaal;
FCoach := cNeutraal;
FFormatie := '2-5-3 of zo?';
end;
{-----------------------------------------------------------------------------
Author: Pieter Bas
Datum: 17-04-2012
Doel:
<eventuele fixes>
-----------------------------------------------------------------------------}
function TOpstelling.CV: double;
var
vCount: integer;
begin
Result := 0;
if (FHandmatigCV > 0) then
begin
Result := FHandmatigCV;
end
else
begin
for vCount := Low(FOpstellingPlayerArray) to High(FOpstellingPlayerArray) do
begin
if FOpstellingPlayerArray[vCount] <> nil then
begin
if (vCount in [Ord(pRCA), Ord(pCA), Ord(pLCA)]) then
begin
Result := Result + (FOpstellingPlayerArray[vCount].DEF_C_Bijdrage(Self) * OverCrowdingAanval);
end
else if (vCount in [Ord(pRCM), Ord(pCM), Ord(pLCM)]) then
begin
Result := Result + (FOpstellingPlayerArray[vCount].DEF_C_Bijdrage(Self) * OverCrowdingMid);
end
else if (vCount in [Ord(pRCV), Ord(pCV), Ord(pLCV)]) then
begin
Result := Result + (FOpstellingPlayerArray[vCount].DEF_C_Bijdrage(Self) * OverCrowdingDef);
end
else
begin
Result := Result + FOpstellingPlayerArray[vCount].DEF_C_Bijdrage(Self);
end;
end;
end;
Result := Result + (0.008462 * Result * Result);
Result := Result + (-0.000017 * Result * Result * Result);
Result := Result / 4;
case Tactiek of
tVleugelAanval: Result := Result * 0.858029;
tCreatiefSpel: Result := Result * 0.930999;
end;
Result := 1 + VerrekenTypeCoach(Result, TRUE);
end;
end;
{-----------------------------------------------------------------------------
Author: Pieter Bas
Datum: 17-04-2012
Doel:
<eventuele fixes>
-----------------------------------------------------------------------------}
function TOpstelling.GetPlayerOnPosition(aPositie: TPlayerPosition): TPlayer;
begin
Result := FOpstellingPlayerArray[Ord(aPositie)];
end;
{-----------------------------------------------------------------------------
Author: Pieter Bas
Datum: 25-04-2012
Doel:
<eventuele fixes>
-----------------------------------------------------------------------------}
function TOpstelling.GetPositionOfPlayer(aPlayer: TPlayer): TPlayerPosition;
var
vCount: integer;
begin
Result := pOnbekend;
vCount := Low(FOpstellingPlayerArray);
while (Result = pOnbekend) and
(vCount <= High(FOpstellingPlayerArray)) do
begin
if (FOpstellingPlayerArray[vCount] = aPlayer) then
begin
Result := TPlayerPosition(vCount);
end;
Inc(vCount);
end;
end;
{-----------------------------------------------------------------------------
Author: Pieter Bas
Datum: 17-04-2012
Doel:
<eventuele fixes>
-----------------------------------------------------------------------------}
function TOpstelling.GetTacticLevel: double;
var
vCount: integer;
vLevel: double;
begin
if (FTacticLevel = 0) then
begin
if (FTactiek = tCounter) then
begin
for vCount := Low(FOpstellingPlayerArray) to High(FOpstellingPlayerArray) do
begin
if FOpstellingPlayerArray[vCount] <> nil then
begin
if (vCount in [Ord(pRB), Ord(pRCV), Ord(pCV), Ord(pLCV), Ord(pLB)]) then
begin
vLevel := (0.923695 * FOpstellingPlayerArray[vCount].PAS) +
(0.404393 * FOpstellingPlayerArray[vCount].DEF);
vLevel := vLevel * 0.235751;
vLevel := vLevel + (0.022976 * vLevel * vLevel);
vLevel := vLevel + (-0.000422 * vLevel * vLevel * vLevel);
FTacticLevel := FTacticLevel + vLevel;
end;
end;
end;
end
else if (FTactiek in [tCentrumAanval,tVleugelAanval]) then
begin
for vCount := Low(FOpstellingPlayerArray) to High(FOpstellingPlayerArray) do
begin
if FOpstellingPlayerArray[vCount] <> nil then
begin
if (not (vCount in [Ord(pKP)])) then
begin
vLevel := (0.194912 * FOpstellingPlayerArray[vCount].PAS);
vLevel := vLevel + (0.009067 * vLevel * vLevel);
vLevel := vLevel + (-0.000351 * vLevel * vLevel * vLevel);
FTacticLevel := FTacticLevel + vLevel;
end;
end;
end;
end
else if (FTactiek in [tPressie]) then
begin
for vCount := Low(FOpstellingPlayerArray) to High(FOpstellingPlayerArray) do
begin
if FOpstellingPlayerArray[vCount] <> nil then
begin
if (not (vCount in [Ord(pKP)])) then
begin
if (FOpstellingPlayerArray[vCount].Spec = 'P') then
begin
vLevel := 0.062717 * ((2 * FOpstellingPlayerArray[vCount].DEF) + FOpstellingPlayerArray[vCount].Conditie);
end
else
begin
vLevel := 0.062717 * (FOpstellingPlayerArray[vCount].DEF + FOpstellingPlayerArray[vCount].Conditie);
end;
vLevel := vLevel + (0.035617 * vLevel * vLevel);
vLevel := vLevel + (-0.001443 * vLevel * vLevel * vLevel);
FTacticLevel := FTacticLevel + vLevel;
end;
end;
end;
end
else if (FTactiek in [tAfstandsSchoten]) then
begin
for vCount := Low(FOpstellingPlayerArray) to High(FOpstellingPlayerArray) do
begin
if FOpstellingPlayerArray[vCount] <> nil then
begin
if (not (vCount in [Ord(pKP)])) then
begin
vLevel := 0.001162 * ((3 * FOpstellingPlayerArray[vCount].SCO) + FOpstellingPlayerArray[vCount].SP);
vLevel := vLevel + (-0.310785 * vLevel * vLevel);
vLevel := vLevel + (302.472449 * vLevel * vLevel * vLevel);
FTacticLevel := FTacticLevel + vLevel;
end;
end;
end;
end
else
begin
FTacticLevel := 20;
end;
end;
Result := FTacticLevel;
end;
function TOpstelling.LA: double;
var
vCount: integer;
begin
Result := 0;
if (FHandmatigLA > 0) then
begin
Result := FHandmatigLA;
end
else
begin
for vCount := Low(FOpstellingPlayerArray) to High(FOpstellingPlayerArray) do
begin
if FOpstellingPlayerArray[vCount] <> nil then
begin
if (vCount in [Ord(pRCA), Ord(pCA), Ord(pLCA)]) then
begin
Result := Result + (FOpstellingPlayerArray[vCount].AANV_L_Bijdrage(Self) * OverCrowdingAanval);
end
else if (vCount in [Ord(pRCM), Ord(pCM), Ord(pLCM)]) then
begin
Result := Result + (FOpstellingPlayerArray[vCount].AANV_L_Bijdrage(Self) * OverCrowdingMid);
end
else if (vCount in [Ord(pRCV), Ord(pCV), Ord(pLCV)]) then
begin
Result := Result + (FOpstellingPlayerArray[vCount].AANV_L_Bijdrage(Self) * OverCrowdingDef);
end
else
begin
Result := Result + FOpstellingPlayerArray[vCount].AANV_L_Bijdrage(Self);
end;
end;
end;
Result := Result + (0.012093 * Result * Result);
Result := Result + (-0.000027 * Result * Result * Result);
Result := Result / 4;
Result := Result * TeamZelfvertrouwen;
if (Tactiek = tAfstandsSchoten) then
begin
Result := Result * 0.972980;
end;
//PB toegevoegd dikke duim in samenwerking HO
Result := Result * 0.77;
Result := 1 + VerrekenTypeCoach(Result, FALSE);
end;
end;
function TOpstelling.LV: double;
var
vCount: integer;
begin
Result := 0;
if (FHandmatigLV > 0) then
begin
Result := FHandmatigLV;
end
else
begin
for vCount := Low(FOpstellingPlayerArray) to High(FOpstellingPlayerArray) do
begin
if FOpstellingPlayerArray[vCount] <> nil then
begin
if (vCount in [Ord(pRCA), Ord(pCA), Ord(pLCA)]) then
begin
Result := Result + (FOpstellingPlayerArray[vCount].DEF_L_Bijdrage(Self) * OverCrowdingAanval);
end
else if (vCount in [Ord(pRCM), Ord(pCM), Ord(pLCM)]) then
begin
Result := Result + (FOpstellingPlayerArray[vCount].DEF_L_Bijdrage(Self) * OverCrowdingMid);
end
else if (vCount in [Ord(pRCV), Ord(pCV), Ord(pLCV)]) then
begin
Result := Result + (FOpstellingPlayerArray[vCount].DEF_L_Bijdrage(Self) * OverCrowdingDef);
end
else
begin
Result := Result + FOpstellingPlayerArray[vCount].DEF_L_Bijdrage(Self);
end;
end;
end;
Result := Result + (0.011591 * Result * Result);
Result := Result + (-0.000029 * Result * Result * Result);
Result := Result / 4;
case Tactiek of
tCentrumAanval: Result := Result * 0.853911;
tCreatiefSpel: Result := Result * 0.930663;
end;
Result := 1 + VerrekenTypeCoach(Result, TRUE);
end;
end;
function TOpstelling.MID: double;
var
vCount: integer;
begin
Result := 0;
if (FHandmatigMID > 0) then
begin
Result := FHandmatigMID;
end
else
begin
for vCount := Low(FOpstellingPlayerArray) to High(FOpstellingPlayerArray) do
begin
if FOpstellingPlayerArray[vCount] <> nil then
begin
if (vCount in [Ord(pRCA), Ord(pCA), Ord(pLCA)]) then
begin
Result := Result + (FOpstellingPlayerArray[vCount].MID_Bijdrage(Self) * OverCrowdingAanval);
end
else if (vCount in [Ord(pRCM), Ord(pCM), Ord(pLCM)]) then
begin
Result := Result + (FOpstellingPlayerArray[vCount].MID_Bijdrage(Self) * OverCrowdingMid);
end
else if (vCount in [Ord(pRCV), Ord(pCV), Ord(pLCV)]) then
begin
Result := Result + (FOpstellingPlayerArray[vCount].MID_Bijdrage(Self) * OverCrowdingDef);
end
else
begin
Result := Result + FOpstellingPlayerArray[vCount].MID_Bijdrage(Self);
end;
end;
end;
Result := Result + (0.008504 * Result * Result);
Result := Result + (-0.000027 * Result * Result * Result);
Result := Result / 4;
Result := VerwerkTeamgeest(Result);
case Selectie.WedstrijdPlaats of
wThuis: Result := Result * 1.199529; //MMM + HO: 1.199529
wDerbyThuis, wDerbyUit: Result := Result * 1.113699; //MMM + HO: 1.113699
wUit: Result := Result * 1;
end;
case Motivatie of
mPIC: Result := Result * 0.839949; //MMM + HO: 0.839949
mMOTS: Result := Result * 1.109650; //MMM + HO: 1.109650
mNormaal: Result := Result * 1;
end;
case Tactiek of
tAfstandsSchoten: Result := Result * 0.950323;
tCounter: Result := Result * 0.930000;
end;
Result := 1 + Result;
end;
end;
function TOpstelling.OverCrowdingAanval: double;
var
vCentraalCount: integer;
begin
vCentraalCount := 0;
if (FOpstellingPlayerArray[Ord(pRCA)] <> nil) then
begin
Inc(vCentraalCount);
end;
if (FOpstellingPlayerArray[Ord(pCA)] <> nil) then
begin
Inc(vCentraalCount);
end;
if (FOpstellingPlayerArray[Ord(pLCA)] <> nil) then
begin
Inc(vCentraalCount);
end;
case vCentraalCount of
2: Result := 0.9480; //0.9480 = HO 0.94 = MMM
3: Result := 0.8190; //0.8190 = HO 0.865 = MMM
else Result := 1;
end;
end;
{-----------------------------------------------------------------------------
Author: Pieter Bas
Datum: 24-04-2012
Doel:
<eventuele fixes>
-----------------------------------------------------------------------------}
function TOpstelling.OverCrowdingDef: double;
var
vCentraalCount: integer;
begin
vCentraalCount := 0;
if (FOpstellingPlayerArray[Ord(pRCV)] <> nil) then
begin
Inc(vCentraalCount);
end;
if (FOpstellingPlayerArray[Ord(pCV)] <> nil) then
begin
Inc(vCentraalCount);
end;
if (FOpstellingPlayerArray[Ord(pLCV)] <> nil) then
begin
Inc(vCentraalCount);
end;
case vCentraalCount of
2: Result := 0.9647; //0.9647 = HO 0.96 = MMM
3: Result := 0.8731; //0.8731 = HO 0.91 = MMM
else Result := 1;
end;
end;
{-----------------------------------------------------------------------------
Author: Pieter Bas
Datum: 24-04-2012
Doel:
<eventuele fixes>
-----------------------------------------------------------------------------}
function TOpstelling.OverCrowdingMid: double;
var
vCentraalCount: integer;
begin
vCentraalCount := 0;
if (FOpstellingPlayerArray[Ord(pRCM)] <> nil) then
begin
Inc(vCentraalCount);
end;
if (FOpstellingPlayerArray[Ord(pCM)] <> nil) then
begin
Inc(vCentraalCount);
end;
if (FOpstellingPlayerArray[Ord(pLCM)] <> nil) then
begin
Inc(vCentraalCount);
end;
case vCentraalCount of
2: Result := 0.9356; //0.9356 = HO 0.92=MMM
3: Result := 0.8268; //0.8268 = HO 0.82=MMM
else Result := 1;
end;
end;
function TOpstelling.RA: double;
var
vCount: integer;
begin
Result := 0;
if (FHandmatigRA > 0) then
begin
Result := FHandmatigRA;
end
else
begin
for vCount := Low(FOpstellingPlayerArray) to High(FOpstellingPlayerArray) do
begin
if FOpstellingPlayerArray[vCount] <> nil then
begin
if (vCount in [Ord(pRCA), Ord(pCA), Ord(pLCA)]) then
begin
Result := Result + (FOpstellingPlayerArray[vCount].AANV_R_Bijdrage(Self) * OverCrowdingAanval);
end
else if (vCount in [Ord(pRCM), Ord(pCM), Ord(pLCM)]) then
begin
Result := Result + (FOpstellingPlayerArray[vCount].AANV_R_Bijdrage(Self) * OverCrowdingMid);
end
else if (vCount in [Ord(pRCV), Ord(pCV), Ord(pLCV)]) then
begin
Result := Result + (FOpstellingPlayerArray[vCount].AANV_R_Bijdrage(Self) * OverCrowdingDef);
end
else
begin
Result := Result + FOpstellingPlayerArray[vCount].AANV_R_Bijdrage(Self);
end;
end;
end;
Result := Result + (0.012093 * Result * Result);
Result := Result + (-0.000027 * Result * Result * Result);
Result := Result / 4;
Result := Result * TeamZelfvertrouwen;
if (Tactiek = tAfstandsSchoten) then
begin
Result := Result * 0.972980;
end;
//PB toegevoegd dikke duim in samenwerking HO
Result := Result * 0.77;
Result := 1 + VerrekenTypeCoach(Result, FALSE);
end;
end;
function TOpstelling.RV: double;
var
vCount: integer;
begin
Result := 0;
if (FHandmatigRV > 0) then
begin
Result := FHandmatigRV;
end
else
begin
for vCount := Low(FOpstellingPlayerArray) to High(FOpstellingPlayerArray) do
begin
if FOpstellingPlayerArray[vCount] <> nil then
begin
if (vCount in [Ord(pRCA), Ord(pCA), Ord(pLCA)]) then
begin
Result := Result + (FOpstellingPlayerArray[vCount].DEF_R_Bijdrage(Self) * OverCrowdingAanval);
end
else if (vCount in [Ord(pRCM), Ord(pCM), Ord(pLCM)]) then
begin
Result := Result + (FOpstellingPlayerArray[vCount].DEF_R_Bijdrage(Self) * OverCrowdingMid);
end
else if (vCount in [Ord(pRCV), Ord(pCV), Ord(pLCV)]) then
begin
Result := Result + (FOpstellingPlayerArray[vCount].DEF_R_Bijdrage(Self) * OverCrowdingDef);
end
else
begin
Result := Result + FOpstellingPlayerArray[vCount].DEF_R_Bijdrage(Self);
end;
end;
end;
Result := Result + (0.011591 * Result * Result);
Result := Result + (-0.000029 * Result * Result * Result);
Result := Result / 4;
case Tactiek of
tCentrumAanval: Result := Result * 0.853911;
tCreatiefSpel: Result := Result * 0.930663;
end;
Result := 1 + VerrekenTypeCoach(Result, TRUE);
end;
end;
procedure TOpstelling.SetAanvoerder(const Value: TPlayer);
begin
if (FAanvoerder <> Value) then
begin
FAanvoerder := Value;
if (FFrameOpstelling <> nil) then
begin
(FFrameOpstelling as TfrmOpstelling).UpdateAanvoerder;
end;
end;
end;
{-----------------------------------------------------------------------------
Author: Pieter Bas
Datum: 18-04-2012
Doel:
<eventuele fixes>
-----------------------------------------------------------------------------}
procedure TOpstelling.SetCoach(const Value: TOpstellingCoach);
begin
if (FCoach <> Value) then
begin
FCoach := Value;
UpdateRatings;
end;
end;
procedure TOpstelling.SetHandmatigCA(const Value: double);
begin
FHandmatigCA := Value;
end;
procedure TOpstelling.SetHandmatigCV(const Value: double);
begin
FHandmatigCV := Value;
end;
procedure TOpstelling.SetHandmatigLA(const Value: double);
begin
FHandmatigLA := Value;
end;
procedure TOpstelling.SetHandmatigLV(const Value: double);
begin
FHandmatigLV := Value;
end;
procedure TOpstelling.SetHandmatigMID(const Value: double);
begin
FHandmatigMID := Value;
end;
procedure TOpstelling.SetHandmatigRA(const Value: double);
begin
FHandmatigRA := Value;
end;
procedure TOpstelling.SetHandmatigRV(const Value: double);
begin
FHandmatigRV := Value;
end;
procedure TOpstelling.SetMotivatie(const Value: TOpstellingMotivatie);
begin
if (FMotivatie <> Value) then
begin
FMotivatie := Value;
UpdateRatings;
end;
end;
procedure TOpstelling.SetSelectie(const Value: TSelectie);
begin
FSelectie := Value;
end;
{-----------------------------------------------------------------------------
Author: Pieter Bas
Datum: 17-04-2012
Doel:
<eventuele fixes>
-----------------------------------------------------------------------------}
procedure TOpstelling.SetSpelhervatter(const Value: TPlayer);
begin
if (FSpelhervatter <> Value) then
begin
FSpelhervatter := Value;
if (FFrameOpstelling <> nil) then
begin
(FFrameOpstelling as TfrmOpstelling).UpdateSpelhervatter;
end;
end;
end;
{-----------------------------------------------------------------------------
Author: Pieter Bas
Datum: 18-04-2012
Doel:
<eventuele fixes>
-----------------------------------------------------------------------------}
procedure TOpstelling.SetTactiek(const Value: TOpstellingTactiek);
begin
if (FTactiek <> Value) then
begin
FTactiek := Value;
FTacticLevel := 0;
UpdateRatings;
end;
end;
function TOpstelling.TeamZelfvertrouwen: double;
begin
Result := 1 + (Selectie.Zelfvertrouwen * 0.0525);
end;
procedure TOpstelling.UpdateRatings;
begin
if (FFrameOpstelling <> nil) then
begin
TfrmOpstelling(FFrameOpstelling).UpdateRatings;
end;
end;
{-----------------------------------------------------------------------------
Author: Pieter Bas
Datum: 19-04-2012
Doel:
<eventuele fixes>
-----------------------------------------------------------------------------}
function TOpstelling.VerrekenTypeCoach(aRating: double; aVerdediging: boolean): double;
begin
Result := aRating;
if aVerdediging then
begin
case Coach of
//cVerdedigend: Result := aRating * ((2 * 1.197332) + 1.196307) / 3; //MMM: 1,196990333
cVerdedigend: Result := aRating * 1.196307; //HO
cNeutraal: Result := aRating * 1.05;
//cAanvallend: Result := aRating * 0.94; //MMM
cAanvallend: Result := aRating * 0.928162; //HO
end;
end
else
begin
case Coach of
//cVerdedigend: Result := aRating * 0.928; //MMM: 0.928
cVerdedigend: Result := aRating * 0.927930; //HO
cNeutraal: Result := aRating * 1.05;
//cAanvallend: Result := aRating * ((2 * 1.133359) + 1.135257) / 3; //MMM: 1,133991667
cAanvallend: Result := aRating * 1.135257
end;
end;
end;
function TOpstelling.VerwerkTeamgeest(aRating: double): double;
begin
//Result := aRating * Power((Selectie.Teamgeest - 0.5) * 0.2, 0.417779); //MMM
//Result := aRating * Power((Selectie.Teamgeest - 0.5) * 0.147832, 0.417779); //HO
Result := aRating * Power((Selectie.Teamgeest - 0.5) * 0.147832, 0.417779);
end;
procedure TOpstelling.ZetPlayerIDOpPositie(aPlayerID: integer; aPositie: TPlayerPosition; aPlayerOrder: TPlayerOrder);
var
vPlayer,
vOldPlayer: TPlayer;
vRating: TRatingBijdrage;
vPos: String;
begin
FTacticLevel := 0;
vPlayer := Selectie.GetPlayer(aPlayerID);
vOldPlayer := FOpstellingPlayerArray[Ord(aPositie)];
FOpstellingPlayerArray[Ord(aPositie)] := vPlayer;
FOpstellingOrderArray[Ord(aPositie)] := aPlayerOrder;
if (vOldPlayer <> nil) and
(vOldPlayer <> vPlayer) then
begin
if (vOldPlayer = FSpelhervatter) then
begin
Spelhervatter := nil;
end;
if (vOldPlayer = FAanvoerder) then
begin
Aanvoerder := nil;
end;
vOldPlayer.ClearBijdrages(Self);
end;
if (FFrameOpstelling <> nil) then
begin
(FFrameOpstelling as TfrmOpstelling).EnableDisableOpstellingPlayer;
end;
if (vPlayer <> nil) then
begin
vPos := uHTPredictor.PlayerPosToRatingPos(aPositie, aPlayerOrder, vPlayer.Spec);
vRating := Selectie.RatingBijdrages.GetRatingBijdrageByPositie(vPos);
if (vRating <> nil) then
begin
vPlayer.CalculateRatings(Self, vRating, aPositie, aPlayerOrder);
end;
end;
UpdateRatings;
end;
end.
|
program Sample;
var i,j: Integer;
begin
WriteLn('enter two numbers:');
Read(i,j);
WriteLn('got ', i, ' and ', j);
end.
|
{********************************************}
{ TeeOpenGL Editor Component }
{ Copyright (c) 1999-2004 by David Berneda }
{ All Rights Reserved }
{********************************************}
unit TeeGLEditor;
{$I TeeDefs.inc}
interface
uses
{$IFNDEF LINUX}
Windows, Messages,
{$ENDIF}
SysUtils, Classes,
{$IFDEF CLX}
QGraphics, QControls, QForms, QDialogs, QComCtrls, QExtCtrls, QStdCtrls,
{$ELSE}
Graphics, Controls, Forms, Dialogs, ComCtrls, ExtCtrls, StdCtrls,
{$ENDIF}
TeeOpenGL, TeCanvas, TeeProcs, TeePenDlg;
type
TTeeOpenGLBackup=packed record
Active : Boolean;
AmbientLight : Integer;
FontOutlines : Boolean;
LightColor : TColor;
LightVisible : Boolean;
LightX : Double;
LightY : Double;
LightZ : Double;
ShadeQuality : Boolean;
Shininess : Double;
FontExtrusion : Integer;
DrawStyle : TTeeCanvasSurfaceStyle;
end;
TFormTeeGLEditor = class(TForm)
CBActive: TCheckBox;
BOK: TButton;
BCancel: TButton;
TabControl1: TTabControl;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
CBVisible: TCheckBox;
TBX: TTrackBar;
TBY: TTrackBar;
TBZ: TTrackBar;
TrackBar5: TTrackBar;
BLightColor: TButtonColor;
GroupBox1: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Label8: TLabel;
CBOutlines: TCheckBox;
CBShade: TCheckBox;
TBAmbient: TTrackBar;
TBShine: TTrackBar;
UDDepth: TUpDown;
Edit1: TEdit;
Label3: TLabel;
CBStyle: TComboFlat;
CBFixed: TCheckBox;
procedure BOKClick(Sender: TObject);
procedure CBShadeClick(Sender: TObject);
procedure CBOutlinesClick(Sender: TObject);
procedure Edit1Change(Sender: TObject);
procedure TBShineChange(Sender: TObject);
procedure TBAmbientChange(Sender: TObject);
procedure CBActiveClick(Sender: TObject);
procedure CBVisibleClick(Sender: TObject);
procedure TrackBar5Change(Sender: TObject);
procedure TBXChange(Sender: TObject);
procedure TBYChange(Sender: TObject);
procedure TBZChange(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure BCancelClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure TabControl1Change(Sender: TObject);
procedure CBStyleChange(Sender: TObject);
procedure CBFixedClick(Sender: TObject);
procedure BLightColorClick(Sender: TObject);
private
{ Private declarations }
CreatingForm : Boolean;
GL : TTeeOpenGL;
GLBackup : TTeeOpenGLBackup;
Procedure SetLight(ALight:TGLLightSource);
function TheLight:TGLLightSource;
public
{ Public declarations }
end;
Function EditTeeOpenGL(AOwner:TComponent; ATeeOpenGL:TTeeOpenGL):Boolean;
implementation
{$IFNDEF CLX}
{$R *.DFM}
{$ELSE}
{$R *.xfm}
{$ENDIF}
Uses
TeeGLCanvas,
{$IFDEF CLR}
Variants,
{$ENDIF}
TeeEditCha;
Function EditTeeOpenGL(AOwner:TComponent; ATeeOpenGL:TTeeOpenGL):Boolean;
begin
With TFormTeeGLEditor.Create(AOwner) do
try
Tag:={$IFDEF CLR}Variant{$ELSE}Integer{$ENDIF}(ATeeOpenGL);
result:=ShowModal=mrOk;
finally
Free;
end
end;
procedure TFormTeeGLEditor.BOKClick(Sender: TObject);
begin
ModalResult:=mrOk;
end;
procedure TFormTeeGLEditor.CBShadeClick(Sender: TObject);
begin
if not CreatingForm then GL.ShadeQuality:=CBShade.Checked;
end;
procedure TFormTeeGLEditor.CBOutlinesClick(Sender: TObject);
begin
if not CreatingForm then GL.FontOutlines:=CBOutlines.Checked;
end;
procedure TFormTeeGLEditor.Edit1Change(Sender: TObject);
begin
if not CreatingForm then GL.FontExtrusion:=UDDepth.Position;
end;
procedure TFormTeeGLEditor.TBShineChange(Sender: TObject);
begin
if not CreatingForm then GL.Shininess:=TBShine.Position*0.01;
end;
procedure TFormTeeGLEditor.TBAmbientChange(Sender: TObject);
begin
if not CreatingForm then GL.AmbientLight:=TBAmbient.Position;
end;
procedure TFormTeeGLEditor.CBActiveClick(Sender: TObject);
begin
if not CreatingForm then GL.Active:=CBActive.Checked;
end;
function TFormTeeGLEditor.TheLight:TGLLightSource;
begin
if TabControl1.TabIndex=0 then result:=GL.Light0
else
if TabControl1.TabIndex=1 then result:=GL.Light1
else
result:=GL.Light2;
end;
procedure TFormTeeGLEditor.CBVisibleClick(Sender: TObject);
begin
if not CreatingForm then TheLight.Visible:=CBVisible.Checked;
end;
procedure TFormTeeGLEditor.TrackBar5Change(Sender: TObject);
begin
if not CreatingForm then
With TheLight,TrackBar5 do
begin
Color:=RGB(Position,Position,Position);
BLightColor.Repaint;
end;
end;
procedure TFormTeeGLEditor.TBXChange(Sender: TObject);
begin
if not CreatingForm then TheLight.Position.X:=TBX.Position;
end;
procedure TFormTeeGLEditor.TBYChange(Sender: TObject);
begin
if not CreatingForm then TheLight.Position.Y:=TBY.Position;
end;
procedure TFormTeeGLEditor.TBZChange(Sender: TObject);
begin
if not CreatingForm then TheLight.Position.Z:=TBZ.Position;
end;
procedure TFormTeeGLEditor.FormShow(Sender: TObject);
begin
GL:=TTeeOpenGL(Tag);
if Assigned(GL) then
With GL do
begin
CBShade.Checked:=ShadeQuality;
CBOutlines.Checked:=FontOutlines;
CBStyle.ItemIndex:=Ord(DrawStyle);
UDDepth.Position:=FontExtrusion;
TBShine.Position:=Round(Shininess*100.0);
TBAmbient.Position:=AmbientLight;
CBActive.Checked:=Active;
SetLight(Light0);
GLBackup.ShadeQuality:=ShadeQuality;
GLBackup.FontOutlines:=FontOutlines;
GLBackup.DrawStyle:=DrawStyle;
GLBackup.FontExtrusion:=FontExtrusion;
GLBackup.Shininess:=Shininess;
GLBackup.AmbientLight:=AmbientLight;
GLBackup.Active:=Active;
end;
CreatingForm:=False;
end;
Procedure TFormTeeGLEditor.SetLight(ALight:TGLLightSource);
begin
CBVisible.Checked:=ALight.Visible;
CBFixed.Checked:=ALight.FixedPosition;
TrackBar5.Position:=GetRValue(ALight.Color);
with ALight.Position do
begin
TBX.Position:=Round(X);
TBY.Position:=Round(Y);
TBZ.Position:=Round(Z);
end;
BLightColor.LinkProperty(ALight,'Color');
GLBackup.LightVisible:=ALight.Visible;
GLBackup.LightColor:=ALight.Color;
with ALight.Position do
begin
GLBackup.LightX:=X;
GLBackup.LightY:=Y;
GLBackup.LightZ:=Z;
end;
end;
procedure TFormTeeGLEditor.BCancelClick(Sender: TObject);
begin
With GL do
begin
ShadeQuality:=GLBackup.ShadeQuality;
FontOutlines:=GLBackup.FontOutlines;
DrawStyle:=GLBackup.DrawStyle;
FontExtrusion:=GLBackup.FontExtrusion;
Shininess :=GLBackup.Shininess;
AmbientLight :=GLBackup.AmbientLight;
Active :=GLBackup.Active;
With TheLight do
begin
Visible:=GLBackup.LightVisible;
Color :=GLBackup.LightColor;
with Position do
begin
X:=GLBackup.LightX;
Y:=GLBackup.LightY;
Z:=GLBackup.LightZ;
end;
end;
end;
ModalResult:=mrCancel;
end;
procedure TFormTeeGLEditor.FormCreate(Sender: TObject);
begin
CreatingForm:=True;
BorderStyle:=TeeBorderStyle;
TabControl1.Tabs.Clear;
TabControl1.Tabs.Add('Light 0'); // <--- do not translate
TabControl1.Tabs.Add('Light 1'); // <--- do not translate
TabControl1.Tabs.Add('Light 2'); // <--- do not translate
TeeTranslateControl(Self);
end;
type TTeePanelAccess=class(TCustomTeePanel);
Procedure TeeOpenGLShowEditor(Editor:TChartEditForm; Tab:TTabSheet);
const TeeMsg_OpenGL='OpenGL';
var tmpForm : TFormTeeGLEditor;
tmpGL : TComponent;
begin
if Assigned(Editor) and Assigned(Editor.Chart) then
begin
tmpGL:=TTeePanelAccess(Editor.Chart).GLComponent;
if Assigned(tmpGL)
{$IFDEF TEEOCX}
and
( (not (cetOpenGL in Editor.TheHiddenTabs)) or { 5.02 }
( (cetOpenGL in Editor.TheHiddenTabs) and TTeeOpenGL(tmpGL).Active )
)
{$ENDIF}
then
begin
if not Assigned(Tab) then
begin
Tab:=TTabSheet.Create(Editor);
Tab.Caption:=TeeMsg_OpenGL;
Tab.PageControl:=Editor.MainPage;
end
else
if (Tab.ControlCount=0) and (Tab.Caption=TeeMsg_OpenGL) then
begin
tmpForm:=TFormTeeGLEditor.Create(Editor);
ShowControls(False,[tmpForm.BOk,tmpForm.BCancel]);
tmpForm.CBActive.Checked:=TTeeOpenGL(tmpGL).Active; { 5.02 }
{$IFDEF TEEOCX}
if (cetOpenGL in Editor.TheHiddenTabs) and TTeeOpenGL(tmpGL).Active then
tmpForm.CBActive.Visible:=False;
{$ENDIF}
AddFormTo(tmpForm,Tab,{$IFDEF CLR}Variant{$ELSE}Integer{$ENDIF}(TTeeOpenGL(tmpGL)));
end;
end;
end;
end;
procedure TFormTeeGLEditor.TabControl1Change(Sender: TObject);
begin
SetLight(TheLight);
end;
procedure TFormTeeGLEditor.CBStyleChange(Sender: TObject);
begin
if not CreatingForm then
GL.DrawStyle:=TTeeCanvasSurfaceStyle(CBStyle.ItemIndex);
end;
procedure TFormTeeGLEditor.CBFixedClick(Sender: TObject);
begin
if not CreatingForm then
TheLight.FixedPosition:=CBFixed.Checked;
end;
procedure TFormTeeGLEditor.BLightColorClick(Sender: TObject);
begin
TrackBar5.Position:=GetRValue(TheLight.Color);
end;
{$IFNDEF CLR}
initialization
TeeOnShowEditor.Add(@TeeOpenGLShowEditor);
finalization
TeeOnShowEditor.Remove(@TeeOpenGLShowEditor);
{$ENDIF}
end.
|
unit Component.UAWebbrowser;
interface
uses Classes, SHDocVw, ActiveX;
type
TUAWebBrowser = class(TWebbrowser, IDispatch)
private
const
DISPID_AMBIENT_USERAGENT = -5513;
private
FUserAgent: string;
BrowserAmbient: IOleControl;
function QueryBrowserAmbientAndIfAvailableSetIt: Boolean;
procedure SetUserAgent(const UserAgentToSet: string);
function Invoke(DispID: Integer; const IID: TGUID; LocaleID: Integer;
Flags: Word; var Params;
VarResult, ExcepInfo, ArgErr: Pointer): HRESULT; stdcall;
public
property UserAgent: string read FUserAgent write SetUserAgent;
constructor Create(AOwner: TComponent); override;
end;
implementation
constructor TUAWebBrowser.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
UserAgent := '';
SetUserAgent('Naraeon SSD Tools');
end;
function TUAWebBrowser.Invoke(DispID: Integer; const IID: TGUID; //FI:C102
LocaleID: Integer; Flags: Word; var Params;
VarResult, ExcepInfo, ArgErr: Pointer): HRESULT;
begin
if (UserAgent <> '') and
(Flags and DISPATCH_PROPERTYGET <> 0) and
(DispId = DISPID_AMBIENT_USERAGENT) and
(Assigned(VarResult)) then
begin
POleVariant(VarResult)^ := UserAgent + #13#10;
exit(S_OK);
end;
result :=
inherited Invoke(DispID, IID, LocaleID, Flags, Params,
VarResult, ExcepInfo, ArgErr);
end;
function TUAWebBrowser.QueryBrowserAmbientAndIfAvailableSetIt: Boolean;
begin
result := DefaultInterface.QueryInterface(IOleControl, BrowserAmbient) = 0;
end;
procedure TUAWebBrowser.SetUserAgent(const UserAgentToSet: string);
begin
FUserAgent := UserAgentToSet;
if QueryBrowserAmbientAndIfAvailableSetIt then
BrowserAmbient.OnAmbientPropertyChange(DISPID_AMBIENT_USERAGENT);
end;
end.
|
unit MyGlobal;
interface
uses
Classes, SysUtils, IOUtils, JdcGlobal, MyCommon;
const
PROJECT_CODE = 'MyProject';
APPLICATION_CODE = 'playIoT Application';
APPLICATION_TITLE = 'playIoT Form Application Templete';
COPY_RIGHT_SIGN = '¨Ï 2018 playIoT';
HOME_PAGE_URL = 'http://www.playIoT.biz';
type
TGlobal = class(TGlobalAbstract)
strict protected
procedure SetExeName(const Value: String); override;
procedure SetUseDebug(const Value: boolean); override;
public
constructor Create; override;
destructor Destroy; override;
class function Obj: TGlobal;
procedure ApplicationMessage(const AType: TMessageType; const ATitle: String;
const AMessage: String = ''); override;
procedure Initialize; override;
procedure Finalize; override;
end;
implementation
uses MyOption, JdcView, JdcGlobal.ClassHelper;
var
MyObj: TGlobal = nil;
{ TGlobal }
procedure TGlobal.ApplicationMessage(const AType: TMessageType; const ATitle: String;
const AMessage: String);
begin
inherited;
case AType of
msDebug:
_ApplicationMessage(MESSAGE_TYPE_DEBUG, ATitle, AMessage, [moCloudMessage]);
msError:
TView.Obj.sp_ErrorMessage(ATitle, AMessage);
msInfo:
TView.Obj.sp_LogMessage(ATitle, AMessage);
end;
end;
constructor TGlobal.Create;
begin
inherited;
// TOTO : after create
end;
destructor TGlobal.Destroy;
begin
// TOTO : before Finalize
inherited;
end;
procedure TGlobal.Finalize;
begin
if FIsfinalized then
Exit;
// Todo :
ApplicationMessage(msDebug, 'Stop', 'StartTime=' + FStartTime.ToString);
FIsfinalized := true;
end;
procedure TGlobal.Initialize;
begin
if FIsfinalized then
Exit;
if FIsInitialized then
Exit;
FIsInitialized := true;
FStartTime := now;
{$IFDEF WIN32}
ApplicationMessage(msDebug, 'Start', '(x86)' + FExeName);
{$ENDIF}
{$IFDEF WIN64}
ApplicationMessage(mtDebug, 'Start', '(x64)' + FxeName);
{$ENDIF}
FUseDebug := TOption.Obj.UseDebug;
end;
class function TGlobal.Obj: TGlobal;
begin
if MyObj = nil then
MyObj := TGlobal.Create;
result := MyObj;
end;
procedure TGlobal.SetExeName(const Value: String);
begin
FExeName := Value;
FLogName := ChangeFileExt(FExeName, '.log');
FLogName := GetEnvironmentVariable('LOCALAPPDATA') + '\playIoT\' + APPLICATION_CODE + '\' +
ExtractFileName(FLogName);
if not TDirectory.Exists(ExtractFilePath(FLogName)) then
TDirectory.CreateDirectory(ExtractFilePath(FLogName));
FAppCode := TOption.Obj.AppCode;
FProjectCode := TOption.Obj.ProjectCode;
FUseCloudLog := TOption.Obj.UseCloudLog;
FLogServer := TOption.Obj.LogServer;
end;
procedure TGlobal.SetUseDebug(const Value: boolean);
begin
inherited;
TOption.Obj.UseDebug := Value;
end;
initialization
MyObj := TGlobal.Create;
end.
|
unit Ths.Erp.Database.Table.SysQualityFormNumber;
interface
{$I ThsERP.inc}
uses
SysUtils, Classes, Dialogs, Forms, Windows, Controls, Types, DateUtils,
FireDAC.Stan.Param, System.Variants, Data.DB,
Ths.Erp.Database,
Ths.Erp.Database.Table;
type
TSysQualityFormNumber = class(TTable)
private
FTableName1: TFieldDB;
FFormNo: TFieldDB;
FIsInputForm: TFieldDB;
protected
published
constructor Create(OwnerDatabase:TDatabase);override;
public
procedure SelectToDatasource(pFilter: string; pPermissionControl: Boolean=True); override;
procedure SelectToList(pFilter: string; pLock: Boolean; pPermissionControl: Boolean=True); override;
procedure Insert(out pID: Integer; pPermissionControl: Boolean=True); override;
procedure Update(pPermissionControl: Boolean=True); override;
function Clone():TTable;override;
Property TableName1: TFieldDB read FTableName1 write FTableName1;
Property FormNo: TFieldDB read FFormNo write FFormNo;
Property IsInputForm: TFieldDB read FIsInputForm write FIsInputForm;
end;
implementation
uses
Ths.Erp.Constants,
Ths.Erp.Database.Singleton;
constructor TSysQualityFormNumber.Create(OwnerDatabase:TDatabase);
begin
inherited Create(OwnerDatabase);
TableName := 'sys_quality_form_number';
SourceCode := '1';
FTableName1 := TFieldDB.Create('table_name', ftString, '');
FFormNo := TFieldDB.Create('form_no', ftString, '');
FIsInputForm := TFieldDB.Create('is_input_form', ftBoolean, False);
end;
procedure TSysQualityFormNumber.SelectToDatasource(pFilter: string; pPermissionControl: Boolean=True);
begin
if IsAuthorized(ptRead, pPermissionControl) then
begin
with QueryOfDS do
begin
Close;
SQL.Clear;
SQL.Text := Database.GetSQLSelectCmd(TableName, [
TableName + '.' + Self.Id.FieldName,
TableName + '.' + FTableName1.FieldName,
TableName + '.' + FFormNo.FieldName,
TableName + '.' + FIsInputForm.FieldName
]) +
'WHERE 1=1 ' + pFilter;
Open;
Active := True;
Self.DataSource.DataSet.FindField(Self.Id.FieldName).DisplayLabel := 'ID';
Self.DataSource.DataSet.FindField(FTableName1.FieldName).DisplayLabel := 'TABLE NAME';
Self.DataSource.DataSet.FindField(FFormNo.FieldName).DisplayLabel := 'FORM NO';
Self.DataSource.DataSet.FindField(FIsInputForm.FieldName).DisplayLabel := 'INPUT?';
end;
end;
end;
procedure TSysQualityFormNumber.SelectToList(pFilter: string; pLock: Boolean; pPermissionControl: Boolean=True);
begin
if IsAuthorized(ptRead, pPermissionControl) then
begin
if (pLock) then
pFilter := pFilter + ' FOR UPDATE OF ' + TableName + ' NOWAIT';
with QueryOfList do
begin
Close;
SQL.Text := Database.GetSQLSelectCmd(TableName, [
TableName + '.' + Self.Id.FieldName,
TableName + '.' + FTableName1.FieldName,
TableName + '.' + FFormNo.FieldName,
TableName + '.' + FIsInputForm.FieldName
]) +
'WHERE 1=1 ' + pFilter;
Open;
FreeListContent();
List.Clear;
while NOT EOF do
begin
Self.Id.Value := FormatedVariantVal(FieldByName(Self.Id.FieldName).DataType, FieldByName(Self.Id.FieldName).Value);
FTableName1.Value := FormatedVariantVal(FieldByName(FTableName1.FieldName).DataType, FieldByName(FTableName1.FieldName).Value);
FFormNo.Value := FormatedVariantVal(FieldByName(FFormNo.FieldName).DataType, FieldByName(FFormNo.FieldName).Value);
FIsInputForm.Value := FormatedVariantVal(FieldByName(FIsInputForm.FieldName).DataType, FieldByName(FIsInputForm.FieldName).Value);
List.Add(Self.Clone());
Next;
end;
Close;
end;
end;
end;
procedure TSysQualityFormNumber.Insert(out pID: Integer; pPermissionControl: Boolean=True);
begin
if IsAuthorized(ptAddRecord, pPermissionControl) then
begin
with QueryOfInsert do
begin
Close;
SQL.Clear;
SQL.Text := Database.GetSQLInsertCmd(TableName, QUERY_PARAM_CHAR, [
FTableName1.FieldName,
FFormNo.FieldName,
FIsInputForm.FieldName
]);
NewParamForQuery(QueryOfInsert, FTableName1);
NewParamForQuery(QueryOfInsert, FFormNo);
NewParamForQuery(QueryOfInsert, FIsInputForm);
Open;
if (Fields.Count > 0) and (not Fields.FieldByName(Self.Id.FieldName).IsNull) then
pID := Fields.FieldByName(Self.Id.FieldName).AsInteger
else
pID := 0;
EmptyDataSet;
Close;
end;
Self.notify;
end;
end;
procedure TSysQualityFormNumber.Update(pPermissionControl: Boolean=True);
begin
if IsAuthorized(ptUpdate, pPermissionControl) then
begin
with QueryOfUpdate do
begin
Close;
SQL.Clear;
SQL.Text := Database.GetSQLUpdateCmd(TableName, QUERY_PARAM_CHAR, [
FTableName1.FieldName,
FFormNo.FieldName,
FIsInputForm.FieldName
]);
NewParamForQuery(QueryOfUpdate, FTableName1);
NewParamForQuery(QueryOfUpdate, FFormNo);
NewParamForQuery(QueryOfInsert, FIsInputForm);
NewParamForQuery(QueryOfUpdate, Id);
ExecSQL;
Close;
end;
Self.notify;
end;
end;
function TSysQualityFormNumber.Clone():TTable;
begin
Result := TSysQualityFormNumber.Create(Database);
Self.Id.Clone(TSysQualityFormNumber(Result).Id);
FTableName1.Clone(TSysQualityFormNumber(Result).FTableName1);
FFormNo.Clone(TSysQualityFormNumber(Result).FFormNo);
FIsInputForm.Clone(TSysQualityFormNumber(Result).FIsInputForm);
end;
end.
|
////////////////////////////////////////////////////////////////////////////////
//
// ****************************************************************************
// * Project : FWZip
// * Unit Name : FWZipCrc32
// * Purpose : Набор функций для рассчета контрольной суммы блока данных
// * : Класс TFWZipCRC32Stream используется в качестве посредника
// * : между двумя стримами и предназначен для бастрого
// * : рассчета контрольной суммы передаваемых блоков данных
// * Author : Александр (Rouse_) Багель
// * Copyright : © Fangorn Wizards Lab 1998 - 2023.
// * Version : 2.0.0
// * Home Page : http://rouse.drkb.ru
// * Home Blog : http://alexander-bagel.blogspot.ru
// ****************************************************************************
// * Stable Release : http://rouse.drkb.ru/components.php#fwzip
// * Latest Source : https://github.com/AlexanderBagel/FWZip
// ****************************************************************************
//
// Используемые источники:
// ftp://ftp.info-zip.org/pub/infozip/doc/appnote-iz-latest.zip
// https://zlib.net/zlib-1.2.13.tar.gz
// http://www.base2ti.com/
//
unit FWZipCrc32;
{$IFDEF FPC}
{$MODE Delphi}
{$H+}
{$ENDIF}
interface
uses
Classes,
SysUtils,
FWZipConsts;
type
TFWZipCRC32Stream = class(TStream)
private
FOwner: TStream;
FCRC32: Cardinal;
protected
function GetSize: Int64; override;
public
constructor Create(AOwner: TStream);
function Seek(Offset: Longint; Origin: Word): Longint; overload; override;
function Seek(const Offset: Int64; Origin: TSeekOrigin): Int64; overload; override;
function Read(var Buffer; Count: Longint): Longint; override;
function Write(const Buffer; Count: Longint): Longint; override;
function CRC32: Cardinal;
end;
function CRC32Calc(CurrCRC: Cardinal;
Buffer: PByte; const BufferLen: Int64): Cardinal; overload;
function CRC32Calc(Buffer: PByte; const BufferLen: Int64): Cardinal; overload;
function FileCRC32(const FileName: string): Cardinal;
implementation
function CRC32Calc(CurrCRC: Cardinal;
Buffer: PByte; const BufferLen: Int64): Cardinal;
var
I: Integer;
begin
Result := CurrCRC;
for I := 0 to BufferLen - 1 do
begin
Result := ((Result shr 8) and $00FFFFFF) xor
CRC32Table[(Result xor Buffer^) and $FF];
Inc(Buffer);
end;
end;
function CRC32Calc(Buffer: PByte; const BufferLen: Int64): Cardinal;
begin
Result := CRC32Calc($FFFFFFFF, Buffer, BufferLen) xor $FFFFFFFF;
end;
function FileCRC32(const FileName: string): Cardinal;
var
Buff: Pointer;
F: TFileStream;
Size: Integer;
begin
Result := $FFFFFFFF;
GetMem(Buff, $FFFF);
try
F := TFileStream.Create(FileName, fmOpenRead);
try
Size := 1;
while Size > 0 do
begin
Size := F.Read(Buff^, $FFFF);
Result := CRC32Calc(Result, Buff, Size);
end;
finally
F.Free;
end;
finally
FreeMem(Buff);
end;
Result := Result xor $FFFFFFFF;
end;
{ TFWZipCRC32Stream }
function TFWZipCRC32Stream.CRC32: Cardinal;
begin
Result := FCRC32 xor $FFFFFFFF;
end;
constructor TFWZipCRC32Stream.Create(AOwner: TStream);
begin
FOwner := AOwner;
FCRC32 := $FFFFFFFF;
end;
function TFWZipCRC32Stream.GetSize: Int64;
begin
Result := FOwner.Size;
end;
function TFWZipCRC32Stream.Read(var Buffer; Count: Integer): Longint;
begin
Result := FOwner.Read(Buffer, Count);
FCRC32 := CRC32Calc(FCRC32, @Buffer, Result);
end;
function TFWZipCRC32Stream.Seek(Offset: Integer; Origin: Word): Longint;
begin
Result := FOwner.Seek(Offset, Origin);
end;
function TFWZipCRC32Stream.Seek(const Offset: Int64;
Origin: TSeekOrigin): Int64;
begin
Result := FOwner.Seek(Offset, Origin);
end;
function TFWZipCRC32Stream.Write(const Buffer; Count: Integer): Longint;
begin
Result := FOwner.Write(Buffer, Count);
FCRC32 := CRC32Calc(FCRC32, @Buffer, Result);
end;
end.
|
unit UExweb;
interface
uses
SysUtils, Windows, Messages, Classes, Graphics, Controls, Forms, Dialogs,
UUrl,UHash,UHttp,UExWebType, DB, DBClient;
{$define _log_}
type
TExWebBlockInfo = record
public
blockSize: Integer;
count: Integer;
id: string;
md5: string;
size: Int64;
end;
TExWeb = class(TObject)
private
fApp: TApplication;
fBlockLen: Integer;
fBlockSize: Integer;
fDelay_Block_Send: Integer;
fHttp: THttp;
fKey: string;
fMaxDataSetFieldLen: Integer;
procedure addKey(Params: THash);
procedure ExceptionOtvet(var res:TExWebResult;otvet: THash;
event:string; msg: string='');
function getEnableLog: Boolean;
function getLogFileName: string;
function getScript: string;
function httpResultToExWebResult(aHttpResult: THttpResult):
TExWebResult;
procedure processMessages;
function read(Params: THash; aData: TStream): TExWebResult;
procedure setEnableLog(Value: Boolean);
procedure setLogFileName(const Value: string);
procedure setScript(const Value: string);
function _recvBlock(data: TStream;id:string;count:integer):
TExWebResult;
function _send(str:string; id: string): TExWebResult; overload;
function _send(data: TStream; id: string): TExWebResult; overload;
function _sendBlock(info: TExWebBlockInfo; data: TStream): TExWebResult;
property BlockLen: Integer read fBlockLen write fBlockLen;
property BlockSize: Integer read fBlockSize write fBlockSize;
property Delay_Block_Send: Integer read fDelay_Block_Send write fDelay_Block_Send;
public
constructor Create(aScript: string);
destructor Destroy; override;
function get(NameValueParams: array of variant; Response: THash):
TExWebResult; overload;
function get(Params, Response: THash): TExWebResult; overload;
function post(Params:array of variant; data: TStream; Response: THash):
TExWebResult; overload;
function post(Params: THash; data: TStream; Response: THash):
TExWebResult; overload;
{:
Возвращает список outDS:TStringList. Список - упорядоченная структура и
данные.
1-я Строка - Кол-во полей (len)
2-я Строка - Длина первого поля
3-я Строка - Имя первого поля
4-я Строка - Длина второго поля
5-я Строка - Имя второго поля
... и так len*2 строк
len*2+1 строка - значение 1-го поля в 1-й строке данных
len*2+2 строка - значение 2-го поля в 1-й строке данных
len*2+3 строка - значение 3-го поля в 1-й строке данных
...
}
function query(const sql, base: string; outDS: TStrings = nil; const
coding: string = ''): Boolean; overload;
{:
К сожалению данная ф-ция выдвет Exception заверешении работы
exweb_import. (при работе через dll). Переполнение идет если
вызывается метод ClientDataSet.FieldDefs :)
Поэтому саму ф-цию query заменяю, и часть логики переношу в
exweb_import. см query(..)
Оставляю как пример ошибки :(
}
function query1(const sql, base: string; outDS: TClientDataSet; const
coding: string = ''): Boolean; overload;
//1 чтение данных
function recv(var str: string; data: TStream; prevState: TExWebState):
TExWebState;
//1 отправка сообщения
function send(const str: string; data: TStream; prevState:
TExWebState): TExWebState;
property App: TApplication read fApp write fApp;
property EnableLog: Boolean read getEnableLog write setEnableLog;
property Http: THttp read fHttp write fHttp;
//1 Ключ доступа к передачи
property Key: string read fKey write fKey;
property LogFileName: string read getLogFileName write setLogFileName;
//1 Максимальная длина загружаемого поля (остаток обрезается) условие включается при значении >0
property MaxDataSetFieldLen: Integer read fMaxDataSetFieldLen write
fMaxDataSetFieldLen;
property Script: string read getScript write setScript;
end;
function TExWebStateToStr(aState:TExWebState):string;
implementation
uses
{$ifdef _log_}ULogMsg, {$endif} umd5, UUtils;
function TExWebStateToStr(aState:TExWebState):string;
begin
result:='result:';
if (aState.result) then
result:=result+'true'
else
result:=result+'false';
result:=result+', ';
result:=result+'id:'+aState.id+', ';
result:=result+'webResult:'+TExWebResultStr[integer(aState.webResult)];
result:='{'+result+'}';
end;
{
************************************ TExWeb ************************************
}
constructor TExWeb.Create(aScript: string);
begin
inherited Create;
fApp:=nil;
if (Application<>nil) then begin
fApp:=Application;
//error_log('app NOT nil %s',[Application.ExeName]);
end else
error_log('app = nil');
fHttp:=THttp.Create();
Script:=aScript;
BlockSize:=1024;
BlockLen:=1024;
Delay_Block_Send:=0;
fMaxDataSetFieldLen:=256;
Key:='jqwed67dec';
end;
destructor TExWeb.Destroy;
begin
fHttp.Free();
inherited Destroy;
end;
procedure TExWeb.addKey(Params: THash);
begin
Params['key']:=Key;
end;
procedure TExWeb.ExceptionOtvet(var res:TExWebResult;otvet: THash; event:string;
msg: string='');
begin
if res<>ewrOk then
raise Exception.Create('event='+event);
if (otvet.Int['res'] = 0) then begin
res:=ewrRes0;
raise Exception.Create('event='+event+', otvet='+otvet['msg']+' '+msg);
end;
end;
function TExWeb.get(NameValueParams: array of variant; Response: THash):
TExWebResult;
var
cParams: THash;
const
cFuncName = 'get';
begin
cParams:=Hash(NameValueParams);
try
try
result:=get(cParams,Response);
except
on e:Exception do
begin
{$ifdef _log_}error_log(e,ClassName,cFuncName);{$endif}
end;
end;
finally
FreeHash(cParams);
end;
end;
function TExWeb.get(Params, Response: THash): TExWebResult;
begin
addKey(Params);
result:=httpResultToExWebResult(http.get(Params,Response));
processMessages();
end;
function TExWeb.getEnableLog: Boolean;
begin
{$ifdef _log_}
result:=LogMsg.EnableWriteToFile;
{$else}
result:=false;
{$endif}
end;
function TExWeb.getLogFileName: string;
begin
{$ifdef _log_}
result:=LogMsg.LogFileName;
{$else}
result:='';
{$endif}
end;
function TExWeb.getScript: string;
begin
result:=fHttp.Script;
end;
function TExWeb.httpResultToExWebResult(aHttpResult: THttpResult): TExWebResult;
begin
result:=ewrUnknownError;
case aHttpResult of
hrOk: result:=ewrOk;
hrError: result:=ewrNoResponse;
hrNoValidJSON: result:=ewrNoValidJSON;
hrErrorCreateHash: result:=ewrErrorCreateHash;
end;
end;
function TExWeb.post(Params:array of variant; data: TStream; Response: THash):
TExWebResult;
var
cParams: THash;
const
cFuncName = 'post';
begin
result:=ewrUnknownError;
cParams:=Hash(Params);
try
try
addKey(cParams);
result:=post(cParams,data,Response);
except
on e:Exception do
begin
{$ifdef _log_}error_log(e,ClassName,cFuncName);{$endif}
end;
end;
finally
cParams.Free;
end;
end;
function TExWeb.post(Params: THash; data: TStream; Response: THash):
TExWebResult;
begin
addKey(Params);
if (data<>nil) then
result:=httpResultToExWebResult(http.write(Params,data,Response))
else
result:=httpResultToExWebResult(http.write(Params,Response));
processMessages();
end;
procedure TExWeb.processMessages;
begin
try
if (fApp<>nil) then
App.ProcessMessages();
except
on e:Exception do
fApp:=nil;
end;
end;
function TExWeb.query(const sql, base: string; outDS: TStrings = nil; const
coding: string = ''): Boolean;
var
cStoryEncode: Boolean;
fields: THash;
i: Integer;
j: Integer;
len: Integer;
name: string;
otvet: THash;
res: TExWebResult;
return: string;
rows: THash;
stype: string;
value: string;
cFieldDefs: string;
const
cFuncName = 'query';
begin
otvet:=Hash();
result:=false;
try
try
if (outDS = nil) then return:='bool' else return:='table';
cStoryEncode:=http.Encode;
http.Encode:=true;
res:=get(['event','query','sql',sql,'base',base,'return',return,'coding',coding],otvet);
http.Encode:=cStoryEncode;
if ((res = ewrOk) and (otvet['res']='1')) then begin
if (return = 'table') then begin
fields :=otvet.Hash['data'].Hash['fields'];
rows :=otvet.Hash['data'].Hash['rows'];
cFieldDefs:='';
outDS.Add(IntToStr(fields.Count));
for i:=0 to fields.Count - 1 do begin
stype :=fields.Item[i].hash['type'];
len :=fields.Item[i].hash.Int['length'];
name :=fields.Item[i].hash['name'];
if (((MaxDataSetFieldLen>0) and (len>MaxDataSetFieldLen) )or (stype='blob')) then
len:=MaxDataSetFieldLen;
outDS.Add(IntToStr(len));
outDS.Add(name);
end;
for i:=0 to rows.Count-1 do begin
for j:=0 to fields.Count - 1 do begin
name :=fields.Item[j].hash['name'];
value :=rows.Item[i].hash[name];
outDS.Add(value);
end;
end;
end;
result:=true;
end;
except
on e:Exception do
begin
end;
end;
finally
otvet.Free();
end;
end;
function TExWeb.query1(const sql, base: string; outDS: TClientDataSet; const
coding: string = ''): Boolean;
var
cStoryEncode: Boolean;
fields: THash;
i: Integer;
j: Integer;
len: Integer;
name: string;
otvet: THash;
res: TExWebResult;
return: string;
rows: THash;
stype: string;
value: string;
const
cFuncName = 'query';
begin
otvet:=Hash();
result:=false;
try
try
if (outDS = nil) then return:='bool' else return:='table';
cStoryEncode:=http.Encode;
http.Encode:=true;
res:=get(['event','query','sql',sql,'base',base,'return',return,'coding',coding],otvet);
http.Encode:=cStoryEncode;
if ((res = ewrOk) and (otvet['res']='1')) then begin
if (return = 'table') then begin
fields :=otvet.Hash['data'].Hash['fields'];
rows :=otvet.Hash['data'].Hash['rows'];
outDS.Active:=false;
outDS.FieldDefs.Clear;
outDS.Fields.Clear;
for i:=0 to fields.Count - 1 do begin
stype :=fields.Item[i].hash['type'];
len :=fields.Item[i].hash.Int['length'];
name :=fields.Item[i].hash['name'];
if (((MaxDataSetFieldLen>0) and (len>MaxDataSetFieldLen) )or (stype='blob')) then
len:=MaxDataSetFieldLen;
//outDS.FieldDefs.Add(name,ftString,len,true);
break;
end;
//outDS.CreateDataSet;
for i:=0 to rows.Count-1 do begin
//outDS.Append;
for j:=0 to fields.Count - 1 do begin
name :=fields.Item[j].hash['name'];
value:=rows.Item[i].hash[name];
//outDS.Fields.FieldByName(name).AsString:=value;
end;
//outDS.Post;
end;
end;
result:=true;
end;
except
on e:Exception do
begin
end;
end;
finally
otvet.Free();
end;
end;
function TExWeb.read(Params: THash; aData: TStream): TExWebResult;
begin
addKey(Params);
result:=httpResultToExWebResult(http.read(Params,aData));
end;
function TExWeb.recv(var str: string; data: TStream; prevState: TExWebState):
TExWebState;
var
cBlockLen: Integer;
otvet: THash;
cMD5: string;
cMD5Recv: string;
count: Integer;
cResult: TExWebResult;
id: string;
size: Integer;
const
cFuncName = 'recv';
begin
result:=prevState;
result.result:=false;
otvet:=Hash();
try
try
if (prevState.webResult = ewrNeedConfirm) then begin
// есть необходимость закрыть последнюю успешную предачу
cResult:=get(['event','completed','id',prevState.id],otvet);
if cResult<>ewrOk then begin
result:=prevState;
result.result:=false;
raise Exception.Create('event=completed');
end;
if (otvet.Int['res'] = 0) then begin
result:=prevState;
result.result:=false;
raise Exception.Create('event=completed, otvet='+otvet['msg']);
end;
end;
// получаем id сообщения
cResult:=get(['event','recv_get_id'],otvet);
if cResult<>ewrOk then begin
//result:=prevState;
result.webResult:=cResult;
result.id :='-1';
result.result :=false;
raise Exception.Create('event=recv_get_id');
end;
if (otvet.Int['res'] = 0) then begin
//result:=prevState;
result.webResult:=cResult;
result.id :='-1';
result.result :=false;
raise Exception.Create('event=init_recv, otvet='+otvet['msg']);
end;
id := otvet.Hash['data']['id'];
if (id = '-1') then begin
//result:=prevState;
result.webResult:=cResult;
result.id :='-1';
result.result :=false;
raise Exception.Create('no messages');
end;
cBlockLen := otvet.Hash['data'].Int['str_len'];
size := otvet.Hash['data'].Int['size'];
count := otvet.Hash['data'].Int['count_blocks'];
cMD5 := UpperCase(otvet.Hash['data']['md5']);
if (cBlockLen>0) then begin
cResult:=get(['event','recv_string','id',id],otvet);
if cResult<>ewrOk then begin
//result:=prevState;
result.webResult:=cResult;
result.id :=id;
result.result :=false;
raise Exception.Create('event=recv_str');
end;
str:=otvet.Hash['data']['string'];
str:=Utils.rusEnCod(str);
end else
str:='';
//----------------------------------------------------------------------------------------
if (size>0) then begin
data.Size:=0;
cResult:=_recvBlock(data,id,count);
if cResult<>ewrOk then begin
//result:=prevState;
result.webResult:=cResult;
result.id :=id;
result.result :=false;
data.Size:=0;
raise Exception.Create('_recvBlock<>ewrOk');
end;
cMD5Recv := UpperCase(MD5(data));
if (cMD5<>cMD5Recv) then begin
//result:=prevState;
result.webResult:=ewrHashSumNotCompare;
result.id :=id;
result.result :=false;
data.Size:=0;
raise Exception.Create('hash sum recv and sending is not equal');
end;
end;
//----------------------------------------------------------------------------------------
// подтверждение передачи
// не зависимо от результата подтверждения, считаем общий результат успешным
cResult:=get(['event','completed','id',id],otvet);
if (cResult<>ewrOk) or (otvet.Int['res'] = 0) then
cResult:=ewrNeedConfirm;
if (cResult = ewrOk) or (cResult = ewrNeedConfirm) then begin
result.result := true;
result.id := id;
result.webResult := cResult;
end;
except
on e:Exception do
begin
if (e.Message<>'no messages') then begin
{$ifdef _log_}error_log(Format('state:%s',[TExWebStateToStr(prevState)]),e,ClassName,cFuncName);{$endif}
{$ifdef _log_}error_log(Format('key:%s, script:%s',[self.Key,self.Script]),e,ClassName,cFuncName);{$endif}
end;
end;
end;
finally
FreeHash(otvet);
end;
end;
function TExWeb.send(const str: string; data: TStream; prevState: TExWebState):
TExWebState;
var
otvet: THash;
cMD5: string;
cPrepare: Integer;
cResult: TExWebResult;
id: string;
csize: Int64;
const
cFuncName = 'send';
begin
otvet:=Hash();
result:=prevState;
result.result:=false;
try
try
if (data<>nil) and (data.size>0) then begin
data.Position:=0;
cMD5:=MD5(data);
end;
if (prevState.webResult = ewrNeedConfirm) then begin
// есть необходимость закрыть последнюю успешную предачу
cResult:=get(['event','ready','id',prevState.id],otvet);
if cResult<>ewrOk then begin
result:=prevState;
result.result:=false;
raise Exception.Create('event=ready,result='+TExWebResultStr[integer(cResult)]);
end;
if (otvet.Int['res'] = 0) then begin
result:=prevState;
result.result:=false;
raise Exception.Create('event=ready, otvet='+otvet['msg']);
end;
end;
cPrepare:=UUtils.Utils.prepare(str);
if (cPrepare<>0) then begin
cResult := ewrErrorPrepare;
result.id := '-1';
result.webResult:=cResult;
result.result :=false;
raise Exception.Create('prepare pos:'+IntToStr(cPrepare)+' char:['+str[cPrepare]+'] code:['+IntToStr(Ord(str[cPrepare]))+'] ,result='+TExWebResultStr[integer(cResult)]);
end;
// инициализируем передачу и получаем настрйки сервера
cResult:=get(['event','init_send'],otvet);
//if (1>0) then begin
if cResult<>ewrOk then begin
//result:=prevState;
result.webResult:=cResult;
result.id := '-1';
result.result :=false;
raise Exception.Create('event=init_send,result='+TExWebResultStr[integer(cResult)]);
end;
if (otvet.Int['res'] = 0) then begin
//result:=prevState;
result.webResult:=ewrRes0;
result.id := '-1';
result.result :=false;
raise Exception.Create('event=init_send,otvet='+otvet['msg']);
end;
id := otvet.Hash['data']['id'];
BlockSize := otvet.Hash['data'].Int['block_size'];
BlockLen := otvet.Hash['data'].Int['block_len'];
Delay_Block_Send := otvet.Hash['data'].Int['delay_block_send'];
// отправка строки
cResult:=_send(str,id);
if cResult<>ewrOk then begin
//result:=prevState;
result.id := id;
result.webResult:=cResult;
result.result :=false;
raise Exception.Create('_send(str)<>ewrOk,result='+TExWebResultStr[integer(cResult)]);
end;
//----------------------------------------------------------------------------------------
// отправка бинарных данных
if (data<>nil) and (data.size>0) then begin
cResult:=_send(data,id);
if cResult<>ewrOk then begin
//result:=prevState;
result.id := id;
result.webResult:=cResult;
result.result:=false;
raise Exception.Create('_send(stream)<>ewrOk,result='+TExWebResultStr[integer(cResult)]);
end;
end;
//----------------------------------------------------------------------------------------
// подтверждение передачи
// не зависимо от результата подтверждения, считаем общий результат успешным
cResult:=get(['event','ready','id',id],otvet);
if (cResult<>ewrOk) or (otvet.Int['res'] = 0) then
cResult:=ewrNeedConfirm;
if (cResult = ewrOk) or (cResult = ewrNeedConfirm) then begin
result.result := true;
result.id := id;
result.webResult := cResult;
end;
except
on e:Exception do
begin
cSize:=0;
if (data<>nil)then
cSize:=data.Size;
{$ifdef _log_}error_log(Format('str:%s',[str]),e,ClassName,cFuncName);{$endif}
{$ifdef _log_}error_log(Format('data:%d',[cSize]),e,ClassName,cFuncName);{$endif}
{$ifdef _log_}error_log(Format('state:%s',[TExWebStateToStr(prevState)]),e,ClassName,cFuncName);{$endif}
{$ifdef _log_}error_log(Format('key:%s,script:%s',[self.Key,self.Script]),e,ClassName,cFuncName);{$endif}
end;
end;
finally
FreeHash(otvet);
end;
end;
procedure TExWeb.setEnableLog(Value: Boolean);
begin
{$ifdef _log_}LogMsg.EnableWriteToFile:=Value;{$endif}
end;
procedure TExWeb.setLogFileName(const Value: string);
begin
{$ifdef _log_}
LogMsg.LogFileName:=Value;
{$endif}
end;
procedure TExWeb.setScript(const Value: string);
begin
fHttp.Script:=Value;
end;
function TExWeb._recvBlock(data: TStream;id:string;count:integer): TExWebResult;
var
otvet: THash;
i: Integer;
cParams: THash;
cRead: TMemoryStream;
const
cFuncName = '_recvBlock';
begin
result:=ewrUnknownError;
otvet:=Hash();
cParams:=Hash();
cRead:=TMemoryStream.Create;
try
try
//----------------------------------------------------------------------------------------
data.Position:=0;
for i:=0 to count-1 do begin
cParams.clear;
cParams.add(['event','recv_block','i',i,'id',id]);
cRead.Clear;
result:=read(cParams,cRead);
if result<>ewrOk then
raise Exception.Create('event=recv_block');
data.CopyFrom(cRead,cRead.Size);
end;
data.Position:=0;
result:=ewrOk;
except
on e:Exception do
begin
{$ifdef _log_}error_log(TExWebResultStr[integer(result)],e,ClassName,cFuncName);{$endif}
end;
end;
finally
cRead.Free;
FreeHash(otvet);
FreeHash(cParams);
end;
end;
function TExWeb._send(str:string; id: string): TExWebResult;
var
cBlockLen: Integer;
cLen: Integer;
otvet: THash;
cStr: string;
cBlock: string;
cStart:double;
cCurrent:double;
const
cFuncName = '_send(str..)';
begin
result:=ewrUnknownError;
otvet:=Hash();
try
try
cStr:=str;
cStr:=Utils.rusCod(cStr);
cLen:=Length(cStr);
cBlockLen:=BlockLen;
cCurrent:=Utils.GetTimeSec();
cStart:=cCurrent-Delay_Block_Send/1000;
//{$ifdef _log_}error_log('Delay: %d %d',[Delay_Block_Send,BlockLen],ClassName,cFuncName);{$endif}
while(Length(cStr)>0) do begin
cCurrent:=Utils.GetTimeSec();
if (cCurrent-cStart>=(Delay_Block_Send/1000)) then begin
//{$ifdef _log_}error_log('send: %s',[copy(cStr,1,cBlockLen)],ClassName,cFuncName);{$endif}
cBlock:=Utils.UrlEncode(copy(cStr,1,cBlockLen));
cStr:=copy(cStr,cBlockLen+1);
result:=post(['event','send_string','string',cBlock,'id',id],nil,otvet);
ExceptionOtvet(result,otvet,'send_string');
cStart:=cCurrent;
end else begin
Application.ProcessMessages();
end;
end;
//{$ifdef _log_}error_log('ok: send',[],ClassName,cFuncName);{$endif}
//------------------------------------------------------
result:=get(['event','string_encode','id',id],otvet);
ExceptionOtvet(result,otvet,'string_encode');
//------------------------------------------------------
except
on e:Exception do
begin
{$ifdef _log_}error_log(TExWebResultStr[integer(result)],e,ClassName,cFuncName);{$endif}
end;
end;
finally
FreeHash(otvet);
end;
end;
function TExWeb._send(data: TStream; id: string): TExWebResult;
var
cCountF: Single;
info: TExWebBlockInfo;
otvet: THash;
const
cFuncName = '_send';
begin
result:=ewrUnknownError;
otvet:=Hash();
try
try
//----------------------------------------------------------------------------------------
data.Position:=0;
info.size:=data.Size;
info.blockSize:=BlockSize;
info.md5:=UMd5.MD5(data);
info.id := id;
info.count:=info.size div info.blockSize;
cCountF:=(info.size)/info.blockSize;
if (cCountF <> info.count) then
info.count:=info.count+1;
//----------------------------------------------------------------------------------------
// инициируем начало передачи
result:=get(['event','init_send_block','size',info.size,'blockSize',info.blockSize,'count',info.count,'md5',info.md5,'id',info.id],otvet);
ExceptionOtvet(result,otvet,'init_send_block');
//----------------------------------------------------------------------------------------
// отсылка полезной информации
result:=_sendBlock(info,data);
if result<>ewrOk then
raise Exception.Create('_sendBlock return error');
//----------------------------------------------------------------------------------------
// сравнение хеш сумм
result:=get(['event','hash_sum_compare','id',info.id],otvet);
ExceptionOtvet(result,otvet,'hash_sum_compare');
if (otvet.Hash['data'].Int['check'] = 0) then begin
result:=ewrHashSumNotCompare;
raise Exception.Create('event=hash_sum_compare,check = 0');
end;
except
on e:Exception do
begin
{$ifdef _log_}error_log(TExWebResultStr[integer(result)],e,ClassName,cFuncName);{$endif}
end;
end;
finally
FreeHash(otvet);
end;
end;
function TExWeb._sendBlock(info: TExWebBlockInfo; data: TStream): TExWebResult;
var
otvet: THash;
cCurrentSize: Int64;
i: Integer;
params: THash;
block: TMemoryStream;
httpResponse: THash;
const
cFuncName = '_sendBlock';
begin
otvet:=Hash();
params:=Hash();
result:=ewrUnknownError;
try
try
data.Position:=0;
//----------------------------------------------------------------------------------------
// поблочная передача данных
params['event'] := 'send_block';
params['id'] := info.id;
//----------------------------------------------------------------------------------------
for i:=0 to info.count-1 do begin
block:=TMemoryStream.Create;
httpResponse:=Hash();
params['i'] := intToStr(i);
try
try
cCurrentSize:=info.blockSize;
if (data.Position+cCurrentSize>data.Size) then
cCurrentSize:=data.Size - data.Position;
params['size'] := intToStr(cCurrentSize);
block.CopyFrom(data,cCurrentSize);
params['md5']:=MD5(block);
block.Position:=0;
result:=post(params,block,httpResponse);
ExceptionOtvet(result,httpResponse,'send_block');
except
on e:Exception do
begin
{$ifdef _log_}error_log('',e,ClassName,cFuncName);{$endif}
end;
end;
finally
FreeHash(httpResponse);
block.Free;
end;
// ошибка при предаче блока - прерываем цикл
if (result<>ewrOk) then
break;
end;//for
//----------------------------------------------------------------------------------------
except
on e:Exception do
begin
{$ifdef _log_} error_log('ERROR: %s',[TExWebResultStr[integer(result)]],ClassName,cFuncName);{$endif}
end;
end;
finally
FreeHash(params);
FreeHash(otvet);
end;
end;
end.
|
program terminalargs;
var
i: integer;
begin
for i := 0 to ParamCount do
writeln ('[', i ,']: ', ParamStr(i));
end.
|
{*********************************************}
{ TeeBI Software Library }
{ Geographic Database Support }
{ Copyright (c) 2015-2017 by Steema Software }
{ All Rights Reserved }
{*********************************************}
unit BI.Geographic;
interface
{
This unit contains a global "TGeo" object instance to connect to the default
"Geo" TeeBI database, located at "BISamples" store.
It is used by TBIChart control (VCLBI.Chart.Geo.pas unit) to determine
which map, if any, should be used to graphically display values
}
uses
BI.Arrays, BI.DataItem;
type
TEntity=record
private
procedure Init(const AData:TDataItem; const AID:String=''; const AName:String='');
public
Pad: Integer;
Data,
ID,
Name : TDataItem;
function CodeOfName(const AName:String):String;
function CodeToString(const ACode:Integer): String; overload;
function CodeToString(const ACode:Int64): String; overload;
function CodeToString(const ACode:String): String; overload;
function CodeToString(const AData:TDataItem; const AIndex:TInteger):String; overload;
function NameOfCode(const ACode:Integer):String;
function SortFindLookup(const ACode:Integer;
const ACodeItem,ANameItem:TDataItem):String;
end;
TMasterDetail=record
private
class procedure Init; static;
procedure Load(const AMaster,ADetail:TDataItem;
const ADetailToMaster:String;
const AMasterID:String='';
const ADetailID:String='';
const PadSize:Integer=0); overload;
procedure Load(const AMaster,ADetail:TEntity;
const ADetailToMaster:String;
const AMasterID:String='';
const ADetailID:String='';
const PadSize:Integer=0); overload;
public
Master,
Detail : TEntity;
DetailToMaster : TDataItem;
function Find(const AData:TDataItem; out ByCode:Boolean):Boolean; overload;
class function FindDetail(const AData:TDataItem; out AEntity:TEntity):Boolean; static;
class function FindMaster(const AData:TDataItem; out AMulti:TMasterDetail):Boolean; static;
procedure Load; overload;
end;
TCountry=record
private
procedure Load;
//class function NameOfIndex(const AIndex:TInteger): String; static;
public
Countries,
ISONum,
ISOA2,
ISOA3,
Capital,
Name : TDataItem;
end;
TEntities=record
private
procedure Init(const AData:TDataItem);
public
type
TAustralia=record
private
procedure Init(const AData:TDataItem);
public
Data : TDataItem;
Lands,
Counties : TEntity;
end;
TBrazil=record
private
procedure Init(const AData:TDataItem);
public
Data : TDataItem;
Regions,
States : TEntity;
end;
TCanada=record
private
procedure Init(const AData:TDataItem);
public
Data : TDataItem;
Provinces : TEntity;
end;
TChina=record
private
procedure Init(const AData:TDataItem);
public
Data : TDataItem;
Provinces,
Prefectures : TEntity;
end;
TFrance=record
private
procedure Init(const AData:TDataItem);
public
Data : TDataItem;
Regions,
Departements: TEntity;
end;
TGermany=record
private
procedure Init(const AData:TDataItem);
public
Data : TDataItem;
States,
Districts : TEntity;
end;
TIndia=record
private
procedure Init(const AData:TDataItem);
public
Data : TDataItem;
Zones,
States : TEntity;
end;
TIndonesia=record
private
procedure Init(const AData:TDataItem);
public
Data : TDataItem;
Zones,
Provinces : TEntity;
end;
TItaly=record
private
procedure Init(const AData:TDataItem);
public
Data : TDataItem;
MacroRegions,
Regions,
Provinces : TEntity;
end;
TJapan=record
private
procedure Init(const AData:TDataItem);
public
Data : TDataItem;
Regions,
Prefectures : TEntity;
end;
TMexico=record
private
procedure Init(const AData:TDataItem);
public
Data : TDataItem;
States : TEntity;
end;
TNetherlands=record
private
procedure Init(const AData:TDataItem);
public
Data : TDataItem;
Provinces,
Municipalities : TEntity;
end;
TPortugal=record
private
procedure Init(const AData:TDataItem);
public
Data : TDataItem;
Regions,
Districts : TEntity;
end;
TRussia=record
private
procedure Init(const AData:TDataItem);
public
Data : TDataItem;
Districts,
Subjects: TEntity;
end;
TSouthAfrica=record
private
procedure Init(const AData:TDataItem);
public
Data : TDataItem;
Provinces: TEntity;
end;
TSouthKorea=record
private
procedure Init(const AData:TDataItem);
public
Data : TDataItem;
Types,
Provinces: TEntity;
end;
TSpain=record
private
procedure Init(const AData:TDataItem);
public
Data : TDataItem;
Regions,
Provinces : TEntity;
end;
TSwitzerland=record
private
procedure Init(const AData:TDataItem);
public
Data : TDataItem;
Cantons : TEntity;
end;
TUK=record
private
procedure Init(const AData:TDataItem);
public
Data : TDataItem;
NUTS,
Counties: TEntity;
end;
TUSA=record
private
procedure Init(const AData:TDataItem);
public
Data : TDataItem;
States,
Counties : TEntity;
end;
var
Country : TEntity;
Data,
Australia : TAustralia;
Brazil : TBrazil;
Canada : TCanada;
China : TChina;
France : TFrance;
Germany : TGermany;
India : TIndia;
Indonesia : TIndonesia;
Italy : TItaly;
Japan : TJapan;
Mexico : TMexico;
Netherlands : TNetherlands;
Portugal : TPortugal;
Russia : TRussia;
SouthAfrica : TSouthAfrica;
SouthKorea : TSouthKorea;
Spain : TSpain;
Switzerland : TSwitzerland;
UK : TUK;
USA : TUSA;
end;
TGeo=record
private
class var
_Geo : TDataItem;
class procedure AddSynonyms; static;
public
class var
Continents : TEntity;
Country : TCountry;
Entities : TEntities;
class function AllFoundIn(const AText:TDataItem; const AEntity:TEntity; const UseSynonyms:Boolean):Boolean; static;
class procedure Check; static;
class function EntityOf(const AData:TDataItem; const ACode:Int64):String; overload; static;
class function EntityOf(const AData:TDataItem; const ACode:String):String; overload; static;
class function FindSynonym(const S:String):String; static;
class function IsChild(const AData:TDataItem):Boolean; static;
class function LinkedTo(const AData:TDataItem):TDataItem; static;
class function IsMultiEntity(const AData:TDataItem; out AMulti:TMasterDetail):Boolean; static;
class function TextMapOf(const AData:TDataItem):TTextMap; static;
end;
implementation
|
{*******************************************************}
{ }
{ Delphi LiveBindings Framework }
{ }
{ Copyright(c) 2011 Embarcadero Technologies, Inc. }
{ }
{*******************************************************}
unit Data.Bind.ObserverLinks;
interface
uses
System.Classes, System.SysUtils, Data.Bind.Components;
type
TBindObserver = class(TInterfacedObject, IObserver)
private
FBindLink: IBindLink;
FOnToggle: TObserverToggleEvent;
protected
constructor Create(ABindLink: IBindLink); overload;
public
function GetOnObserverToggle: TObserverToggleEvent;
procedure SetOnObserverToggle(AEvent: TObserverToggleEvent);
procedure Removed;
function GetActive: Boolean;
procedure SetActive(Value: Boolean);
end;
TBindSingleCastObserver = class(TBindObserver, ISingleCastObserver)
end;
TBindMultiCastObserver = class(TBindObserver, IMultiCastObserver)
end;
TBindEditLinkObserver = class(TBindSingleCastObserver, IEditLinkObserver)
public
procedure BeginUpdate;
procedure EndUpdate;
function GetUpdating: Boolean;
procedure Update;
function Edit: Boolean;
procedure Reset;
procedure Modified;
function IsModified: Boolean;
function IsValidChar(AKey: Char): Boolean;
function IsRequired: Boolean;
function GetIsReadOnly: Boolean;
procedure SetIsReadOnly(Value: Boolean);
function GetIsEditing: Boolean;
constructor Create(ABindLink: TCustomBindLink); overload;
end;
TBindEditGridLinkObserver = class(TBindEditLinkObserver, IEditGridLinkObserver)
private
FOnGetCurrent: TObserverGetCurrentEvent;
public
function GetCurrent: TVarRec;
function GetOnObserverCurrent: TObserverGetCurrentEvent;
procedure SetOnObserverCurrent(AEvent: TObserverGetCurrentEvent);
constructor Create(ABindLink: TCustomBindGridLink); overload;
constructor Create(ABindLink: TCustomBindListLink); overload;
end;
TBindPositionLinkObserver = class(TBindMultiCastObserver, IPositionLinkObserver)
private
FBindPosition: IBindPosition;
public
constructor Create(ABindLink: TCustomBindGridLink); overload;
constructor Create(ABindLink: TCustomBindListLink); overload;
constructor Create(ABindPosition: TCustomBindPosition); overload;
procedure PosChanged;
end;
implementation
uses
Data.Bind.Consts;
{ TBindEditLinkObserver }
constructor TBindEditLinkObserver.Create(ABindLink: TCustomBindLink);
var
LBindLink: IBindLink;
begin
if not Supports(ABindLink, IBindLink, LBindLink) then
raise EObserverException.Create(sBindLinkIncompatible);
inherited Create(LBindLink);
end;
function TBindEditLinkObserver.Edit: Boolean;
begin
if FBindLink.Updating then
Result := False
else
begin
if not FBindLink.GetCanModify then
// Don't allow editing of readonly field
Exit(False);
FBindLink.BeginUpdate;
try
Result := FBindLink.Edit;
finally
FBindLink.EndUpdate;
end;
end;
end;
function TBindEditLinkObserver.GetIsEditing: Boolean;
begin
Result := FBindLink.GetIsEditing;
end;
function TBindEditLinkObserver.GetIsReadOnly: Boolean;
begin
Result := not FBindLink.GetCanModify;
end;
function TBindEditLinkObserver.IsModified: Boolean;
begin
Result := FBindLink.GetIsModified;
end;
function TBindEditLinkObserver.IsRequired: Boolean;
begin
Result := FBindLink.IsRequired;
end;
function TBindEditLinkObserver.IsValidChar(AKey: Char): Boolean;
begin
Result := FBindLink.IsValidChar(AKey);
end;
procedure TBindEditLinkObserver.Modified;
begin
if not FBindLink.Updating then
FBindLink.SetModified;
end;
procedure TBindEditLinkObserver.Reset;
begin
FBindLink.Reset;
end;
procedure TBindEditLinkObserver.SetIsReadOnly(Value: Boolean);
begin
FBindLink.SetIsReadOnly(Value);
end;
procedure TBindEditLinkObserver.Update;
begin
if IsModified and (not FBindLink.Updating) then
begin
FBindLink.BeginUpdate;
try
FBindLink.EvaluateParse('');
finally
FBindLink.EndUpdate;
end;
end;
end;
procedure TBindEditLinkObserver.BeginUpdate;
begin
FBindLink.BeginUpdate;
end;
procedure TBindEditLinkObserver.EndUpdate;
begin
FBindLink.EndUpdate;
end;
function TBindEditLinkObserver.GetUpdating: Boolean;
begin
Result := FBindLink.Updating;
end;
{ TBindObserver }
constructor TBindObserver.Create(ABindLink: IBindLink);
begin
FBindLink := ABindLink;
FOnToggle := nil;
end;
function TBindObserver.GetActive: Boolean;
begin
if Assigned(FBindLink) then
Result := FBindLink.Active
else
Result := True
end;
function TBindObserver.GetOnObserverToggle: TObserverToggleEvent;
begin
Result := FOnToggle;
end;
procedure TBindObserver.Removed;
begin
if Assigned(FBindLink) then
begin
FBindLink.Active := False;
FBindLink.ClearEditingLink;
end;
end;
procedure TBindObserver.SetActive(Value: Boolean);
begin
// (to initialize properties like ReadOnly, alignment, maxlength, etc)
if Assigned(FOnToggle) then
FOnToggle(Self, Value);
end;
procedure TBindObserver.SetOnObserverToggle(AEvent: TObserverToggleEvent);
begin
FOnToggle := AEvent;
end;
{ TBindPositionLinkObserver }
constructor TBindPositionLinkObserver.Create(ABindLink: TCustomBindGridLink);
var
LBindLink: IBindLink;
LBindPosition: IBindPosition;
begin
if not Supports(ABindLink, IBindLink, LBindLink) then
raise EObserverException.Create(sBindLinkIncompatible);
if not Supports(ABindLink, IBindPosition, LBindPosition) then
raise EObserverException.Create(sBindPositionIncompatible);
inherited Create(LBindLink);
FBindPosition := LBindPosition;
end;
constructor TBindPositionLinkObserver.Create(ABindLink: TCustomBindListLink);
var
LBindLink: IBindLink;
LBindPosition: IBindPosition;
begin
if not Supports(ABindLink, IBindLink, LBindLink) then
raise EObserverException.Create(sBindLinkIncompatible);
if not Supports(ABindLink, IBindPosition, LBindPosition) then
raise EObserverException.Create(sBindPositionIncompatible);
inherited Create(LBindLink);
FBindPosition := LBindPosition;
end;
constructor TBindPositionLinkObserver.Create(ABindPosition: TCustomBindPosition);
var
LBindPosition: IBindPosition;
begin
if not Supports(ABindPosition, IBindPosition, LBindPosition) then
raise EObserverException.Create(sBindPositionIncompatible);
inherited Create(nil);
FBindPosition := LBindPosition;
end;
procedure TBindPositionLinkObserver.PosChanged;
begin
FBindPosition.PosChanged;
end;
{ TBindEditGridLinkObserver }
constructor TBindEditGridLinkObserver.Create(ABindLink: TCustomBindGridLink);
var
LBindLink: IBindLink;
begin
if not Supports(ABindLink, IBindLink, LBindLink) then
raise EObserverException.Create(sBindLinkIncompatible);
inherited Create(LBindLink);
end;
constructor TBindEditGridLinkObserver.Create(ABindLink: TCustomBindListLink);
var
LBindLink: IBindLink;
begin
if not Supports(ABindLink, IBindLink, LBindLink) then
raise EObserverException.Create(sBindLinkIncompatible);
inherited Create(LBindLink);
end;
function TBindEditGridLinkObserver.GetCurrent: TVarRec;
begin
if Assigned(FOnGetCurrent) then
Result := FOnGetCurrent()
else
begin
Result.VType := vtInteger;
Result.VInteger := -1;
end;
end;
function TBindEditGridLinkObserver.GetOnObserverCurrent: TObserverGetCurrentEvent;
begin
Result := FOnGetCurrent;
end;
procedure TBindEditGridLinkObserver.SetOnObserverCurrent(
AEvent: TObserverGetCurrentEvent);
begin
FOnGetCurrent := AEvent;
end;
end.
|
unit Support.Sandforce.Hynix;
interface
uses
SysUtils,
Support, Support.Sandforce;
type
THynixSandforceNSTSupport = class sealed(TSandforceNSTSupport)
private
function IsHynixSandforceProduct: Boolean;
public
function GetSupportStatus: TSupportStatus; override;
end;
implementation
{ THynixSandforceNSTSupport }
function THynixSandforceNSTSupport.GetSupportStatus: TSupportStatus;
begin
FillChar(result, SizeOf(result), #0);
if IsHynixSandforceProduct then
result := GetSemiSupport;
end;
function THynixSandforceNSTSupport.IsHynixSandforceProduct: Boolean;
begin
result := (Pos('MNM', Identify.Model) > 0) and (Pos('HFS', Identify.Model) > 0);
end;
end.
|
{ ALGORITHME du programme:
programme Carre_magique
CONST
taille = 5
type
Tableau=TABLEAU[1..taille,1..taille] en ENTIER
//BUT initialiser le tableau avec des 0
//ENTREE 4 entiers et un tableau
//SORTIE le tableau, initialisé à 0 et 2 entiers initialisés
procedure initTab (var Tab:Tableau var x,y:ENTIER)
var i,j :ENTIER
DEBUT
POUR i <- 1 à taille FAIRE
DEBUT
POUR j<- 1 à taille FAIRE
DEBUT
Tab[i,j]<-0
FINPOUR
FINPOUR
//placement du 1
x<-((taille-1) div 2)
y<-((taille+1) div 2)
FINPROCEDURE
//BUT Afficher le tableau
//ENTREE 2 entiers et un tableau
//SORTIE affiche àut le tableau
procedure AfficheTab(var Tab:Tableau)
var
i,j :ENTIER
DEBUT
POUR i <- 1 à taille FAIRE
DEBUT
POUR j<- 1 à taille FAIRE
DEBUT
ECRIRE Tab[i,j] & ' '
FINPOUR
ECRIRE
FINPOUR
FINPROCEDURE
//BUT comparer si x ou y est au dessus de taille ou en dessous de 1, et le corriger
//ENTREE 2 entiers
//SORTIE 2 entiers corrigés
procedure CompareTab(var x,y:ENTIER)
DEBUT
//systeme pour que 6=1, 7=2 etc
SI x>taille ALORS
x<-x-taille
FINSI
SI y>taille ALORS
y<-y-taille
FINSI
//systeme pour que -1=5 -2=4 etc
SI x<1 ALORS
x<-x+taille
FINSI
SI y<1 ALORS
y<-y+taille
FINSI
FINPROCEDURE
//BUT remplir le tableau de 1 à taille
//ENTREE 3 entiers et un tableau
//SORTIE le tableau , prêt à être affiché
procedure RempliTab(var Tab:Tableauvar x,y:ENTIER)
//génération automatique du tableau à parir du 1
var
i:ENTIER
DEBUT
POUR i<-1 à taille*taille FAIRE
DEBUT
CompareTab(x,y)
//systeme pour que si une case est occupée, on déplace au nord-ouest
SI Tab[x,y]<>0 ALORS
x<-x-1
y<-y-1
CompareTab(x,y)
FINSI
//on entre la FAIREnnée dans le tableau
Tab[x,y]<-i
//on se déplace dans le tableau au prochain placement
x<-x-1
y<-y+1
FINPOUR
FINPROCEDURE
//début du corps du programme
//BUT créer un carré magique adaptable en 5x5 ou 7x7
//ENTREE Un tableau
//SORTIE Le tableau a deux dimensions affichant le carré magique
var
i,j,x,y:ENTIER
Tab:TABLEAU
DEBUT
ECRIRE "Voici un carré magique de " & taille & " x " & taille
initTab(Tab,x,y) //initialisation du tableau
RempliTab(Tab,x,y) //remplissage du tableau
afficheTab(Tab) //affichage du tableau
FIN.
___________________________________________________________________________________________________________
}
program Carre_magique;
uses crt;
CONST
taille = 5; //modifier ici par 7 pour un carré magique de 7x7
type
Tableau=array[1..taille,1..taille] of integer;
//BUT initialiser le tableau avec des 0
//ENTREE 4 entiers et un tableau
//SORTIE le tableau, initialisé à 0 et 2 entiers initialisés
procedure initTab (var Tab:Tableau; var x,y:integer);
var i,j :integer;
BEGIN
for i := 1 to taille do
begin
for j:= 1 to taille do
begin
Tab[i,j]:=0;
end;
end;
//placement du 1
x:=((taille-1) div 2);
y:=((taille+1) div 2);
END;
//BUT Afficher le tableau
//ENTREE 2 entiers et un tableau
//SORTIE affiche tout le tableau
procedure AfficheTab(var Tab:Tableau);
var
i,j :integer;
BEGIN
for i := 1 to taille do
begin
for j:= 1 to taille do
begin
write(Tab[i,j],' ');
end;
writeln;
end;
END;
//BUT comparer si x ou y est au dessus de taille ou en dessous de 1, et le corriger
//ENTREE 2 entiers
//SORTIE 2 entiers corrigés
procedure CompareTab(var x,y:integer);
BEGIN
//systeme pour que 6=1, 7=2 etc
if x>taille then
x:=x-taille;
if y>taille then
y:=y-taille;
//systeme pour que -1=5 -2=4 etc
if x<1 then
x:=x+taille;
if y<1 then
y:=y+taille;
END;
//BUT remplir le tableau de 1 à taille
//ENTREE 3 entiers et un tableau
//SORTIE le tableau , prêt à être affiché
procedure RempliTab(var Tab:Tableau;var x,y:integer);
//génération automatique du tableau à parir du 1
var
i:integer;
BEGIN
for i:=1 to taille*taille do
begin
CompareTab(x,y);
//systeme pour que si une case est occupée, on déplace au nord-ouest
if Tab[x,y]<>0 then
begin
x:=x-1;
y:=y-1;
CompareTab(x,y);
end;
//on entre la donnée dans le tableau
Tab[x,y]:=i;
//on se déplace dans le tableau au prochain placement
x:=x-1;
y:=y+1;
END;
END;
//début du corps du programme
//BUT créer un carré magique adaptable en 5x5 ou 7x7
//ENTREE Un tableau
//SORTIE Le tableau a deux dimensions affichant le carré magique
var
i,j,x,y:integer;
Tab:Tableau;
BEGIN
clrscr;
writeln('Voici un carre magique de ',taille,' x ',taille);
writeln;
initTab(Tab,x,y); //initialisation du tableau
RempliTab(Tab,x,y); //remplissage du tableau
afficheTab(Tab); //affichage du tableau
readln();
END. |
unit uMainForm;
interface
uses
System.Classes, System.SysUtils,
Vcl.Forms, Vcl.StdCtrls, Vcl.Controls,
//GLS
GLObjects, GLScene, GLBlur, GLSimpleNavigation, GLTexture,
GLCadencer, GLVectorGeometry, GLTeapot, GLPolyhedron, GLGeomObjects,
GLWin32Viewer, GLCrossPlatform, GLMaterial, GLCoordinates, GLBaseClasses;
type
TForm1 = class(TForm)
GLScene1: TGLScene;
GLSceneViewer1: TGLSceneViewer;
GLCadencer1: TGLCadencer;
Cam: TGLCamera;
Light: TGLLightSource;
GLMaterialLibrary1: TGLMaterialLibrary;
GLCube1: TGLCube;
GLSphere1: TGLSphere;
GLTorus1: TGLTorus;
GLIcosahedron1: TGLIcosahedron;
GLTeapot1: TGLTeapot;
GLCube2: TGLCube;
GLCube3: TGLCube;
GLMotionBlur1: TGLMotionBlur;
GLSimpleNavigation1: TGLSimpleNavigation;
procedure GLCadencer1Progress(Sender: TObject; const deltaTime,
newTime: Double);
private
{ Private declarations }
public
{ Public declarations }
MotionBlur: TGLMotionBlur;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.GLCadencer1Progress(Sender: TObject; const deltaTime,
newTime: Double);
begin
GLCube1.RollAngle:= GLCube1.RollAngle - 175*deltaTime;
GLCube1.TurnAngle:= GLCube1.TurnAngle + 175*deltaTime;
GLTorus1.RollAngle:= GLTorus1.RollAngle - 5*deltaTime;
GLTorus1.TurnAngle:= GLTorus1.TurnAngle + 5*deltaTime;
GLIcosahedron1.RollAngle:= GLIcosahedron1.RollAngle - 50*deltaTime;
GLIcosahedron1.TurnAngle:= GLIcosahedron1.TurnAngle + 50*deltaTime;
GLCube1.Position.X:=Sin(newTime+2)*8-1;
GLCube1.Position.Y:=Cos(newTime+2)*2;
GLCube1.Position.Z:=Cos(newTime+2)*3;
GLCube2.Position.X:=Sin(newTime+2)*8-1;
GLSceneViewer1.Invalidate;
end;
end.
|
PROGRAM Balkendiagramm;
FUNCTION Maximum(ni: ARRAY OF integer): integer;
var i, max: integer;
BEGIN (* Maximum *)
max := 0;
FOR i := 0 TO Length(ni) - 1 DO BEGIN
IF (ni[i] > max) THEN BEGIN
max := ni[i];
END; (* IF *)
END; (* FOR *)
Maximum := max;
END; (* Maximum *)
PROCEDURE BarChart(ch: char; ni: ARRAY OF integer);
var row, col: integer;
BEGIN (* BarChart *)
FOR row := Maximum(ni) DOWNTO 1 DO BEGIN
Write(row:2, '|');
FOR col := 0 TO Length(ni) - 1 DO BEGIN
IF (ni[col] >= row) THEN BEGIN
Write(ch:2);
END ELSE BEGIN
Write(' ':2);
END; (* IF *)
END; (* FOR col*)
WriteLn();
END; (* FOR row*)
WriteLn(' +-----------');
WriteLn(' 1 2 3 4 5');
END; (* BarChart *)
var cha: char;
var numbers: ARRAY [1..5] OF integer;
var i: integer;
BEGIN (* Balkendiagramm *)
Write('ch: ');
Readln(cha);
Write('ni: ');
Read(numbers[1]);
Read(numbers[2]);
Read(numbers[3]);
Read(numbers[4]);
Readln(numbers[5]);
FOR i := 1 TO 5 DO BEGIN
IF ((numbers[i] > 10) OR (numbers[i] < 1)) THEN BEGIN
Write('Wert ungueltig, Programm wird beendet');
Exit;
END; (* IF *)
END; (* FOR *)
BarChart(cha, numbers);
END. (* Balkendiagramm *) |
{ This, Folks, is the 2nd BackDoor program. Enjoy it, it's made for you! }
{ Idea + Coding: C. Olliwood. Distortions by Chip-sy-King (Hahaha!) }
(* by BackDoor. 18/6/1995 *)
PROGRAM Funny_Message_V1_0; { From Feb. the 26, 1995 }
USES Crt;
VAR Zuffi_Zahl : Integer;
Spruch : String;
PROCEDURE Waehle_Spruch;
BEGIN
Zuffi_Zahl := RANDOM (9);
CASE Zuffi_Zahl OF
0 : Spruch := 'Hi, nice to see you. Hope you got a good f*#+ tonight !?';
1 : Spruch := 'Yes, touch my keys, you stut muffin. It is so good when you do it!';
2 : Spruch := 'No joke today, I`m busy!';
3 : Spruch := 'Hi, chummer, doin` alright? I hope so! Now let`s start...';
4 : Spruch := 'Eat shit and bark at the moon! (No offence)';
5 : Spruch := 'WARNING!!! There is a corrupt DOS-System on your HD. Your PC will explode in 20 seconds!';
6 : Spruch := 'Ya know BackDoors motto? GOTTA GET AWAY !!!';
7 : Spruch := 'The last words of an electrician: `What`s that cable?`';
8 : Spruch := '`RAM` : Righteous American Motherfucker. How much have YOU?'
END;
END;
BEGIN
Spruch := '';
RANDOMIZE;
WRITELN;
TextAttr := RANDOM (16);
Waehle_Spruch;
WRITELN (Spruch);
TEXTCOLOR (7);
WRITELN ('The ultimate Joke-Processor. (c)1995 by BackDoor');
WRITELN;
NORMVIDEO;
END.
{ That`s all again. Go home scrawnking zour chick! } |
unit uZeichnerInit;
{$mode delphi}
interface
uses
Classes, SysUtils, fgl,
uZeichnerbase, uZeichnerGruenesBlatt, uZeichnerFarben,
uZeichnerSchrittlaenge,uZeichnerFarbenUndSchrittlaenge,
uZeichnerFarbenBlattUndSchritt;
type TErbteZeichnerBase = class of TZeichnerBase;
type TVersandTabelleZeichner = TFPGMap<String, TErbteZeichnerBase>;
{ Aufgabe: Diese Klasse soll den Konstruktor einer Zeichen-Klasse
aufrufen, wobei die Konstruktoren den Strings zugeordnet sind. }
type TZeichnerInit = class
private
FVersandTabelleZeichner: TVersandTabelleZeichner;
public
constructor Create;
destructor Destroy; override;
{ Aufgabe: Die 'zeichnerArt' spezifiziert den Namen der Zeichenart,
welche genutzt wird. Diese Funktion gibt dann die Instanz von
dieser Zeichenart zurueck. }
function initialisiere(zeichnerArt: String; zeichenPara: TZeichenParameter) : TZeichnerBase;
{ Aufgabe: Gibt eine Liste von Zeichenartnamen zurueck. Diese koennen dann als
Eingabe in die initialisiere-Methode benutzt werden. }
function gibZeichnerListe : TStringList;
end;
implementation
constructor TZeichnerInit.Create;
// Der Zeichenparameter wird lediglich dafuer genutzt um den Namen zu extrahieren
var zeichenPara: TZeichenParameter;
begin
// default
zeichenPara.winkel := 0;
zeichenPara.rekursionsTiefe := 0;
zeichenPara.setzeStartPunkt(0,0,0);
FVersandTabelleZeichner := TVersandTabelleZeichner.Create;
FVersandTabelleZeichner.add(
(TZeichnerBase.Create(zeichenPara)).name,
TZeichnerBase
);
FVersandTabelleZeichner.add(
(TZeichnerGruenesBlatt.Create(zeichenPara)).name,
TZeichnerGruenesBlatt
);
FVersandTabelleZeichner.add(
(TZeichnerFarben.Create(zeichenPara)).name,
TZeichnerFarben
);
FVersandTabelleZeichner.add(
(TZeichnerSchrittlaenge.Create(zeichenPara)).name,
TZeichnerSchrittlaenge
);
FVersandTabelleZeichner.add(
(TZeichnerFarbenUndSchrittlaenge.Create(zeichenPara)).name,
TZeichnerFarbenUndSchrittlaenge
);
FVersandTabelleZeichner.add(
(TZeichnerFarbenBlattUndSchritt.Create(zeichenPara)).name,
TZeichnerFarbenBlattUndSchritt
);
end;
destructor TZeichnerInit.Destroy;
begin
FreeAndNil(FVersandTabelleZeichner);
end;
function TZeichnerInit.initialisiere(zeichnerArt: String; zeichenpara: TZeichenParameter) : TZeichnerBase;
var t: TErbteZeichnerBase;
begin
if FVersandTabelleZeichner.tryGetData(zeichnerArt,t) then result := t.Create(zeichenPara)
else result := TZeichnerBase.Create(zeichenPara);
end;
function TZeichnerInit.gibZeichnerListe : TStringList;
var i: Cardinal;
begin
result := TStringList.Create;
for i := 0 to FVersandTabelleZeichner.Count - 1 do result.add(FVersandTabelleZeichner.keys[i]);
end;
end.
|
unit Test_FIToolkit.Logger.Impl;
{
Delphi DUnit Test Case
----------------------
This unit contains a skeleton test case class generated by the Test Case Wizard.
Modify the generated code to correctly setup and call the methods from the unit
being tested.
}
interface
uses
TestFramework,
System.Classes, System.Rtti, System.TypInfo,
FIToolkit.Logger.Intf, FIToolkit.Logger.Impl, FIToolkit.Logger.Types,
TestUtils;
type
{ Testing helpers }
TTestTextOutput = class (TPlainTextOutput)
strict private
FLastWrittenLine : String;
FWrittenLinesCount : Integer;
strict protected
procedure WriteLine(const S : String); override;
public
property LastWrittenLine : String read FLastWrittenLine;
property WrittenLinesCount : Integer read FWrittenLinesCount;
end;
TMethodHolderObj = class abstract (TPersistent)
published
function FuncMethod(const StrParam : String; IntParam : Integer;
out ObjParam : TObject) : TTypeKind; virtual; abstract;
procedure ProcMethod(const StrParam : String; IntParam : Integer;
out ObjParam : TObject); virtual; abstract;
end;
TMethodHolderRec = record
public
function FuncMethod(const StrParam : String; IntParam : Integer; out ObjParam : TObject) : TTypeKind;
procedure ProcMethod(const StrParam : String; IntParam : Integer; out ObjParam : TObject);
end;
{ SUT }
// Test methods for class TLogger
TestTLogger = class (TInterfaceTestCase<ILogger>)
strict private
FOutput : TTestTextOutput;
protected
procedure DoSetUp; override;
procedure DoTearDown; override;
function MakeSUT : ILogger; override;
published
procedure TestAddOutput;
procedure TestAllowedItems;
procedure TestEnabled;
procedure TestEnterSection;
procedure TestEnterSection1;
procedure TestEnterSectionFmt;
procedure TestEnterSectionVal;
procedure TestLeaveSection;
procedure TestLeaveSection1;
procedure TestLeaveSectionFmt;
procedure TestLeaveSectionVal;
procedure TestEnterMethod;
procedure TestEnterMethod1;
procedure TestLeaveMethod;
procedure TestLeaveMethod1;
procedure TestLeaveMethod2;
procedure TestLeaveMethod3;
procedure TestLog;
procedure TestLog1;
procedure TestLogFmt;
procedure TestLogVal;
procedure TestDebug;
procedure TestDebug1;
procedure TestDebugFmt;
procedure TestDebugVal;
procedure TestInfo;
procedure TestInfo1;
procedure TestInfoFmt;
procedure TestInfoVal;
procedure TestWarning;
procedure TestWarning1;
procedure TestWarningFmt;
procedure TestWarningVal;
procedure TestError;
procedure TestError1;
procedure TestErrorFmt;
procedure TestErrorVal;
procedure TestFatal;
procedure TestFatal1;
procedure TestFatalFmt;
procedure TestFatalVal;
end;
// Test methods for class TMetaLogger
TestTMetaLogger = class (TInterfaceTestCase<IMetaLogger>)
strict private
FOutput : TTestTextOutput;
private
procedure CheckWasOutput(ExpectedLinesCount : Integer = 1);
protected
procedure DoSetUp; override;
procedure DoTearDown; override;
function MakeSUT : IMetaLogger; override;
published
procedure TestEnabled;
procedure TestEnterSection;
procedure TestEnterSection1;
procedure TestEnterSectionFmt;
procedure TestEnterSectionVal;
procedure TestLeaveSection;
procedure TestLeaveSection1;
procedure TestLeaveSectionFmt;
procedure TestLeaveSectionVal;
procedure TestEnterMethod;
procedure TestEnterMethod1;
procedure TestLeaveMethod;
procedure TestLeaveMethod1;
procedure TestLeaveMethod2;
procedure TestLeaveMethod3;
procedure TestLog;
procedure TestLog1;
procedure TestLogFmt;
procedure TestLogVal;
procedure TestDebug;
procedure TestDebug1;
procedure TestDebugFmt;
procedure TestDebugVal;
procedure TestInfo;
procedure TestInfo1;
procedure TestInfoFmt;
procedure TestInfoVal;
procedure TestWarning;
procedure TestWarning1;
procedure TestWarningFmt;
procedure TestWarningVal;
procedure TestError;
procedure TestError1;
procedure TestErrorFmt;
procedure TestErrorVal;
procedure TestFatal;
procedure TestFatal1;
procedure TestFatalFmt;
procedure TestFatalVal;
end;
// Test methods for class TPlainTextOutput
TestTPlainTextOutput = class (TInterfaceTestCase<ILogOutput>)
protected
function MakeSUT : ILogOutput; override;
published
procedure TestBeginSection;
procedure TestEndSection;
procedure TestWriteMessage;
end;
implementation
uses
System.SysUtils,
FIToolkit.Logger.Utils, FIToolkit.Logger.Consts;
{ TTestTextOutput }
procedure TTestTextOutput.WriteLine(const S : String);
begin
FLastWrittenLine := S;
Inc(FWrittenLinesCount);
end;
{ TMethodHolderRec }
function TMethodHolderRec.FuncMethod(const StrParam : String; IntParam : Integer; out ObjParam : TObject) : TTypeKind;
begin
Result := Default(TTypeKind);
end;
procedure TMethodHolderRec.ProcMethod(const StrParam : String; IntParam : Integer; out ObjParam : TObject);
begin
{NOP}
end;
{ TestTLogger }
procedure TestTLogger.DoSetUp;
begin
FOutput := TTestTextOutput.Create;
SUT.AddOutput(FOutput);
end;
procedure TestTLogger.DoTearDown;
begin
FOutput := nil;
end;
function TestTLogger.MakeSUT : ILogger;
begin
Result := TLogger.Create;
end;
procedure TestTLogger.TestAddOutput;
const
STR_MSG = '<TestAddOutput>';
var
LogOutput : ILogOutput;
begin
LogOutput := TTestTextOutput.Create;
SUT.AddOutput(LogOutput);
SUT.Debug(STR_MSG);
with LogOutput as TTestTextOutput do
begin
CheckEquals(1, WrittenLinesCount, 'WrittenLinesCount = 1');
CheckTrue(LastWrittenLine.Contains(STR_MSG), 'LastWrittenLine.Contains(STR_MSG)');
end;
end;
procedure TestTLogger.TestAllowedItems;
const
STR_MSG = '<TestAllowedItems>';
begin
CheckEquals<TLogItems>([liMessage, liSection], SUT.AllowedItems, 'AllowedItems = [liMessage, liSection]');
SUT.AllowedItems := [];
SUT.EnterSection(STR_MSG);
SUT.EnterMethod(ClassType, @TestTLogger.TestAllowedItems, []);
SUT.Debug(STR_MSG);
CheckEquals(0, FOutput.WrittenLinesCount, 'WrittenLinesCount = 0');
SUT.AllowedItems := [liMessage];
SUT.Debug(STR_MSG);
CheckEquals(1, FOutput.WrittenLinesCount, 'WrittenLinesCount = 1');
SUT.AllowedItems := [liSection];
SUT.EnterSection(STR_MSG);
CheckEquals(2, FOutput.WrittenLinesCount, 'WrittenLinesCount = 2');
SUT.AllowedItems := [liMethod];
SUT.EnterMethod(ClassType, @TestTLogger.TestAllowedItems, []);
CheckEquals(3, FOutput.WrittenLinesCount, 'WrittenLinesCount = 3');
end;
procedure TestTLogger.TestEnterSection;
const
STR_MSG = '<TestEnterSection>';
begin
SUT.EnterSection(STR_MSG);
CheckEquals(1, FOutput.SectionLevel, 'SectionLevel = 1');
CheckEquals(1, FOutput.WrittenLinesCount, 'WrittenLinesCount = 1');
CheckTrue(FOutput.LastWrittenLine.Contains(STR_MSG), 'CheckTrue::LastWrittenLine.Contains(STR_MSG)');
end;
procedure TestTLogger.TestEnterSection1;
const
STR_VAL = String('<TestEnterSection1>');
INT_VAL = Integer(777);
begin
SUT.EnterSection([STR_VAL, INT_VAL]);
CheckEquals(1, FOutput.SectionLevel, 'SectionLevel = 1');
CheckEquals(1, FOutput.WrittenLinesCount, 'WrittenLinesCount = 1');
CheckTrue(FOutput.LastWrittenLine.Contains(STR_VAL), 'CheckTrue::LastWrittenLine.Contains(STR_VAL)');
CheckTrue(FOutput.LastWrittenLine.Contains(INT_VAL.ToString), 'CheckTrue::LastWrittenLine.Contains(INT_VAL)');
end;
procedure TestTLogger.TestEnterSectionFmt;
const
FMT_MSG = 'Message with string arg "%s" and integer arg "%d".';
STR_VAL = String('<TestEnterSectionFmt>');
INT_VAL = Integer(777);
begin
SUT.EnterSectionFmt(FMT_MSG, [STR_VAL, INT_VAL]);
CheckEquals(1, FOutput.SectionLevel, 'SectionLevel = 1');
CheckEquals(1, FOutput.WrittenLinesCount, 'WrittenLinesCount = 1');
CheckTrue(FOutput.LastWrittenLine.Contains(STR_VAL), 'CheckTrue::LastWrittenLine.Contains(STR_VAL)');
CheckTrue(FOutput.LastWrittenLine.Contains(INT_VAL.ToString), 'CheckTrue::LastWrittenLine.Contains(INT_VAL)');
end;
procedure TestTLogger.TestEnterSectionVal;
const
STR_VAL = String('<TestEnterSectionVal>');
INT_VAL = Integer(777);
begin
SUT.EnterSectionVal([STR_VAL, INT_VAL, Self]);
CheckEquals(1, FOutput.SectionLevel, 'SectionLevel = 1');
CheckEquals(1, FOutput.WrittenLinesCount, 'WrittenLinesCount = 1');
CheckTrue(FOutput.LastWrittenLine.Contains(STR_VAL), 'CheckTrue::LastWrittenLine.Contains(STR_VAL)');
CheckTrue(FOutput.LastWrittenLine.Contains(INT_VAL.ToString), 'CheckTrue::LastWrittenLine.Contains(INT_VAL)');
CheckTrue(FOutput.LastWrittenLine.Contains(Self.ToString), 'CheckTrue::LastWrittenLine.Contains(Self)');
end;
procedure TestTLogger.TestLeaveSection;
const
STR_MSG = '<TestLeaveSection>';
begin
SUT.LeaveSection(STR_MSG);
CheckEquals(0, FOutput.SectionLevel, '(SectionLevel = 0)::<#1>');
CheckEquals(0, FOutput.WrittenLinesCount, 'WrittenLinesCount = 0');
SUT.EnterSection(STR_MSG);
SUT.LeaveSection(STR_MSG);
CheckEquals(0, FOutput.SectionLevel, '(SectionLevel = 0)::<#2>');
CheckEquals(2, FOutput.WrittenLinesCount, 'WrittenLinesCount = 2');
CheckTrue(FOutput.LastWrittenLine.Contains(STR_MSG), 'CheckTrue::LastWrittenLine.Contains(STR_MSG)');
end;
procedure TestTLogger.TestLeaveSection1;
const
STR_VAL = String('<TestLeaveSection1>');
INT_VAL = Integer(777);
begin
SUT.LeaveSection([STR_VAL, INT_VAL]);
CheckEquals(0, FOutput.SectionLevel, '(SectionLevel = 0)::<#1>');
CheckEquals(0, FOutput.WrittenLinesCount, 'WrittenLinesCount = 0');
SUT.EnterSection([STR_VAL, INT_VAL]);
SUT.LeaveSection([STR_VAL, INT_VAL]);
CheckEquals(0, FOutput.SectionLevel, '(SectionLevel = 0)::<#2>');
CheckEquals(2, FOutput.WrittenLinesCount, 'WrittenLinesCount = 2');
CheckTrue(FOutput.LastWrittenLine.Contains(STR_VAL), 'CheckTrue::LastWrittenLine.Contains(STR_VAL)');
CheckTrue(FOutput.LastWrittenLine.Contains(INT_VAL.ToString), 'CheckTrue::LastWrittenLine.Contains(INT_VAL)');
end;
procedure TestTLogger.TestLeaveSectionFmt;
const
FMT_MSG = 'Message with string arg "%s" and integer arg "%d".';
STR_VAL = String('<TestLeaveSectionFmt>');
INT_VAL = Integer(777);
begin
SUT.LeaveSectionFmt(FMT_MSG, [STR_VAL, INT_VAL]);
CheckEquals(0, FOutput.SectionLevel, '(SectionLevel = 0)::<#1>');
CheckEquals(0, FOutput.WrittenLinesCount, 'WrittenLinesCount = 0');
SUT.EnterSectionFmt(FMT_MSG, [STR_VAL, INT_VAL]);
SUT.LeaveSectionFmt(FMT_MSG, [STR_VAL, INT_VAL]);
CheckEquals(0, FOutput.SectionLevel, '(SectionLevel = 0)::<#2>');
CheckEquals(2, FOutput.WrittenLinesCount, 'WrittenLinesCount = 2');
CheckTrue(FOutput.LastWrittenLine.Contains(STR_VAL), 'CheckTrue::LastWrittenLine.Contains(STR_VAL)');
CheckTrue(FOutput.LastWrittenLine.Contains(INT_VAL.ToString), 'CheckTrue::LastWrittenLine.Contains(INT_VAL)');
end;
procedure TestTLogger.TestLeaveSectionVal;
const
STR_VAL = String('<TestLeaveSectionVal>');
INT_VAL = Integer(777);
begin
SUT.LeaveSectionVal([STR_VAL, INT_VAL, Self]);
CheckEquals(0, FOutput.SectionLevel, '(SectionLevel = 0)::<#1>');
CheckEquals(0, FOutput.WrittenLinesCount, 'WrittenLinesCount = 0');
SUT.EnterSectionVal([STR_VAL, INT_VAL, Self]);
SUT.LeaveSectionVal([STR_VAL, INT_VAL, Self]);
CheckEquals(0, FOutput.SectionLevel, '(SectionLevel = 0)::<#2>');
CheckEquals(2, FOutput.WrittenLinesCount, 'WrittenLinesCount = 2');
CheckTrue(FOutput.LastWrittenLine.Contains(STR_VAL), 'CheckTrue::LastWrittenLine.Contains(STR_VAL)');
CheckTrue(FOutput.LastWrittenLine.Contains(INT_VAL.ToString), 'CheckTrue::LastWrittenLine.Contains(INT_VAL)');
CheckTrue(FOutput.LastWrittenLine.Contains(Self.ToString), 'CheckTrue::LastWrittenLine.Contains(Self)');
end;
procedure TestTLogger.TestEnabled;
begin
CheckTrue(SUT.Enabled, 'CheckTrue::Enabled<after set up>');
SUT.SeverityThreshold := SEVERITY_NONE;
CheckFalse(SUT.Enabled, 'CheckFalse::Enabled<after SEVERITY_NONE>');
SUT.SeverityThreshold := SEVERITY_MAX;
CheckTrue(SUT.Enabled, 'CheckTrue::Enabled<after SEVERITY_MAX');
end;
procedure TestTLogger.TestEnterMethod;
const
STR_VAL = String('<TestEnterMethod>');
INT_VAL = Integer(777);
begin
SUT.AllowedItems := SUT.AllowedItems + [liMethod];
{ Case #1 }
SUT.EnterMethod(TMethodHolderObj, @TMethodHolderObj.ProcMethod, [STR_VAL, INT_VAL, Self]);
CheckEquals(1, FOutput.WrittenLinesCount, 'WrittenLinesCount = 1');
CheckEquals(1, FOutput.SectionLevel, 'SectionLevel = 1');
CheckTrue(FOutput.LastWrittenLine.Contains(TMethodHolderObj.ClassName),
'CheckTrue::LastWrittenLine.Contains(TMethodHolderObj.ClassName)<Case #1>');
CheckTrue(FOutput.LastWrittenLine.Contains(TMethodHolderObj.MethodName(@TMethodHolderObj.ProcMethod)),
'CheckTrue::LastWrittenLine.Contains(TMethodHolderObj.MethodName)<Case #1>');
CheckTrue(FOutput.LastWrittenLine.Contains(STR_VAL), 'CheckTrue::LastWrittenLine.Contains(STR_VAL)<Case #1>');
CheckTrue(FOutput.LastWrittenLine.Contains(INT_VAL.ToString), 'CheckTrue::LastWrittenLine.Contains(INT_VAL)<Case #1>');
CheckTrue(FOutput.LastWrittenLine.Contains(Self.ToString), 'CheckTrue::LastWrittenLine.Contains(Self)<Case #1>');
{ Case #2 }
SUT.EnterMethod(TMethodHolderObj, @TMethodHolderObj.FuncMethod, [STR_VAL, INT_VAL, Self]);
CheckEquals(2, FOutput.WrittenLinesCount, 'WrittenLinesCount = 2');
CheckEquals(2, FOutput.SectionLevel, 'SectionLevel = 2');
CheckTrue(FOutput.LastWrittenLine.Contains(TMethodHolderObj.ClassName),
'CheckTrue::LastWrittenLine.Contains(TMethodHolderObj.ClassName)<Case #2>');
CheckTrue(FOutput.LastWrittenLine.Contains(TMethodHolderObj.MethodName(@TMethodHolderObj.FuncMethod)),
'CheckTrue::LastWrittenLine.Contains(TMethodHolderObj.MethodName)<Case #2>');
CheckTrue(FOutput.LastWrittenLine.Contains(STR_VAL), 'CheckTrue::LastWrittenLine.Contains(STR_VAL)<Case #2>');
CheckTrue(FOutput.LastWrittenLine.Contains(INT_VAL.ToString), 'CheckTrue::LastWrittenLine.Contains(INT_VAL)<Case #2>');
CheckTrue(FOutput.LastWrittenLine.Contains(Self.ToString), 'CheckTrue::LastWrittenLine.Contains(Self)<Case #2>');
end;
procedure TestTLogger.TestEnterMethod1;
const
STR_VAL = String('<TestEnterMethod1>');
INT_VAL = Integer(777);
begin
SUT.AllowedItems := SUT.AllowedItems + [liMethod];
{ Case #1 }
SUT.EnterMethod(TypeInfo(TMethodHolderRec), @TMethodHolderRec.ProcMethod, [STR_VAL, INT_VAL, Self]);
CheckEquals(1, FOutput.WrittenLinesCount, 'WrittenLinesCount = 1');
CheckEquals(1, FOutput.SectionLevel, 'SectionLevel = 1');
CheckTrue(FOutput.LastWrittenLine.Contains(GetTypeName(TypeInfo(TMethodHolderRec))),
'CheckTrue::LastWrittenLine.Contains(GetTypeName)<Case #1>');
CheckTrue(FOutput.LastWrittenLine.Contains('ProcMethod'),
'CheckTrue::LastWrittenLine.Contains(<MethodName>)<Case #1>');
CheckTrue(FOutput.LastWrittenLine.Contains(STR_VAL), 'CheckTrue::LastWrittenLine.Contains(STR_VAL)<Case #1>');
CheckTrue(FOutput.LastWrittenLine.Contains(INT_VAL.ToString), 'CheckTrue::LastWrittenLine.Contains(INT_VAL)<Case #1>');
CheckTrue(FOutput.LastWrittenLine.Contains(Self.ToString), 'CheckTrue::LastWrittenLine.Contains(Self)<Case #1>');
{ Case #2 }
SUT.EnterMethod(TypeInfo(TMethodHolderRec), @TMethodHolderRec.FuncMethod, [STR_VAL, INT_VAL, Self]);
CheckEquals(2, FOutput.WrittenLinesCount, 'WrittenLinesCount = 2');
CheckEquals(2, FOutput.SectionLevel, 'SectionLevel = 2');
CheckTrue(FOutput.LastWrittenLine.Contains(GetTypeName(TypeInfo(TMethodHolderRec))),
'CheckTrue::LastWrittenLine.Contains(GetTypeName)<Case #2>');
CheckTrue(FOutput.LastWrittenLine.Contains('FuncMethod'),
'CheckTrue::LastWrittenLine.Contains(<MethodName>)<Case #2>');
CheckTrue(FOutput.LastWrittenLine.Contains(STR_VAL), 'CheckTrue::LastWrittenLine.Contains(STR_VAL)<Case #2>');
CheckTrue(FOutput.LastWrittenLine.Contains(INT_VAL.ToString), 'CheckTrue::LastWrittenLine.Contains(INT_VAL)<Case #2>');
CheckTrue(FOutput.LastWrittenLine.Contains(Self.ToString), 'CheckTrue::LastWrittenLine.Contains(Self)<Case #2>');
end;
procedure TestTLogger.TestLeaveMethod;
const
RESULT_VALUE = String('<TestLeaveMethod>');
begin
SUT.AllowedItems := SUT.AllowedItems + [liMethod];
SUT.EnterSection('MethodSection1');
SUT.EnterSection('MethodSection2');
{ Case #1 }
SUT.LeaveMethod(TMethodHolderObj, @TMethodHolderObj.ProcMethod, RESULT_VALUE);
CheckEquals(3, FOutput.WrittenLinesCount, 'WrittenLinesCount = 3');
CheckEquals(1, FOutput.SectionLevel, 'SectionLevel = 1');
CheckTrue(FOutput.LastWrittenLine.Contains(TMethodHolderObj.ClassName),
'CheckTrue::LastWrittenLine.Contains(TMethodHolderObj.ClassName)<Case #1>');
CheckTrue(FOutput.LastWrittenLine.Contains(TMethodHolderObj.MethodName(@TMethodHolderObj.ProcMethod)),
'CheckTrue::LastWrittenLine.Contains(TMethodHolderObj.MethodName)<Case #1>');
CheckFalse(FOutput.LastWrittenLine.Contains(RESULT_VALUE), 'CheckFalse::LastWrittenLine.Contains(RESULT_VALUE)<Case #1>');
{ Case #2 }
SUT.LeaveMethod(TMethodHolderObj, @TMethodHolderObj.FuncMethod, RESULT_VALUE);
CheckEquals(4, FOutput.WrittenLinesCount, 'WrittenLinesCount = 4');
CheckEquals(0, FOutput.SectionLevel, 'SectionLevel = 0');
CheckTrue(FOutput.LastWrittenLine.Contains(TMethodHolderObj.ClassName),
'CheckTrue::LastWrittenLine.Contains(TMethodHolderObj.ClassName)<Case #2>');
CheckTrue(FOutput.LastWrittenLine.Contains(TMethodHolderObj.MethodName(@TMethodHolderObj.FuncMethod)),
'CheckTrue::LastWrittenLine.Contains(TMethodHolderObj.MethodName)<Case #2>');
CheckTrue(FOutput.LastWrittenLine.Contains(RESULT_VALUE), 'CheckTrue::LastWrittenLine.Contains(RESULT_VALUE)<Case #2>');
end;
procedure TestTLogger.TestLeaveMethod1;
const
RESULT_VALUE = String('<TestLeaveMethod1>');
begin
SUT.AllowedItems := SUT.AllowedItems + [liMethod];
SUT.EnterSection('MethodSection1');
SUT.EnterSection('MethodSection2');
{ Case #1 }
SUT.LeaveMethod(TypeInfo(TMethodHolderRec), @TMethodHolderRec.ProcMethod, RESULT_VALUE);
CheckEquals(3, FOutput.WrittenLinesCount, 'WrittenLinesCount = 3');
CheckEquals(1, FOutput.SectionLevel, 'SectionLevel = 1');
CheckTrue(FOutput.LastWrittenLine.Contains(GetTypeName(TypeInfo(TMethodHolderRec))),
'CheckTrue::LastWrittenLine.Contains(GetTypeName)<Case #1>');
CheckTrue(FOutput.LastWrittenLine.Contains('ProcMethod'),
'CheckTrue::LastWrittenLine.Contains(<MethodName>)<Case #1>');
CheckFalse(FOutput.LastWrittenLine.Contains(RESULT_VALUE), 'CheckFalse::LastWrittenLine.Contains(RESULT_VALUE)<Case #1>');
{ Case #2 }
SUT.LeaveMethod(TypeInfo(TMethodHolderRec), @TMethodHolderRec.FuncMethod, RESULT_VALUE);
CheckEquals(4, FOutput.WrittenLinesCount, 'WrittenLinesCount = 4');
CheckEquals(0, FOutput.SectionLevel, 'SectionLevel = 0');
CheckTrue(FOutput.LastWrittenLine.Contains(GetTypeName(TypeInfo(TMethodHolderRec))),
'CheckTrue::LastWrittenLine.Contains(GetTypeName)<Case #2>');
CheckTrue(FOutput.LastWrittenLine.Contains('FuncMethod'),
'CheckTrue::LastWrittenLine.Contains(<MethodName>)<Case #2>');
CheckTrue(FOutput.LastWrittenLine.Contains(RESULT_VALUE), 'CheckTrue::LastWrittenLine.Contains(RESULT_VALUE)<Case #2>');
end;
procedure TestTLogger.TestLeaveMethod2;
var
VoidResult : String;
begin
VoidResult := TValue.Empty.ToString;
SUT.AllowedItems := SUT.AllowedItems + [liMethod];
SUT.EnterSection('MethodSection1');
SUT.EnterSection('MethodSection2');
{ Case #1 }
SUT.LeaveMethod(TMethodHolderObj, @TMethodHolderObj.ProcMethod);
CheckEquals(3, FOutput.WrittenLinesCount, 'WrittenLinesCount = 3');
CheckEquals(1, FOutput.SectionLevel, 'SectionLevel = 1');
CheckTrue(FOutput.LastWrittenLine.Contains(TMethodHolderObj.ClassName),
'CheckTrue::LastWrittenLine.Contains(TMethodHolderObj.ClassName)<Case #1>');
CheckTrue(FOutput.LastWrittenLine.Contains(TMethodHolderObj.MethodName(@TMethodHolderObj.ProcMethod)),
'CheckTrue::LastWrittenLine.Contains(TMethodHolderObj.MethodName)<Case #1>');
CheckFalse(FOutput.LastWrittenLine.Contains(VoidResult), 'CheckFalse::LastWrittenLine.Contains(VoidResult)<Case #1>');
{ Case #2 }
SUT.LeaveMethod(TMethodHolderObj, @TMethodHolderObj.FuncMethod);
CheckEquals(4, FOutput.WrittenLinesCount, 'WrittenLinesCount = 4');
CheckEquals(0, FOutput.SectionLevel, 'SectionLevel = 0');
CheckTrue(FOutput.LastWrittenLine.Contains(TMethodHolderObj.ClassName),
'CheckTrue::LastWrittenLine.Contains(TMethodHolderObj.ClassName)<Case #2>');
CheckTrue(FOutput.LastWrittenLine.Contains(TMethodHolderObj.MethodName(@TMethodHolderObj.FuncMethod)),
'CheckTrue::LastWrittenLine.Contains(TMethodHolderObj.MethodName)<Case #2>');
CheckTrue(FOutput.LastWrittenLine.Contains(VoidResult), 'CheckTrue::LastWrittenLine.Contains(VoidResult)<Case #2>');
end;
procedure TestTLogger.TestLeaveMethod3;
var
VoidResult : String;
begin
VoidResult := TValue.Empty.ToString;
SUT.AllowedItems := SUT.AllowedItems + [liMethod];
SUT.EnterSection('MethodSection1');
SUT.EnterSection('MethodSection2');
{ Case #1 }
SUT.LeaveMethod(TypeInfo(TMethodHolderRec), @TMethodHolderRec.ProcMethod);
CheckEquals(3, FOutput.WrittenLinesCount, 'WrittenLinesCount = 3');
CheckEquals(1, FOutput.SectionLevel, 'SectionLevel = 1');
CheckTrue(FOutput.LastWrittenLine.Contains(GetTypeName(TypeInfo(TMethodHolderRec))),
'CheckTrue::LastWrittenLine.Contains(GetTypeName)<Case #1>');
CheckTrue(FOutput.LastWrittenLine.Contains('ProcMethod'),
'CheckTrue::LastWrittenLine.Contains(<MethodName>)<Case #1>');
CheckFalse(FOutput.LastWrittenLine.Contains(VoidResult), 'CheckFalse::LastWrittenLine.Contains(VoidResult)<Case #1>');
{ Case #2 }
SUT.LeaveMethod(TypeInfo(TMethodHolderRec), @TMethodHolderRec.FuncMethod);
CheckEquals(4, FOutput.WrittenLinesCount, 'WrittenLinesCount = 4');
CheckEquals(0, FOutput.SectionLevel, 'SectionLevel = 0');
CheckTrue(FOutput.LastWrittenLine.Contains(GetTypeName(TypeInfo(TMethodHolderRec))),
'CheckTrue::LastWrittenLine.Contains(GetTypeName)<Case #2>');
CheckTrue(FOutput.LastWrittenLine.Contains('FuncMethod'),
'CheckTrue::LastWrittenLine.Contains(<MethodName>)<Case #2>');
CheckTrue(FOutput.LastWrittenLine.Contains(VoidResult), 'CheckTrue::LastWrittenLine.Contains(VoidResult)<Case #2>');
end;
procedure TestTLogger.TestLog;
var
Msg: string;
Severity: TLogMsgSeverity;
begin
Msg := 'TestLog';
Severity := SEVERITY_MIN;
{ Case #1 }
SUT.Log(Severity, Msg);
CheckEquals(1, FOutput.WrittenLinesCount, '(WrittenLinesCount = 1)::<Case #1>');
CheckTrue(FOutput.LastWrittenLine.Contains(Msg), 'CheckTrue::LastWrittenLine.Contains(Msg)');
{ Case #2 }
SUT.SeverityThreshold := SEVERITY_MAX;
SUT.Log(Severity, Msg);
CheckEquals(1, FOutput.WrittenLinesCount, '(WrittenLinesCount = 1)::<Case #2>');
{ Case #3 }
SUT.SeverityThreshold := SEVERITY_NONE;
SUT.Log(Severity, Msg);
CheckEquals(1, FOutput.WrittenLinesCount, '(WrittenLinesCount = 1)::<Case #3>');
end;
procedure TestTLogger.TestLog1;
const
STR_VAL = String('<TestLog1>');
INT_VAL = Integer(777);
var
Severity: TLogMsgSeverity;
begin
Severity := SEVERITY_MIN;
{ Case #1 }
SUT.Log(Severity, [STR_VAL, INT_VAL]);
CheckEquals(1, FOutput.WrittenLinesCount, '(WrittenLinesCount = 1)::<Case #1>');
CheckTrue(FOutput.LastWrittenLine.Contains(STR_VAL), 'CheckTrue::LastWrittenLine.Contains(STR_VAL)');
CheckTrue(FOutput.LastWrittenLine.Contains(INT_VAL.ToString), 'CheckTrue::LastWrittenLine.Contains(INT_VAL)');
{ Case #2 }
SUT.SeverityThreshold := SEVERITY_MAX;
SUT.Log(Severity, [STR_VAL, INT_VAL]);
CheckEquals(1, FOutput.WrittenLinesCount, '(WrittenLinesCount = 1)::<Case #2>');
{ Case #3 }
SUT.SeverityThreshold := SEVERITY_NONE;
SUT.Log(Severity, [STR_VAL, INT_VAL]);
CheckEquals(1, FOutput.WrittenLinesCount, '(WrittenLinesCount = 1)::<Case #3>');
end;
procedure TestTLogger.TestLogFmt;
const
FMT_MSG = 'Message with string arg "%s" and integer arg "%d".';
STR_VAL = String('<TestLogFmt>');
INT_VAL = Integer(777);
var
Msg: String;
Severity: TLogMsgSeverity;
begin
Msg := FMT_MSG;
Severity := SEVERITY_MIN;
{ Case #1 }
SUT.LogFmt(Severity, Msg, [STR_VAL, INT_VAL]);
CheckEquals(1, FOutput.WrittenLinesCount, '(WrittenLinesCount = 1)::<Case #1>');
CheckTrue(FOutput.LastWrittenLine.Contains(STR_VAL), 'CheckTrue::LastWrittenLine.Contains(STR_VAL)');
CheckTrue(FOutput.LastWrittenLine.Contains(INT_VAL.ToString), 'CheckTrue::LastWrittenLine.Contains(INT_VAL)');
{ Case #2 }
SUT.SeverityThreshold := SEVERITY_MAX;
SUT.LogFmt(Severity, Msg, [STR_VAL, INT_VAL]);
CheckEquals(1, FOutput.WrittenLinesCount, '(WrittenLinesCount = 1)::<Case #2>');
{ Case #3 }
SUT.SeverityThreshold := SEVERITY_NONE;
SUT.LogFmt(Severity, Msg, [STR_VAL, INT_VAL]);
CheckEquals(1, FOutput.WrittenLinesCount, '(WrittenLinesCount = 1)::<Case #3>');
end;
procedure TestTLogger.TestLogVal;
const
STR_VAL = String('<TestLogVal>');
INT_VAL = Integer(777);
var
Severity: TLogMsgSeverity;
begin
Severity := SEVERITY_MIN;
{ Case #1 }
SUT.LogVal(Severity, [STR_VAL, INT_VAL, Self]);
CheckEquals(1, FOutput.WrittenLinesCount, '(WrittenLinesCount = 1)::<Case #1>');
CheckTrue(FOutput.LastWrittenLine.Contains(STR_VAL), 'CheckTrue::LastWrittenLine.Contains(STR_VAL)');
CheckTrue(FOutput.LastWrittenLine.Contains(INT_VAL.ToString), 'CheckTrue::LastWrittenLine.Contains(INT_VAL)');
CheckTrue(FOutput.LastWrittenLine.Contains(Self.ToString), 'CheckTrue::LastWrittenLine.Contains(Self)');
{ Case #2 }
SUT.SeverityThreshold := SEVERITY_MAX;
SUT.LogVal(Severity, [STR_VAL, INT_VAL, Self]);
CheckEquals(1, FOutput.WrittenLinesCount, '(WrittenLinesCount = 1)::<Case #2>');
{ Case #3 }
SUT.SeverityThreshold := SEVERITY_NONE;
SUT.LogVal(Severity, [STR_VAL, INT_VAL, Self]);
CheckEquals(1, FOutput.WrittenLinesCount, '(WrittenLinesCount = 1)::<Case #3>');
end;
procedure TestTLogger.TestDebug;
var
Msg: string;
begin
Msg := 'TestDebug';
SUT.SeverityThreshold := SEVERITY_DEBUG;
SUT.Debug(Msg);
CheckEquals(1, FOutput.WrittenLinesCount, 'WrittenLinesCount = 1');
CheckTrue(FOutput.LastWrittenLine.Contains(Msg), 'CheckTrue::LastWrittenLine.Contains(Msg)');
end;
procedure TestTLogger.TestDebug1;
const
STR_VAL = String('<TestDebug1>');
INT_VAL = Integer(777);
begin
SUT.SeverityThreshold := SEVERITY_DEBUG;
SUT.Debug([STR_VAL, INT_VAL]);
CheckEquals(1, FOutput.WrittenLinesCount, 'WrittenLinesCount = 1');
CheckTrue(FOutput.LastWrittenLine.Contains(STR_VAL), 'CheckTrue::LastWrittenLine.Contains(STR_VAL)');
CheckTrue(FOutput.LastWrittenLine.Contains(INT_VAL.ToString), 'CheckTrue::LastWrittenLine.Contains(INT_VAL)');
end;
procedure TestTLogger.TestDebugFmt;
const
FMT_MSG = 'Message with string arg "%s" and integer arg "%d".';
STR_VAL = String('<TestDebugFmt>');
INT_VAL = Integer(777);
begin
SUT.SeverityThreshold := SEVERITY_DEBUG;
SUT.DebugFmt(FMT_MSG, [STR_VAL, INT_VAL]);
CheckEquals(1, FOutput.WrittenLinesCount, 'WrittenLinesCount = 1');
CheckTrue(FOutput.LastWrittenLine.Contains(STR_VAL), 'CheckTrue::LastWrittenLine.Contains(STR_VAL)');
CheckTrue(FOutput.LastWrittenLine.Contains(INT_VAL.ToString), 'CheckTrue::LastWrittenLine.Contains(INT_VAL)');
end;
procedure TestTLogger.TestDebugVal;
const
STR_VAL = String('<TestDebugVal>');
INT_VAL = Integer(777);
begin
SUT.SeverityThreshold := SEVERITY_DEBUG;
SUT.DebugVal([STR_VAL, INT_VAL, Self]);
CheckEquals(1, FOutput.WrittenLinesCount, 'WrittenLinesCount = 1');
CheckTrue(FOutput.LastWrittenLine.Contains(STR_VAL), 'CheckTrue::LastWrittenLine.Contains(STR_VAL)');
CheckTrue(FOutput.LastWrittenLine.Contains(INT_VAL.ToString), 'CheckTrue::LastWrittenLine.Contains(INT_VAL)');
CheckTrue(FOutput.LastWrittenLine.Contains(Self.ToString), 'CheckTrue::LastWrittenLine.Contains(Self)');
end;
procedure TestTLogger.TestInfo;
var
Msg: string;
begin
Msg := 'TestInfo';
SUT.SeverityThreshold := SEVERITY_INFO;
SUT.Info(Msg);
CheckEquals(1, FOutput.WrittenLinesCount, 'WrittenLinesCount = 1');
CheckTrue(FOutput.LastWrittenLine.Contains(Msg), 'CheckTrue::LastWrittenLine.Contains(Msg)');
end;
procedure TestTLogger.TestInfo1;
const
STR_VAL = String('<TestInfo1>');
INT_VAL = Integer(777);
begin
SUT.SeverityThreshold := SEVERITY_INFO;
SUT.Info([STR_VAL, INT_VAL]);
CheckEquals(1, FOutput.WrittenLinesCount, 'WrittenLinesCount = 1');
CheckTrue(FOutput.LastWrittenLine.Contains(STR_VAL), 'CheckTrue::LastWrittenLine.Contains(STR_VAL)');
CheckTrue(FOutput.LastWrittenLine.Contains(INT_VAL.ToString), 'CheckTrue::LastWrittenLine.Contains(INT_VAL)');
end;
procedure TestTLogger.TestInfoFmt;
const
FMT_MSG = 'Message with string arg "%s" and integer arg "%d".';
STR_VAL = String('<TestInfoFmt>');
INT_VAL = Integer(777);
begin
SUT.SeverityThreshold := SEVERITY_INFO;
SUT.InfoFmt(FMT_MSG, [STR_VAL, INT_VAL]);
CheckEquals(1, FOutput.WrittenLinesCount, 'WrittenLinesCount = 1');
CheckTrue(FOutput.LastWrittenLine.Contains(STR_VAL), 'CheckTrue::LastWrittenLine.Contains(STR_VAL)');
CheckTrue(FOutput.LastWrittenLine.Contains(INT_VAL.ToString), 'CheckTrue::LastWrittenLine.Contains(INT_VAL)');
end;
procedure TestTLogger.TestInfoVal;
const
STR_VAL = String('<TestInfoVal>');
INT_VAL = Integer(777);
begin
SUT.SeverityThreshold := SEVERITY_INFO;
SUT.InfoVal([STR_VAL, INT_VAL, Self]);
CheckEquals(1, FOutput.WrittenLinesCount, 'WrittenLinesCount = 1');
CheckTrue(FOutput.LastWrittenLine.Contains(STR_VAL), 'CheckTrue::LastWrittenLine.Contains(STR_VAL)');
CheckTrue(FOutput.LastWrittenLine.Contains(INT_VAL.ToString), 'CheckTrue::LastWrittenLine.Contains(INT_VAL)');
CheckTrue(FOutput.LastWrittenLine.Contains(Self.ToString), 'CheckTrue::LastWrittenLine.Contains(Self)');
end;
procedure TestTLogger.TestWarning;
var
Msg: string;
begin
Msg := 'TestWarning';
SUT.SeverityThreshold := SEVERITY_WARNING;
SUT.Warning(Msg);
CheckEquals(1, FOutput.WrittenLinesCount, 'WrittenLinesCount = 1');
CheckTrue(FOutput.LastWrittenLine.Contains(Msg), 'CheckTrue::LastWrittenLine.Contains(Msg)');
end;
procedure TestTLogger.TestWarning1;
const
STR_VAL = String('<TestWarning1>');
INT_VAL = Integer(777);
begin
SUT.SeverityThreshold := SEVERITY_WARNING;
SUT.Warning([STR_VAL, INT_VAL]);
CheckEquals(1, FOutput.WrittenLinesCount, 'WrittenLinesCount = 1');
CheckTrue(FOutput.LastWrittenLine.Contains(STR_VAL), 'CheckTrue::LastWrittenLine.Contains(STR_VAL)');
CheckTrue(FOutput.LastWrittenLine.Contains(INT_VAL.ToString), 'CheckTrue::LastWrittenLine.Contains(INT_VAL)');
end;
procedure TestTLogger.TestWarningFmt;
const
FMT_MSG = 'Message with string arg "%s" and integer arg "%d".';
STR_VAL = String('<TestWarningFmt>');
INT_VAL = Integer(777);
begin
SUT.SeverityThreshold := SEVERITY_WARNING;
SUT.WarningFmt(FMT_MSG, [STR_VAL, INT_VAL]);
CheckEquals(1, FOutput.WrittenLinesCount, 'WrittenLinesCount = 1');
CheckTrue(FOutput.LastWrittenLine.Contains(STR_VAL), 'CheckTrue::LastWrittenLine.Contains(STR_VAL)');
CheckTrue(FOutput.LastWrittenLine.Contains(INT_VAL.ToString), 'CheckTrue::LastWrittenLine.Contains(INT_VAL)');
end;
procedure TestTLogger.TestWarningVal;
const
STR_VAL = String('<TestWarningVal>');
INT_VAL = Integer(777);
begin
SUT.SeverityThreshold := SEVERITY_WARNING;
SUT.WarningVal([STR_VAL, INT_VAL, Self]);
CheckEquals(1, FOutput.WrittenLinesCount, 'WrittenLinesCount = 1');
CheckTrue(FOutput.LastWrittenLine.Contains(STR_VAL), 'CheckTrue::LastWrittenLine.Contains(STR_VAL)');
CheckTrue(FOutput.LastWrittenLine.Contains(INT_VAL.ToString), 'CheckTrue::LastWrittenLine.Contains(INT_VAL)');
CheckTrue(FOutput.LastWrittenLine.Contains(Self.ToString), 'CheckTrue::LastWrittenLine.Contains(Self)');
end;
procedure TestTLogger.TestError;
var
Msg: string;
begin
Msg := 'TestError';
SUT.SeverityThreshold := SEVERITY_ERROR;
SUT.Error(Msg);
CheckEquals(1, FOutput.WrittenLinesCount, 'WrittenLinesCount = 1');
CheckTrue(FOutput.LastWrittenLine.Contains(Msg), 'CheckTrue::LastWrittenLine.Contains(Msg)');
end;
procedure TestTLogger.TestError1;
const
STR_VAL = String('<TestError1>');
INT_VAL = Integer(777);
begin
SUT.SeverityThreshold := SEVERITY_ERROR;
SUT.Error([STR_VAL, INT_VAL]);
CheckEquals(1, FOutput.WrittenLinesCount, 'WrittenLinesCount = 1');
CheckTrue(FOutput.LastWrittenLine.Contains(STR_VAL), 'CheckTrue::LastWrittenLine.Contains(STR_VAL)');
CheckTrue(FOutput.LastWrittenLine.Contains(INT_VAL.ToString), 'CheckTrue::LastWrittenLine.Contains(INT_VAL)');
end;
procedure TestTLogger.TestErrorFmt;
const
FMT_MSG = 'Message with string arg "%s" and integer arg "%d".';
STR_VAL = String('<TestErrorFmt>');
INT_VAL = Integer(777);
begin
SUT.SeverityThreshold := SEVERITY_ERROR;
SUT.ErrorFmt(FMT_MSG, [STR_VAL, INT_VAL]);
CheckEquals(1, FOutput.WrittenLinesCount, 'WrittenLinesCount = 1');
CheckTrue(FOutput.LastWrittenLine.Contains(STR_VAL), 'CheckTrue::LastWrittenLine.Contains(STR_VAL)');
CheckTrue(FOutput.LastWrittenLine.Contains(INT_VAL.ToString), 'CheckTrue::LastWrittenLine.Contains(INT_VAL)');
end;
procedure TestTLogger.TestErrorVal;
const
STR_VAL = String('<TestErrorVal>');
INT_VAL = Integer(777);
begin
SUT.SeverityThreshold := SEVERITY_ERROR;
SUT.ErrorVal([STR_VAL, INT_VAL, Self]);
CheckEquals(1, FOutput.WrittenLinesCount, 'WrittenLinesCount = 1');
CheckTrue(FOutput.LastWrittenLine.Contains(STR_VAL), 'CheckTrue::LastWrittenLine.Contains(STR_VAL)');
CheckTrue(FOutput.LastWrittenLine.Contains(INT_VAL.ToString), 'CheckTrue::LastWrittenLine.Contains(INT_VAL)');
CheckTrue(FOutput.LastWrittenLine.Contains(Self.ToString), 'CheckTrue::LastWrittenLine.Contains(Self)');
end;
procedure TestTLogger.TestFatal;
var
Msg: string;
begin
Msg := 'TestFatal';
SUT.SeverityThreshold := SEVERITY_FATAL;
SUT.Fatal(Msg);
CheckEquals(1, FOutput.WrittenLinesCount, 'WrittenLinesCount = 1');
CheckTrue(FOutput.LastWrittenLine.Contains(Msg), 'CheckTrue::LastWrittenLine.Contains(Msg)');
end;
procedure TestTLogger.TestFatal1;
const
STR_VAL = String('<TestFatal1>');
INT_VAL = Integer(777);
begin
SUT.SeverityThreshold := SEVERITY_FATAL;
SUT.Fatal([STR_VAL, INT_VAL]);
CheckEquals(1, FOutput.WrittenLinesCount, 'WrittenLinesCount = 1');
CheckTrue(FOutput.LastWrittenLine.Contains(STR_VAL), 'CheckTrue::LastWrittenLine.Contains(STR_VAL)');
CheckTrue(FOutput.LastWrittenLine.Contains(INT_VAL.ToString), 'CheckTrue::LastWrittenLine.Contains(INT_VAL)');
end;
procedure TestTLogger.TestFatalFmt;
const
FMT_MSG = 'Message with string arg "%s" and integer arg "%d".';
STR_VAL = String('<TestFatalFmt>');
INT_VAL = Integer(777);
begin
SUT.SeverityThreshold := SEVERITY_FATAL;
SUT.FatalFmt(FMT_MSG, [STR_VAL, INT_VAL]);
CheckEquals(1, FOutput.WrittenLinesCount, 'WrittenLinesCount = 1');
CheckTrue(FOutput.LastWrittenLine.Contains(STR_VAL), 'CheckTrue::LastWrittenLine.Contains(STR_VAL)');
CheckTrue(FOutput.LastWrittenLine.Contains(INT_VAL.ToString), 'CheckTrue::LastWrittenLine.Contains(INT_VAL)');
end;
procedure TestTLogger.TestFatalVal;
const
STR_VAL = String('<TestFatalVal>');
INT_VAL = Integer(777);
begin
SUT.SeverityThreshold := SEVERITY_FATAL;
SUT.Fatal([STR_VAL, INT_VAL, Self]);
CheckEquals(1, FOutput.WrittenLinesCount, 'WrittenLinesCount = 1');
CheckTrue(FOutput.LastWrittenLine.Contains(STR_VAL), 'CheckTrue::LastWrittenLine.Contains(STR_VAL)');
CheckTrue(FOutput.LastWrittenLine.Contains(INT_VAL.ToString), 'CheckTrue::LastWrittenLine.Contains(INT_VAL)');
CheckTrue(FOutput.LastWrittenLine.Contains(Self.ToString), 'CheckTrue::LastWrittenLine.Contains(Self)');
end;
{ TestTMetaLogger }
procedure TestTMetaLogger.CheckWasOutput(ExpectedLinesCount : Integer);
begin
CheckEquals(ExpectedLinesCount, FOutput.WrittenLinesCount, 'WrittenLinesCount = ExpectedLinesCount');
end;
procedure TestTMetaLogger.DoSetUp;
var
Logger : ILogger;
begin
FOutput := TTestTextOutput.Create;
Logger := SUT.AddLogger(TLogger.Create);
Logger.AddOutput(FOutput);
Logger.AllowedItems := [liMessage, liSection, liMethod];
end;
procedure TestTMetaLogger.DoTearDown;
begin
FOutput := nil;
end;
function TestTMetaLogger.MakeSUT : IMetaLogger;
begin
Result := TMetaLogger.Create;
end;
procedure TestTMetaLogger.TestDebug;
begin
SUT.Debug('');
CheckWasOutput;
end;
procedure TestTMetaLogger.TestDebug1;
begin
SUT.Debug([]);
CheckWasOutput;
end;
procedure TestTMetaLogger.TestDebugFmt;
begin
SUT.DebugFmt('', []);
CheckWasOutput;
end;
procedure TestTMetaLogger.TestDebugVal;
begin
SUT.DebugVal([]);
CheckWasOutput;
end;
procedure TestTMetaLogger.TestEnabled;
var
LocalSUT : IMetaLogger;
begin
CheckTrue(SUT.Enabled, 'CheckTrue::SUT.Enabled');
LocalSUT := TMetaLogger.Create;
CheckFalse(LocalSUT.Enabled, 'CheckFalse::LocalSUT.Enabled');
end;
procedure TestTMetaLogger.TestEnterMethod;
begin
SUT.EnterMethod(TMethodHolderObj, @TMethodHolderObj.ProcMethod, []);
CheckWasOutput;
end;
procedure TestTMetaLogger.TestEnterMethod1;
begin
SUT.EnterMethod(TypeInfo(TMethodHolderRec), @TMethodHolderRec.ProcMethod, []);
CheckWasOutput;
end;
procedure TestTMetaLogger.TestEnterSection;
begin
SUT.EnterSection('');
CheckWasOutput;
end;
procedure TestTMetaLogger.TestEnterSection1;
begin
SUT.EnterSection([]);
CheckWasOutput;
end;
procedure TestTMetaLogger.TestEnterSectionFmt;
begin
SUT.EnterSectionFmt('', []);
CheckWasOutput;
end;
procedure TestTMetaLogger.TestEnterSectionVal;
begin
SUT.EnterSectionVal([]);
CheckWasOutput;
end;
procedure TestTMetaLogger.TestError;
begin
SUT.Error('');
CheckWasOutput;
end;
procedure TestTMetaLogger.TestError1;
begin
SUT.Error([]);
CheckWasOutput;
end;
procedure TestTMetaLogger.TestErrorFmt;
begin
SUT.ErrorFmt('', []);
CheckWasOutput;
end;
procedure TestTMetaLogger.TestErrorVal;
begin
SUT.ErrorVal([]);
CheckWasOutput;
end;
procedure TestTMetaLogger.TestFatal;
begin
SUT.Fatal('');
CheckWasOutput;
end;
procedure TestTMetaLogger.TestFatal1;
begin
SUT.Fatal([]);
CheckWasOutput;
end;
procedure TestTMetaLogger.TestFatalFmt;
begin
SUT.FatalFmt('', []);
CheckWasOutput;
end;
procedure TestTMetaLogger.TestFatalVal;
begin
SUT.FatalVal([]);
CheckWasOutput;
end;
procedure TestTMetaLogger.TestInfo;
begin
SUT.Info('');
CheckWasOutput;
end;
procedure TestTMetaLogger.TestInfo1;
begin
SUT.Info([]);
CheckWasOutput;
end;
procedure TestTMetaLogger.TestInfoFmt;
begin
SUT.InfoFmt('', []);
CheckWasOutput;
end;
procedure TestTMetaLogger.TestInfoVal;
begin
SUT.InfoVal([]);
CheckWasOutput;
end;
procedure TestTMetaLogger.TestLeaveMethod;
begin
SUT.EnterMethod(TMethodHolderObj, @TMethodHolderObj.ProcMethod, []);
SUT.LeaveMethod(TMethodHolderObj, @TMethodHolderObj.ProcMethod, TValue.Empty);
CheckWasOutput(2);
end;
procedure TestTMetaLogger.TestLeaveMethod1;
begin
SUT.EnterMethod(TypeInfo(TMethodHolderRec), @TMethodHolderRec.ProcMethod, []);
SUT.LeaveMethod(TypeInfo(TMethodHolderRec), @TMethodHolderRec.ProcMethod, TValue.Empty);
CheckWasOutput(2);
end;
procedure TestTMetaLogger.TestLeaveMethod2;
begin
SUT.EnterMethod(TMethodHolderObj, @TMethodHolderObj.ProcMethod, []);
SUT.LeaveMethod(TMethodHolderObj, @TMethodHolderObj.ProcMethod);
CheckWasOutput(2);
end;
procedure TestTMetaLogger.TestLeaveMethod3;
begin
SUT.EnterMethod(TypeInfo(TMethodHolderRec), @TMethodHolderRec.ProcMethod, []);
SUT.LeaveMethod(TypeInfo(TMethodHolderRec), @TMethodHolderRec.ProcMethod);
CheckWasOutput(2);
end;
procedure TestTMetaLogger.TestLeaveSection;
begin
SUT.EnterSection('');
SUT.LeaveSection('');
CheckWasOutput(2);
end;
procedure TestTMetaLogger.TestLeaveSection1;
begin
SUT.EnterSection([]);
SUT.LeaveSection([]);
CheckWasOutput(2);
end;
procedure TestTMetaLogger.TestLeaveSectionFmt;
begin
SUT.EnterSectionFmt('', []);
SUT.LeaveSectionFmt('', []);
CheckWasOutput(2);
end;
procedure TestTMetaLogger.TestLeaveSectionVal;
begin
SUT.EnterSectionVal([]);
SUT.LeaveSectionVal([]);
CheckWasOutput(2);
end;
procedure TestTMetaLogger.TestLog;
begin
SUT.Log(SEVERITY_MAX, '');
CheckWasOutput;
end;
procedure TestTMetaLogger.TestLog1;
begin
SUT.Log(SEVERITY_MAX, []);
CheckWasOutput;
end;
procedure TestTMetaLogger.TestLogFmt;
begin
SUT.LogFmt(SEVERITY_MAX, '', []);
CheckWasOutput;
end;
procedure TestTMetaLogger.TestLogVal;
begin
SUT.LogVal(SEVERITY_MAX, []);
CheckWasOutput;
end;
procedure TestTMetaLogger.TestWarning;
begin
SUT.Warning('');
CheckWasOutput;
end;
procedure TestTMetaLogger.TestWarning1;
begin
SUT.Warning([]);
CheckWasOutput;
end;
procedure TestTMetaLogger.TestWarningFmt;
begin
SUT.WarningFmt('', []);
CheckWasOutput;
end;
procedure TestTMetaLogger.TestWarningVal;
begin
SUT.WarningVal([]);
CheckWasOutput;
end;
{ TestTPlainTextOutput }
function TestTPlainTextOutput.MakeSUT : ILogOutput;
begin
Result := TTestTextOutput.Create;
end;
procedure TestTPlainTextOutput.TestBeginSection;
var
Msg : String;
Instant : TLogTimestamp;
procedure RunLocalChecks;
begin
CheckTrue(SUTAsClass<TTestTextOutput>.LastWrittenLine.Contains(RSPTOMainThreadName),
'CheckTrue::LastWrittenLine.Contains(%s)', [RSPTOMainThreadName]);
CheckTrue(SUTAsClass<TTestTextOutput>.LastWrittenLine.Contains(RSPTOSectionBeginningPrefix),
'CheckTrue::LastWrittenLine.Contains(%s)', [RSPTOSectionBeginningPrefix]);
CheckTrue(SUTAsClass<TTestTextOutput>.LastWrittenLine.Contains(Msg),
'CheckTrue::LastWrittenLine.Contains(%s)', [Msg]);
CheckTrue(SUTAsClass<TTestTextOutput>.LastWrittenLine.Contains(DateTimeToStr(Instant)),
'CheckTrue::LastWrittenLine.Contains(%s)', [DateTimeToStr(Instant)]);
end;
begin
CheckEquals(0, SUTAsClass<TTestTextOutput>.SectionLevel, 'SectionLevel = 0');
CheckEquals(0, SUTAsClass<TTestTextOutput>.WrittenLinesCount, 'WrittenLinesCount = 0');
CheckTrue(SUTAsClass<TTestTextOutput>.LastWrittenLine.IsEmpty, 'CheckTrue::LastWrittenLine.IsEmpty');
Msg := 'BeginSection1';
Instant := Now;
SUT.SeverityThreshold := SEVERITY_NONE;
SUT.BeginSection(Instant, Msg);
CheckEquals(1, SUTAsClass<TTestTextOutput>.SectionLevel, 'SectionLevel = 1');
RunLocalChecks;
Msg := 'BeginSection2';
Instant := Now;
SUT.SeverityThreshold := SEVERITY_MIN;
SUT.BeginSection(Instant, Msg);
CheckEquals(2, SUTAsClass<TTestTextOutput>.SectionLevel, 'SectionLevel = 2');
RunLocalChecks;
Msg := 'BeginSection3';
Instant := Now;
SUT.SeverityThreshold := SEVERITY_MAX;
SUT.BeginSection(Instant, Msg);
CheckEquals(3, SUTAsClass<TTestTextOutput>.SectionLevel, 'SectionLevel = 3');
RunLocalChecks;
CheckEquals(3, SUTAsClass<TTestTextOutput>.WrittenLinesCount, 'WrittenLinesCount = 3');
end;
procedure TestTPlainTextOutput.TestEndSection;
var
Msg : String;
Instant : TLogTimestamp;
procedure RunLocalChecks;
begin
CheckTrue(SUTAsClass<TTestTextOutput>.LastWrittenLine.Contains(RSPTOMainThreadName),
'CheckTrue::LastWrittenLine.Contains(%s)', [RSPTOMainThreadName]);
CheckTrue(SUTAsClass<TTestTextOutput>.LastWrittenLine.Contains(RSPTOSectionEndingPrefix),
'CheckTrue::LastWrittenLine.Contains(%s)', [RSPTOSectionEndingPrefix]);
CheckTrue(SUTAsClass<TTestTextOutput>.LastWrittenLine.Contains(Msg),
'CheckTrue::LastWrittenLine.Contains(%s)', [Msg]);
CheckTrue(SUTAsClass<TTestTextOutput>.LastWrittenLine.Contains(DateTimeToStr(Instant)),
'CheckTrue::LastWrittenLine.Contains(%s)', [DateTimeToStr(Instant)]);
end;
begin
SUT.BeginSection(Now, 'BeginSection1');
SUT.BeginSection(Now, 'BeginSection2');
SUT.BeginSection(Now, 'BeginSection3');
Assert(SUTAsClass<TTestTextOutput>.SectionLevel = 3, 'SectionLevel <> 3');
Assert(SUTAsClass<TTestTextOutput>.WrittenLinesCount = 3, 'WrittenLinesCount <> 3');
Msg := 'EndSection3';
Instant := Now;
SUT.SeverityThreshold := SEVERITY_MAX;
SUT.EndSection(Instant, Msg);
CheckEquals(2, SUTAsClass<TTestTextOutput>.SectionLevel, 'SectionLevel = 2');
RunLocalChecks;
Msg := 'EndSection2';
Instant := Now;
SUT.SeverityThreshold := SEVERITY_MIN;
SUT.EndSection(Instant, Msg);
CheckEquals(1, SUTAsClass<TTestTextOutput>.SectionLevel, 'SectionLevel = 1');
RunLocalChecks;
Msg := 'EndSection1';
Instant := Now;
SUT.SeverityThreshold := SEVERITY_NONE;
SUT.EndSection(Instant, Msg);
CheckEquals(0, SUTAsClass<TTestTextOutput>.SectionLevel, 'SectionLevel = 0');
RunLocalChecks;
CheckEquals(6, SUTAsClass<TTestTextOutput>.WrittenLinesCount, 'WrittenLinesCount = 6');
end;
procedure TestTPlainTextOutput.TestWriteMessage;
var
Msg : String;
Severity : TLogMsgSeverity;
Instant : TLogTimestamp;
procedure RunLocalChecks;
begin
CheckTrue(SUTAsClass<TTestTextOutput>.LastWrittenLine.Contains(RSPTOMainThreadName),
'CheckTrue::LastWrittenLine.Contains(%s)', [RSPTOMainThreadName]);
CheckTrue(SUTAsClass<TTestTextOutput>.LastWrittenLine.Contains(Msg),
'CheckTrue::LastWrittenLine.Contains(%s)', [Msg]);
CheckTrue((Severity in [SEVERITY_NONE, SEVERITY_MIN]) or
SUTAsClass<TTestTextOutput>.LastWrittenLine.Contains(
SUTAsClass<TTestTextOutput>.GetSeverityDescriptions[InferLogMsgType(Severity)]),
'CheckTrue::LastWrittenLine.Contains(<SeverityDesc>)');
CheckTrue(SUTAsClass<TTestTextOutput>.LastWrittenLine.Contains(DateTimeToStr(Instant)),
'CheckTrue::LastWrittenLine.Contains(%s)', [DateTimeToStr(Instant)]);
case InferLogMsgType(Severity) of
lmNone:
begin {NOP} end;
lmDebug:
CheckTrue(SUTAsClass<TTestTextOutput>.LastWrittenLine.Contains(RSPTOMsgTypeDescDebug),
'CheckTrue::LastWrittenLine.Contains(%s)', [RSPTOMsgTypeDescDebug]);
lmInfo:
CheckTrue(SUTAsClass<TTestTextOutput>.LastWrittenLine.Contains(RSPTOMsgTypeDescInfo),
'CheckTrue::LastWrittenLine.Contains(%s)', [RSPTOMsgTypeDescInfo]);
lmWarning:
CheckTrue(SUTAsClass<TTestTextOutput>.LastWrittenLine.Contains(RSPTOMsgTypeDescWarning),
'CheckTrue::LastWrittenLine.Contains(%s)', [RSPTOMsgTypeDescWarning]);
lmError:
CheckTrue(SUTAsClass<TTestTextOutput>.LastWrittenLine.Contains(RSPTOMsgTypeDescError),
'CheckTrue::LastWrittenLine.Contains(%s)', [RSPTOMsgTypeDescError]);
lmFatal:
CheckTrue(SUTAsClass<TTestTextOutput>.LastWrittenLine.Contains(RSPTOMsgTypeDescFatal),
'CheckTrue::LastWrittenLine.Contains(%s)', [RSPTOMsgTypeDescFatal]);
lmExtreme:
CheckTrue(SUTAsClass<TTestTextOutput>.LastWrittenLine.Contains(RSPTOMsgTypeDescExtreme),
'CheckTrue::LastWrittenLine.Contains(%s)', [RSPTOMsgTypeDescExtreme]);
else
Fail('Unhandled log message type.');
end;
end;
begin
{ Case #1 }
Msg := 'Message1';
Instant := Now;
Severity := SUT.SeverityThreshold;
SUT.WriteMessage(Instant, Severity, Msg);
CheckEquals(1, SUTAsClass<TTestTextOutput>.WrittenLinesCount, '(WrittenLinesCount = 1)::<Case #1>');
RunLocalChecks;
{ Case #2 }
Msg := 'Message2';
Instant := Now;
Severity := SEVERITY_NONE;
SUT.WriteMessage(Instant, Severity, Msg);
CheckEquals(1, SUTAsClass<TTestTextOutput>.WrittenLinesCount, '(WrittenLinesCount = 1)::<Case #2>');
{ Case #3 }
Msg := 'Message3';
Instant := Now;
Severity := SEVERITY_MAX;
SUT.SeverityThreshold := SEVERITY_NONE;
SUT.WriteMessage(Instant, Severity, Msg);
CheckEquals(1, SUTAsClass<TTestTextOutput>.WrittenLinesCount, '(WrittenLinesCount = 1)::<Case #3>');
{ Case #4 }
Msg := 'Message4';
Instant := Now;
SUT.SeverityThreshold := SEVERITY_MAX;
Severity := Pred(SUT.SeverityThreshold);
SUT.WriteMessage(Instant, Severity, Msg);
CheckEquals(1, SUTAsClass<TTestTextOutput>.WrittenLinesCount, '(WrittenLinesCount = 1)::<Case #4>');
{ Case #5 }
Msg := 'Message5';
Instant := Now;
Severity := SEVERITY_DEBUG;
SUT.SeverityThreshold := SEVERITY_MIN;
SUT.WriteMessage(Instant, Severity, Msg);
CheckEquals(2, SUTAsClass<TTestTextOutput>.WrittenLinesCount, '(WrittenLinesCount = 2)::<Case #5>');
RunLocalChecks;
{ Case #6 }
Msg := 'Message6';
Instant := Now;
Severity := SEVERITY_INFO;
SUT.SeverityThreshold := SEVERITY_MIN;
SUT.WriteMessage(Instant, Severity, Msg);
CheckEquals(3, SUTAsClass<TTestTextOutput>.WrittenLinesCount, '(WrittenLinesCount = 3)::<Case #6>');
RunLocalChecks;
{ Case #7 }
Msg := 'Message7';
Instant := Now;
Severity := SEVERITY_WARNING;
SUT.SeverityThreshold := SEVERITY_MIN;
SUT.WriteMessage(Instant, Severity, Msg);
CheckEquals(4, SUTAsClass<TTestTextOutput>.WrittenLinesCount, '(WrittenLinesCount = 4)::<Case #7>');
RunLocalChecks;
{ Case #8 }
Msg := 'Message8';
Instant := Now;
Severity := SEVERITY_ERROR;
SUT.SeverityThreshold := SEVERITY_MIN;
SUT.WriteMessage(Instant, Severity, Msg);
CheckEquals(5, SUTAsClass<TTestTextOutput>.WrittenLinesCount, '(WrittenLinesCount = 5)::<Case #8>');
RunLocalChecks;
{ Case #9 }
Msg := 'Message9';
Instant := Now;
Severity := SEVERITY_FATAL;
SUT.SeverityThreshold := SEVERITY_MIN;
SUT.WriteMessage(Instant, Severity, Msg);
CheckEquals(6, SUTAsClass<TTestTextOutput>.WrittenLinesCount, '(WrittenLinesCount = 6)::<Case #9>');
RunLocalChecks;
{ Case #10 }
Msg := 'Message10';
Instant := Now;
Severity := SEVERITY_MAX;
SUT.SeverityThreshold := SEVERITY_MIN;
SUT.WriteMessage(Instant, Severity, Msg);
CheckEquals(7, SUTAsClass<TTestTextOutput>.WrittenLinesCount, '(WrittenLinesCount = 7)::<Case #10>');
RunLocalChecks;
{ Case #11 }
Msg := 'Message11_Line1' + sLineBreak +
'Message11_Line2' + sLineBreak + sLineBreak +
'Message11_Line3' + sLineBreak + sLineBreak + sLineBreak;
Instant := Now;
Severity := SEVERITY_MIN;
SUT.SeverityThreshold := SEVERITY_MIN;
SUT.WriteMessage(Instant, Severity, Msg);
CheckEquals(8, SUTAsClass<TTestTextOutput>.WrittenLinesCount, '(WrittenLinesCount = 8)::<Case #11>');
CheckEquals(LinesCount(Msg), LinesCount(SUTAsClass<TTestTextOutput>.LastWrittenLine),
'LinesCount(LastWrittenLine) = LinesCount(Msg)::<Case #11.1>');
Msg := Msg + 'Message11_Line4';
SUT.WriteMessage(Instant, Severity, Msg);
CheckEquals(LinesCount(Msg), LinesCount(SUTAsClass<TTestTextOutput>.LastWrittenLine),
'LinesCount(LastWrittenLine) = LinesCount(Msg)::<Case #11.2>');
end;
initialization
// Register any test cases with the test runner
RegisterTest(TestTLogger.Suite);
RegisterTest(TestTMetaLogger.Suite);
RegisterTest(TestTPlainTextOutput.Suite);
end.
|
{$mode objfpc}{$H+}{$J-}
program Problem_3;
var
length : Real;
width : Real;
height : Real;
begin
writeln('The volume is calculated as V = length * width * height.');
end. |
{ ---------------------------------------------------------------------------- }
{ Delphi Implementation of AISParser Library }
{ Copyright 2006 by Brian C. Lane <bcl@brianlane.com> }
{ All Rights Reserved }
{ }
{ Delphi conversion by: Chris Krohn <ckrohn@caymanport.com> }
{ }
{ }
{ AIVDM/AIVDO AIS Message Parser }
{ <center>Copyright 2006 by Brian C. Lane <bcl@brianlane.com><br> }
{ http://www.aisparser.com/ }
{ }
{ The Automatic Identification System (AIS) allows ships to be tracked in }
{ realtime based on information transmitted by each ship. They are equipped }
{ with either a Class A or Class B AIS transponder which includes a GPS }
{ for accurate position and speed reporting. AIS receivers decode the }
{ transmitted information and output the data as AIVDM messages. }
{ }
{ The structure of the AIVDM message is described in IEC 61993-2 and it is }
{ a variation of the NMEA 0183 sentence format that includes the raw data }
{ encoded in a 6-bit format. A Message 1 example looks like this: }
{ }
{ \code }
{ !AIVDM,1,1,,B,19NS7Sp02wo?HETKA2K6mUM20<L=,0*27 }
{ \endcode }
{ }
{ The meaning of each data element in the AIS messages is covered by the }
{ ITU M.1371 and IEC 62287 documents. These documents are available from }
{ the websites of these organizations: }
{ - http://www.itu.int }
{ - http://www.iec.ch }
{ - http://www.navcenter.org/marcomms/IEC/ }
{ }
{ To fully understand the data produced by this library you should read }
{ the above documents. }
{ }
{ This library allows you to write programs that accept ASCII AIVDM or }
{ AIVDO messages and parse their packed 6-bit data into structures }
{ containging the message data. The general flow of a typical aisparser }
{ program would look like this: }
{ }
{ - Receive ASCII data (via serial port, file or network socket) }
{ - Pass the data to assemble_vdm() to reassemble multipart messages and }
{ extract their 6-bit data. }
{ - Fetch the first 6 bits from the data stream, this is the message id }
{ and determines which parser function to call and what structure }
{ to store the results in. }
{ - Call the appropriate parse_ais_XX function with aismsg_XX structure }
{ passed to it. }
{ - Act on the message data: display a position, ship name, etc. }
{ }
{ This library is thread safe, all variables used are contained in the }
{ ais_state structure. To support multiple data streams all you need to }
{ do is used 2 different instances of ais_state. }
{ }
{ To get started you should read the documentation on the vdm_parse.c }
{ module and look at the example code in the example directory of the }
{ source distribution. }
{ }
{ ---------------------------------------------------------------------------- }
Unit AISParser;
Interface
Uses Windows, Classes, SysUtils, StrUtils, Dialogs;
Const
MAX_NMEA_LENGTH = 255;
MAX_NMEA_FIELDS = 50;
NMEA_START = 0;
NMEA_END = 1;
NMEA_DONE = 2;
SIXBIT_LEN = 255;
SIXBUF_LEN = 255;
pow2_mask: Array[0..6] Of Byte = ($00, $01, $03, $07, $0F, $1F, $3F);
Type
{ NMEA parser state structure }
TNMEA_State = Record
search: Byte; //!< State of the search: START, END or DONE
field: Array[0..MAX_NMEA_FIELDS-1] of PChar; //!< Pointers to fields in the buffer
str: Array[0..MAX_NMEA_LENGTH-1] of Char; //!< Incoming NMEA 0183 string
str_len: LongInt; //!< Number of bytes in str
end {nmea_state};
{ sixbit state }
{ The size of bits is enough to handle a little over 5 slots of data }
{ ((5* 256) / 6) = 214 }
TSixBit = Record
bits: Array[0..SIXBIT_LEN-1] of Char; //!< raw 6-bit ASCII data string
p: PChar; //!< pointer to current character in bits
remainder: Byte; //!< Remainder bits
remainder_bits: Byte; //!< Number of remainder bits
end {sixbit};
{ AIS Message 1 - Position Report with SOTDMA }
TAISMsg_1 = Record
msgid: SmallInt; //!< 6 bits : Message ID (1)
isrepeat: SmallInt; //!< 2 bits : Repeated
userid: LongInt; //!< 30 bits : UserID / MMSI
nav_status: SmallInt; //!< 4 bits : Navigational Status
rot: Byte; //!< 8 bits : Rate of Turn
sog: Integer; //!< 10 bits : Speed Over Ground
pos_acc: SmallInt; //!< 1 bit : Position Accuracy
longitude: LongInt; //!< 28 bits : Longitude in 1/10000 minute
latitude: LongInt; //!< 27 bits : Latitude in 1/10000 minute
cog: Integer; //!< 12 bits : Course over Ground
true: Integer; //!< 9 bits : True heading
utc_sec: SmallInt; //!< 6 bits : UTC Seconds
regional: SmallInt; //!< 4 bits : Regional bits
spare: SmallInt; //!< 1 bit : Spare
raim: SmallInt; //!< 1 bit : RAIM flag
sync_state: SmallInt; //!< 2 bits : SOTDMA sync state
slot_timeout: SmallInt; //!< 3 bits : SOTDMA Slot Timeout
sub_message: Integer; //!< 14 bits : SOTDMA sub-message
end {aismsg_1};
{ AIS Message 2 - Position Report with SOTDMA }
TAISMsg_2 = Record
msgid: SmallInt; //!< 6 bits : Message ID (2)
isrepeat: SmallInt; //!< 2 bits : Repeated
userid: LongInt; //!< 30 bits : UserID / MMSI
nav_status: SmallInt; //!< 4 bits : Navigational Status
rot: Byte; //!< 8 bits : Rate of Turn
sog: Integer; //!< 10 bits : Speed Over ground
pos_acc: SmallInt; //!< 1 bit : Position Accuracy
longitude: LongInt; //!< 28 bits : Longitude in 1/10000 minute
latitude: LongInt; //!< 27 bits : Latitude in 1/10000 minute
cog: Integer; //!< 12 bits : Course over Ground
true: Integer; //!< 9 bits : True Heading
utc_sec: SmallInt; //!< 6 bits : UTC Seconds
regional: SmallInt; //!< 4 bits : Regional bits
spare: SmallInt; //!< 1 bit : Spare
raim: SmallInt; //!< 1 bit : RAIM flag
sync_state: SmallInt; //!< 2 bits : SOTDMA sync state
slot_timeout: SmallInt; //!< 3 bits : SOTDMA Slot Timeout
sub_message: Integer; //!< 14 bits : SOTDMA sub-message
end {aismsg_2};
{ AIS Message 3 - Position Report with ITDMA }
TAISMsg_3 = Record
msgid: SmallInt; //!< 6 bits : MessageID (3)
isrepeat: SmallInt; //!< 2 bits : Repeated
userid: LongInt; //!< 30 bits : UserID / MMSI
nav_status: SmallInt; //!< 4 bits : Navigational Status
rot: Byte; //!< 8 bits : Rate of Turn
sog: Integer; //!< 10 bits : Speed Over Ground
pos_acc: SmallInt; //!< 1 bit : Position Accuracy
longitude: LongInt; //!< 28 bits : Longitude in 1/10000 minute
latitude: LongInt; //!< 27 bits : Latitude in 1/10000 minute
cog: Integer; //!< 12 bits : Course over Ground
true: Integer; //!< 9 bits : True Heading
utc_sec: SmallInt; //!< 6 bits : UTC Seconds
regional: SmallInt; //!< 4 bits : Regional bits
spare: SmallInt; //!< 1 bit : Spare
raim: SmallInt; //!< 1 bit : RAIM Flag
sync_state: SmallInt; //!< 2 bits : ITDMA sync state
slot_increment: Integer; //!< 13 bits : ITDMA Slot Increment
num_slots: SmallInt; //!< 3 bits : ITDMA Number of Slots
keep: SmallInt; //!< 1 bit : ITDMA Keep Flag
end {aismsg_3};
{ AIS Message 4 - Base Station Report }
TAISMsg_4 = Record
msgid: SmallInt; //!< 6 bits : MessageID (4)
isrepeat: SmallInt; //!< 2 bits : Repeated
userid: LongInt; //!< 30 bits : UserID / MMSI
utc_year: Integer; //!< 14 bits : UTC Year
utc_month: SmallInt; //!< 4 bits : UTC Month
utc_day: SmallInt; //!< 5 bits : UTC Day
utc_hour: SmallInt; //!< 5 bits : UTC Hour
utc_minute: SmallInt; //!< 6 bits : UTC Minute
utc_second: SmallInt; //!< 6 bits : UTC Second
pos_acc: SmallInt; //!< 1 bit : Position Accuracy
longitude: LongInt; //!< 28 bits : Longitude in 1/10000 minute
latitude: LongInt; //!< 27 bits : Latitude in 1/10000 minute
pos_type: SmallInt; //!< 4 bits : Type of position fixing device
spare: Integer; //!< 10 bits : Spare
raim: SmallInt; //!< 1 bit : RAIM flag
sync_state: SmallInt; //!< 2 bits : SOTDMA sync state
slot_timeout: SmallInt; //!< 3 bits : SOTDMA Slot Timeout
sub_message: Integer; //!< 14 bits : SOTDMA sub-message
end {aismsg_4};
{ AIS Message 5 - Ship static and voyage related data }
TAISMsg_5 = Record
msgid: SmallInt; //!< 6 bits : MessageID (5)
isrepeat: SmallInt; //!< 2 bits : Repeated
userid: LongInt; //!< 30 bits : UserID / MMSI
version: SmallInt; //!< 2 bits : AIS Version
imo: LongInt; //!< 30 bits : IMO Number
callsign: Array[0..7] of Char; //!< 7x6 (42) bits : Callsign
name: Array[0..20] of Char; //!< 20x6 (120) bits : Ship Name
ship_type: Byte; //!< 8 bits : Type of Ship and Cargo
dim_bow: Integer; //!< 9 bits : GPS Ant. Distance from Bow
dim_stern: Integer; //!< 9 bits : GPS Ant. Distance from stern
dim_port: SmallInt; //!< 6 bits : GPS Ant. Distance from port
dim_starboard: SmallInt; //!< 6 bits : GPS Ant. Distance from starboard
pos_type: SmallInt; //!< 4 bits : Type of position fixing device
eta: LongInt; //!< 20 bits : Estimated Time of Arrival MMDDHHMM
draught: Byte; //!< 8 bits : Maximum present static draught
dest: Array[0..20] of Char; //!< 6x20 (120) bits : Ship Destination
dte: SmallInt; //!< 1 bit : DTE flag
spare: SmallInt; //!< 1 bit : spare
end {aismsg_5};
{ AIS Message 6 - Addressed Binary Message }
TAISMsg_6 = Record
msgid: SmallInt; //!< 6 bits : MessageID (6)
isrepeat: SmallInt; //!< 2 bits : Repeated
userid: LongInt; //!< 30 bits : UserID / MMSI
sequence: SmallInt; //!< 2 bits : Sequence number
destination: LongInt; //!< 30 bits : Destination MMSI
retransmit: SmallInt; //!< 1 bit : Retransmit
spare: SmallInt; //!< 1 bit : Spare
app_id: Word; //!< 16 bits : Application ID
data: Array[0..154] of SmallInt; //!< 960 bits : Data payload (in 6-bit ASCII)
end {aismsg_6};
{ AIS Message 7 - Binary Acknowledge }
TAISMsg_7 = Record
msgid: SmallInt; //!< 6 bits : MessageID (7)
isrepeat: SmallInt; //!< 2 bits : Repeated
userid: LongInt; //!< 30 bits : UserID / MMSI
spare: SmallInt; //!< 2 bits : Spare
destid_1: LongInt; //!< 30 bits : Destination MMSI 1
sequence_1: SmallInt; //!< 2 bits : Sequence Number 1
destid_2: LongInt; //!< 30 bits : Destination MMSI 2
sequence_2: SmallInt; //!< 2 bits : Sequence Number 2
destid_3: LongInt; //!< 30 bits : Destination MMSI 3
sequence_3: SmallInt; //!< 2 bits : Sequence Number 3
destid_4: LongInt; //!< 30 bits : Destination MMSI 4
sequence_4: SmallInt; //!< 2 bits : Sequence Number 4
num_acks: SmallInt; //!< Number of acks
end {aismsg_7};
{ AIS Message 8 - Binary Broadcast Message }
TAISMsg_8 = Record
msgid: SmallInt; //!< 6 bits : MessageID (8)
isrepeat: SmallInt; //!< 2 bits : Repeated
userid: LongInt; //!< 30 bits : UserID / MMSI
spare: SmallInt; //!< 2 bits : Spare
app_id: Word; //!< 16 bits : Application ID
data: Array[0..160] of SmallInt; //!< 952 bits : Data payload (in 6-bit ASCII)
end {aismsg_8};
Tsotdma = Record
sync_state: SmallInt; //!< 2 bits : SOTDMA Sync State
slot_timeout: SmallInt; //!< 3 bits : SOTDMA Slot Timeout
sub_message: Integer; //!< 14 bits : SOTDMA Sub-Messsage
End {sotdma};
Titdma = Record
sync_state: SmallInt; //!< 2 bits : ITDMA Sync State
slot_inc: Integer; //!< 13 bits : ITDMA Slot Increment
num_slots: SmallInt; //!< 3 bits : ITDMA Number of Slots
keep_flag: SmallInt; //!< 1 bit : ITDMA Keep Flag
End {itdma};
{ AIS Message 9 - Standard SAR Aircraft position report }
TAISMsg_9 = Record
msgid: SmallInt; //!< 6 bits : MessageID (9)
isrepeat: SmallInt; //!< 2 bits : Repeated
userid: LongInt; //!< 30 bits : UserID / MMSI
altitude: Integer; //!< 12 bits : Altitude
sog: Integer; //!< 10 bits : Speed Over Ground
pos_acc: SmallInt; //!< 1 bit : Position Accuracy
longitude: LongInt; //!< 28 bits : Longitude in 1/10000 minute
latitude: LongInt; //!< 27 bits : Latitude in 1/10000 minute
cog: Integer; //!< 12 bits : Course Over Ground
utc_sec: SmallInt; //!< 6 bits : UTC Seconds
regional: Byte; //!< 8 bits : Regional bits
dte: SmallInt; //!< 1 bit : DTE flag
spare: SmallInt; //!< 3 bits : Spare
assigned: SmallInt; //!< 1 bit : Assigned mode flag
raim: SmallInt; //!< 1 bit : RAIM flag
comm_state: SmallInt; //!< 1 bit : Comm State Flag
sotdma: Tsotdma;
itdma: Titdma;
End {aismsg_9};
{ AIS Message 10 - UTC and Date inquiry }
TAISMsg_10 = Record
msgid: SmallInt; //!< 6 bits : MessageID (10)
isrepeat: SmallInt; //!< 2 bits : Repeated
userid: LongInt; //!< 30 bits : UserID / MMSI
spare1: SmallInt; //!< 2 bits : Spare
destination: LongInt; //!< 30 bits : Destination MMSI
spare2: SmallInt; //!< 2 bits : Spare
end {aismsg_10};
{ AIS Message 11 - UTC and Date response }
TAISMsg_11 = Record
msgid: SmallInt; //!< 6 bits : MessageID (4)
isrepeat: SmallInt; //!< 2 bits : Repeated
userid: LongInt; //!< 30 bits : UserID / MMSI
utc_year: Integer; //!< 14 bits : UTC Year
utc_month: SmallInt; //!< 4 bits : UTC Month
utc_day: SmallInt; //!< 5 bits : UTC Day
utc_hour: SmallInt; //!< 5 bits : UTC Hour
utc_minute: SmallInt; //!< 6 bits : UTC Minute
utc_second: SmallInt; //!< 6 bits : UTC Second
pos_acc: SmallInt; //!< 1 bit : Position Accuracy
longitude: LongInt; //!< 28 bits : Longitude in 1/10000 minute
latitude: LongInt; //!< 27 bits : Latitude in 1/10000 minute
pos_type: SmallInt; //!< 4 bits : Type of position fixing device
spare: Integer; //!< 10 bits : Spare
raim: SmallInt; //!< 1 bit : RAIM flag
sync_state: SmallInt; //!< 2 bits : SOTDMA sync state
slot_timeout: SmallInt; //!< 3 bits : SOTDMA Slot Timeout
sub_message: Integer; //!< 14 bits : SOTDMA sub-message
end {aismsg_11};
{ AIS Message 12 - Addressed safety related message }
TAISMsg_12 = Record
msgid: SmallInt; //!< 6 bits : MessageID (12)
isrepeat: SmallInt; //!< 2 bits : Repeated
userid: LongInt; //!< 30 bits : UserID / MMSI
sequence: SmallInt; //!< 2 bits : Sequence
destination: LongInt; //!< 30 bits : Destination MMSI
retransmit: SmallInt; //!< 1 bit : Retransmit
spare: SmallInt; //!< 1 bit : Spare
msg: Array[0..157] Of Char; //!< 936 bits : Message in ASCII
end {aismsg_12};
{ AIS Message 13 - Safety related Acknowledge }
TAISMsg_13 = Record
msgid: SmallInt; //!< 6 bits : MessageID (7)
isrepeat: SmallInt; //!< 2 bits : Repeated
userid: LongInt; //!< 30 bits : UserID / MMSI
spare: SmallInt; //!< 2 bits : Spare
destid_1: LongInt; //!< 30 bits : Destination MMSI 1
sequence_1: SmallInt; //!< 2 bits : Sequence Number 1
destid_2: LongInt; //!< 30 bits : Destination MMSI 2
sequence_2: SmallInt; //!< 2 bits : Sequence Number 2
destid_3: LongInt; //!< 30 bits : Destination MMSI 3
sequence_3: SmallInt; //!< 2 bits : Sequence Number 3
destid_4: LongInt; //!< 30 bits : Destination MMSI 4
sequence_4: SmallInt; //!< 2 bits : Sequence Number 4
num_acks: SmallInt; //!< Number of acks
end {aismsg_13};
{ AIS Message 14 - Safety related Broadcast Message }
TAISMsg_14 = Record
msgid: SmallInt; //!< 6 bits : MessageID (14)
isrepeat: SmallInt; //!< 2 bits : Repeated
userid: LongInt; //!< 30 bits : UserID / MMSI
spare: SmallInt; //!< 2 bits : Spare
msg: Array[0..163] Of Char; //!< 968 bits : Message in ASCII
end {aismsg_14};
{ AIS Message 15 - Interrogation }
TAISMsg_15 = Record
msgid: SmallInt; //!< 6 bits : MessageID (15)
isrepeat: SmallInt; //!< 2 bits : Repeated
userid: LongInt; //!< 30 bits : UserID / MMSI
spare1: SmallInt; //!< 2 bits : Spare
destid1: LongInt; //!< 30 bits : Destination MMSI 1
msgid1_1: SmallInt; //!< 6 bits : MessageID 1.1
offset1_1: Integer; //!< 12 bits : Slot Offset 1.1
spare2: SmallInt; //!< 2 bits : Spare
msgid1_2: SmallInt; //!< 6 bits : MessageID 1.2
offset1_2: Integer; //!< 12 bits : Slot Offset 1.2
spare3: SmallInt; //!< 2 bits : Spare
destid2: LongInt; //!< 30 bits : Destination MMSI 2
msgid2_1: SmallInt; //!< 6 bits : MessageID 2.1
offset2_1: Integer; //!< 12 bits : Slot Offset 2.1
spare4: SmallInt; //!< 2 bits : Spare
num_reqs: SmallInt; //!< Number of interrogation requests
end {aismsg_15};
{ AIS Message 16 - Assigned Mode Command }
TAISMsg_16 = Record
msgid: SmallInt; //!< 6 bits : MessageID (16)
isrepeat: SmallInt; //!< 2 bits : Repeated
userid: LongInt; //!< 30 bits : UserID / MMSI
spare1: SmallInt; //!< 2 bits : Spare
destid_a: LongInt; //!< 30 bits : Destination MMSI A
offset_a: Integer; //!< 12 bits : Slot Offset A
increment_a: Integer; //!< 10 bits : Increment A
destid_b: LongInt; //!< 30 bits : Destination MMSI B
offset_b: Integer; //!< 12 bits : Slot Offset B
increment_b: Integer; //!< 10 bits : Increment B
spare2: SmallInt; //!< 4 bits : Spare
num_cmds: SmallInt; //!< Number of commands received
end {aismsg_16};
{ AIS Message 17 - GNSS Binary Broadcast Message }
TAISMsg_17 = Record
msgid: SmallInt; //!< 6 bits : MessageID (17)
isrepeat: SmallInt; //!< 2 bits : Repeated
userid: LongInt; //!< 30 bits : UserID / MMSI
spare1: SmallInt; //!< 2 bits : Spare
longitude: LongInt; //!< 18 bits : Longiture in 1/1000 minute
latitude: LongInt; //!< 17 bits : Latitude in 1/1000 minute
spare2: SmallInt; //!< 5 bits : Spare
msg_type: SmallInt; //!< 6 bits : Mesage Type from M.823
station_id: Integer; //!< 10 bits : Station ID from M.823
z_count: Integer; //!< 13 bits : Z Count
seq_num: SmallInt; //!< 3 bits : Sequence Number
num_words: SmallInt; //!< 5 bits : Number of Data Words
health: SmallInt; //!< 3 bits : Reference Station Health from M.823
data: Array[0..117] Of SmallInt; //!< 0-696 bits : Data in 6-bit format
end {aismsg_17};
{ AIS Message 18 - Standard Class B CS Position Report }
{ From IEC 62287. This differs slightly from the original }
{ message, some of the regional bits were changed to flags. }
TAISMsg_18 = Record
msgid: SmallInt; //!< 6 bits : MessageID (18)
isrepeat: SmallInt; //!< 2 bits : Repeated
userid: LongInt; //!< 30 bits : UserID / MMSI
regional1: Byte; //!< 8 bits : Regional Bits
sog: Integer; //!< 10 bits : Speed Over Ground
pos_acc: SmallInt; //!< 1 bit : Position Accuracy
longitude: LongInt; //!< 28 bits : Longitude in 1/10000 minute
latitude: LongInt; //!< 27 bits : Latitude in 1/10000 minute
cog: Integer; //!< 12 bits : Course Over Ground
true: Integer; //!< 9 bits : True Heading
utc_sec: SmallInt; //!< 6 bits : UTC Seconds
regional2: SmallInt; //!< 2 bits : Regional Bits
unit_flag: SmallInt; //!< 1 bit : Class B CS Flag
display_flag: SmallInt; //!< 1 bit : Integrated msg14 Display Flag
dsc_flag: SmallInt; //!< 1 bit : DSC Capability flag
band_flag: SmallInt; //!< 1 bit : Marine Band Operation Flag
msg22_flag: SmallInt; //!< 1 bit : Msg22 Frequency Management Flag
mode_flag: SmallInt; //!< 1 bit : Autonomous Mode Flag
raim: SmallInt; //!< 1 bit : RAIM Flag
comm_state: SmallInt; //!< 1 bit : Comm State Flag
sotdma: Tsotdma;
itdma: Titdma;
End {aismsg_18};
{ AIS Message 19 - Extended Class B Equipment Position Report }
TAISMsg_19 = Record
msgid: SmallInt; //!< 6 bits : MessageID (19)
isrepeat: SmallInt; //!< 2 bits : Repeated
userid: LongInt; //!< 30 bits : UserID / MMSI
regional1: SmallInt; //!< 8 bits : Regional Bits
sog: Integer; //!< 10 bits : Speed Over Ground
pos_acc: SmallInt; //!< 1 bit : Position Accuracy
longitude: LongInt; //!< 28 bits : Longitude in 1/10000 minute
latitude: LongInt; //!< 27 bits : Latitude in 1/10000 minute
cog: Integer; //!< 12 bits : Course Over Ground
true: Integer; //!< 9 bits : True Heading
utc_sec: SmallInt; //!< 6 bits : UTC Seconds
regional2: SmallInt; //!< 4 bits : Regional Bits
name: Array[0..20] Of Char; //!< 120 bits : Ship Name in ASCII
ship_type: Byte; //!< 8 bits : Type of Ship and Cargo
dim_bow: Integer; //!< 9 bits : GPS Ant. Distance from Bow
dim_stern: Integer; //!< 9 bits : GPS Ant. Distance from Stern
dim_port: SmallInt; //!< 6 bits : GPS Ant. Distance from Port
dim_starboard: SmallInt; //!< 6 bits : GPS Ant. Distance from Starboard
pos_type: SmallInt; //!< 4 bits : Type of Position Fixing Device
raim: SmallInt; //!< 1 bit : RAIM Flag
dte: SmallInt; //!< 1 bit : DTE Flag
spare: SmallInt; //!< 5 bits : Spare
end {aismsg_19};
{ AIS Message 20 - Data Link Management }
TAISMsg_20 = Record
msgid: SmallInt; //!< 6 bits : MessageID (20)
isrepeat: SmallInt; //!< 2 bits : Repeated
userid: LongInt; //!< 30 bits : UserID / MMSI
spare1: SmallInt; //!< 2 bits : Spare
offset1: Integer; //!< 12 bits : Slot Offset 1
slots1: SmallInt; //!< 4 bits : Number of Slots 1
timeout1: SmallInt; //!< 3 bits : Timeout in Minutes 2
increment1: Integer; //!< 11 bits : Slot Increment 1
offset2: Integer; //!< 12 bits : Slot Offset 2
slots2: SmallInt; //!< 4 bits : Number of Slots 2
timeout2: SmallInt; //!< 3 bits : Timeout in Minutes 2
increment2: Integer; //!< 11 bits : Slot Increment 2
offset3: Integer; //!< 12 bits : Slot Offset 3
slots3: SmallInt; //!< 4 bits : Number of Slots 3
timeout3: SmallInt; //!< 3 bits : Timeout in Minutes 3
increment3: Integer; //!< 11 bits : Slot Increment 3
offset4: Integer; //!< 12 bits : Slot Offset 4
slots4: SmallInt; //!< 4 bits : Number of Slots 4
timeout4: SmallInt; //!< 3 bits : Timeout in Minutes 4
increment4: Integer; //!< 11 bits : Slot Increment 4
spare2: SmallInt; //!< 0-6 bits : Spare
num_cmds: SmallInt; //!< Number of commands received
end {aismsg_20};
{ AIS Message 21 - Aids-to-navigation Report }
TAISMsg_21 = Record
msgid: SmallInt; //!< 6 bits : MessageID (21)
isrepeat: SmallInt; //!< 2 bits : Repeated
userid: LongInt; //!< 30 bits : UserID / MMSI
aton_type: SmallInt; //!< 5 bits : Type of AtoN
name: Array[0..20] Of Char; //!< 120 bits : Name of AtoN in ASCII
pos_acc: SmallInt; //!< 1 bit : Position Accuracy
longitude: LongInt; //!< 28 bits : Longitude in 1/10000 minutes
latitude: LongInt; //!< 27 bits : Latitude in 1/10000 minutes
dim_bow: Integer; //!< 9 bits : GPS Ant. Distance from Bow
dim_stern: Integer; //!< 9 bits : GPS Ant. Distance from Stern
dim_port: SmallInt; //!< 6 bits : GPS Ant. Distance from Port
dim_starboard: SmallInt; //!< 6 bits : GPS Ant. Distance from Starboard
pos_type: SmallInt; //!< 4 bits : Type of Position Fixing Device
utc_sec: SmallInt; //!< 6 bits : UTC Seconds
off_position: SmallInt; //!< 1 bit : Off Position Flag
regional: Byte; //!< 8 bits : Regional Bits
raim: SmallInt; //!< 1 bit : RAIM Flag
virtual: SmallInt; //!< 1 bit : Virtual/Pseudo AtoN Flag
assigned: SmallInt; //!< 1 bit : Assigned Mode Flag
spare1: SmallInt; //!< 1 bit : Spare
name_ext: Array[0..15] Of Char; //!< 0-84 bits : Extended name in ASCII
spare2: SmallInt; //!< 0-6 bits : Spare
end {aismsg_21};
{ AIS Message 22 - Channel Management }
{ If the message is for a geographic area its 2 corners are }
{ defined by the NE and SW positions. If it is an assigned }
{ message the destination MMSI will be in addressed_1 and }
{ addressed_2. }
TAISMsg_22 = Record
msgid: SmallInt; //!< 6 bits : MessageID (22)
isrepeat: SmallInt; //!< 2 bits : Repeated
userid: LongInt; //!< 30 bits : UserID / MMSI
spare1: SmallInt; //!< 2 bits : Spare
channel_a: Integer; //!< 12 bits : M.1084 Channel A Frequency
channel_b: Integer; //!< 12 bits : M.1084 Channel B Frequency
txrx_mode: SmallInt; //!< 4 bits : TX/RX Mode
power: SmallInt; //!< 1 bit : Power Level
NE_longitude: LongInt; //!< 18 bits : Longitude in 1/1000 minutes
NE_latitude: LongInt; //!< 17 bits : Latitude in 1/1000 minutes
addressed_1: LongInt; //!< 30 bits : Destination MMSI 1
SW_longitude: LongInt; //!< 18 bits : Longitude in 1/1000 minutes
SW_latitude: LongInt; //!< 17 bits : Latitude in 1/1000 minutes
addressed_2: LongInt; //!< 30 bits : Destination MMSI 2
addressed: SmallInt; //!< 1 bit : Addressed flag
bw_a: SmallInt; //!< 1 bit : Channel A Bandwidth
bw_b: SmallInt; //!< 1 bit : Channel B Bandwidth
tz_size: SmallInt; //!< 3 bits : Transitional Zone size
spare2: LongInt; //!< 23 bits : Spare
end {aismsg_22};
{ AIS Message 23 - Group Assignment Command }
{ The geographic area is defined by 2 corners, stored in }
{ the NE and SW positions. }
TAISMsg_23 = Record
msgid: SmallInt; //!< 6 bits : MessageID (23)
isrepeat: SmallInt; //!< 2 bits : Repeated
userid: LongInt; //!< 30 bits : UserID / MMSI
spare1: SmallInt; //!< 2 bits : Spare
NE_longitude: LongInt; //!< 18 bits : Longitude in 1/1000 minutes
NE_latitude: LongInt; //!< 17 bits : Latitude in 1/1000 minutes
SW_longitude: LongInt; //!< 18 bits : Longitude in 1/1000 minutes
SW_latitude: LongInt; //!< 17 bits : Latitude in 1/1000 minutes
station_type: SmallInt; //!< 4 bits : Station Type
ship_type: Byte; //!< 8 bits : Type of Ship and Cargo
spare2: LongInt; //!< 22 bits : Spare
txrx_mode: SmallInt; //!< 2 bits : TX/RX Mode
report_interval: SmallInt; //!< 4 bits : Reporting Interval from IEC 62287 Table 17
quiet_time: SmallInt; //!< 4 bits : Quiet Time in Minutes
spare3: SmallInt; //!< 6 bits : Spare
end {aismsg_23};
{ AIS Message 24 - Class B CS Static Data Report }
{ Message 24 is a 2 part message, 24A with the name and }
{ 24B with the dimensions, etc. This structure is used }
{ to hold the results. }
TAISMsg_24 = Record
msgid: SmallInt; //!< 6 bits : MessageID (24)
isrepeat: SmallInt; //!< 2 bits : Repeated
userid: LongInt; //!< 30 bits : UserID / MMSI
part_number: SmallInt; //!< 2 bits : Part Number
///!< Message 24A
name: Array[0..20] Of Char; //!< 120 bits : Ship Name in ASCII
///!< Message 24B
ship_type: Byte; //!< 8 bits : Type of Ship and Cargo
vendor_id: Array[0..7] Of Char; //!< 42 bits : Vendor ID in ASCII
callsign: Array[0..7] Of Char; //!< 42 bits : Callsign in ASCII
dim_bow: Integer; //!< 9 bits : GPS Ant. Distance from Bow
dim_stern: Integer; //!< 9 bits : GPS Ant. Distance from Stern
dim_port: SmallInt; //!< 6 bits : GPS Ant. Distance from Port
dim_starboard: SmallInt; //!< 6 bits : GPS Ant. Distance from Starboard
spare: SmallInt; //!< 6 bits : Spare
flags: SmallInt; //!< A/B flags - A = 1 B = 2 Both = 3
end {aismsg_24};
{ ------------------------------------------------------------------------ }
{ ais_state the state for the Message Parser }
{ It keeps track partial messages until a complete message has been }
{ received and it hols the sixbit state for exteacting bits from the }
{ message. }
{ ------------------------------------------------------------------------ }
TAIS_State = Record
msgid: Byte; //!< Message ID 0-31
sequence: DWORD; //!< VDM message sequence number
total: DWORD; //!< Total # of parts for the message
num: DWORD; //!< Number of the last part stored
channel: Char; //!< AIS Channel character
six_state: TSixBit; //!< sixbit parser state
end {ais_state};
{ SixBit Functions }
Function BinFrom6bit(C: Char): ShortInt;
Procedure Init6bit(Var State: TSixBit);
Function Get6bit(Var State: TSixBit; NumBits: Integer): LongWord;
{ NMEA Functions }
Function IsXDigit(C: Char): Boolean;
Function NMEANextField(P: PChar): PChar;
Function NMEAUInt(P: PChar): DWORD;
Procedure NMEACopyField(Dest, Src: PChar; Len: Integer);
Function FindNMEAStart(Buffer: PChar): PChar;
Function NMEACheckSum(Buffer: PChar; Var CheckSum: Byte): Integer;
Function CheckNMEACheckSum(Buffer: PChar; Var CheckSum: Byte): Integer;
{ VDM_Parse Functions }
Function AIS2ASCII(C: Byte): Char;
Function Pos2DDD(Latitude, Longitude: LongInt; Var Lat_DD,
Long_DDD: Double): Integer;
Function Pos2DMM(Latitude, Longitude: LongInt; Var Lat_DD: SmallInt;
Var Lat_Min: Double; Var Long_DDD: SmallInt; Var Long_Min: Double): Integer;
Function ConvPos(Var Latitude, Longitude: LongInt): Integer;
Function AssembleVDM(Var State: TAIS_State; Str: PChar): Integer;
Function ParseAIS_1(Var State: TAIS_State; Var Msg: TAISMsg_1): Integer;
Function ParseAIS_2(Var State: TAIS_State; Var Msg: TAISMsg_2): Integer;
Function ParseAIS_3(Var State: TAIS_State; Var Msg: TAISMsg_3): Integer;
Function ParseAIS_4(Var State: TAIS_State; Var Msg: TAISMsg_4): Integer;
Function ParseAIS_5(Var State: TAIS_State; Var Msg: TAISMsg_5): Integer;
Function ParseAIS_6(Var State: TAIS_State; Var Msg: TAISMsg_6): Integer;
Function ParseAIS_7(Var State: TAIS_State; Var Msg: TAISMsg_7): Integer;
Function ParseAIS_8(Var State: TAIS_State; Var Msg: TAISMsg_8): Integer;
Function ParseAIS_9(Var State: TAIS_State; Var Msg: TAISMsg_9): Integer;
Function ParseAIS_10(Var State: TAIS_State; Var Msg: TAISMsg_10): Integer;
Function ParseAIS_11(Var State: TAIS_State; Var Msg: TAISMsg_11): Integer;
Function ParseAIS_12(Var State: TAIS_State; Var Msg: TAISMsg_12): Integer;
Function ParseAIS_13(Var State: TAIS_State; Var Msg: TAISMsg_13): Integer;
Function ParseAIS_14(Var State: TAIS_State; Var Msg: TAISMsg_14): Integer;
Function ParseAIS_15(Var State: TAIS_State; Var Msg: TAISMsg_15): Integer;
Function ParseAIS_16(Var State: TAIS_State; Var Msg: TAISMsg_16): Integer;
Function ParseAIS_17(Var State: TAIS_State; Var Msg: TAISMsg_17): Integer;
Function ParseAIS_18(Var State: TAIS_State; Var Msg: TAISMsg_18): Integer;
Function ParseAIS_19(Var State: TAIS_State; Var Msg: TAISMsg_19): Integer;
Function ParseAIS_20(Var State: TAIS_State; Var Msg: TAISMsg_20): Integer;
Function ParseAIS_21(Var State: TAIS_State; Var Msg: TAISMsg_21): Integer;
Function ParseAIS_22(Var State: TAIS_State; Var Msg: TAISMsg_22): Integer;
Function ParseAIS_23(Var State: TAIS_State; Var Msg: TAISMsg_23): Integer;
Function ParseAIS_24(Var State: TAIS_State; Var Msg: TAISMsg_24): Integer;
Implementation
{===============================================================================
SIXBIT Functions
6-bit packed ASCII Functions
Copyright 2006 by Brian C. Lane <bcl@brianlane.com>, All Rights Reserved
Version 1.0
This module's Functions are used to extract data from the 6-bit packed
ASCII string used by AIVDM/AIVDO AIS messages.
The State of the sixbit machine is held in the sixbit structure so that
multiple streams can be processed by maintaining separate instances
of sixbit. init_6bit() should be called with a pointer to the sixbit
instance, it will setup the structure for parsing. The 6-bit data
should then be copied into the sixbit.bits buffer. A maximum of 255
characters are allowed (this is changed by #SIXBIT_LEN in sixbit.h)
Up to 32 bits of data are fetched from the string by calling get_6bit()
The size of the packet can be calculated with strlen(State->bits) * 6 but
note that due to padding at the end of the string the data may be
1-6 bits longer than the the expected length for the message id.
It is up to the calling Function to keep track of how many bits have
been fetched. When it reaches the end of the 6-bit string get_6bit()
will return 0's.
===============================================================================}
(* -----------------------------------------------------------------------
Convert an ascii value to a 6-bit binary value
This Function checks the ASCII value to make sure it can be coverted.
If not, it returns a 0.
Otherwise it returns the 6-bit ASCII value.
returns:
- -1 if it fails
- 6-bit value (0x00-0x3F)
This is used to convert the packed 6-bit value to a binary value. It
is not used to convert data from fields such as the name and
destination -- Use ais2ascii() instead.
----------------------------------------------------------------------- *)
Function BinFrom6bit(C: Char): ShortInt;
Var
B: Integer;
Begin
B := Ord(C);
If (B < $30) Or (B > $77) Or ((B > $57) And (B < $60)) Then
Result := -1
Else If (B < $60) Then
Result := (B - $30) And $3F
Else
Result := (B - $38) And $3F
End;
(* -----------------------------------------------------------------------
Initialize a 6-bit datastream structure
\param State State of 6-bit parser
This Function initializes the State of the sixbit parser variables
and 0 terminates the 6-bit string.
Example:
\code
sixbit State;
init_6bit( &State );
\endcode
----------------------------------------------------------------------- *)
Procedure Init6bit(Var State: TSixBit);
Begin
State.remainder := 0;
State.remainder_bits := 0;
State.p := @State.bits[0];
FillChar(State.Bits, SizeOf(State.Bits), 0);
End;
(* -----------------------------------------------------------------------
Return 0-32 bits from a 6-bit ASCII stream
\param State pointer to a sixbit State structure
\param numbits number of bits to return
This Function returns the requested number of bits to the calling
Function. It pulls the bits from the raw 6-bit ASCII as they are
needed.
The full string can be addressed by pointing to State->bits and the
length can be calculated by strlen(State->bits) * 6, but note that the
string also includes any final padding, so when checking lengths take
into account that it will be a multiples of 6 bits.
Example:
\code
sixbit State;
unsigned char i;
init_6bit( &State );
strcpy( State.bits, "5678901234" );
i = get_6bit( &State, 6 );
i == 5
\endcode
----------------------------------------------------------------------- *)
Function Get6bit(Var State: TSixBit; NumBits: Integer): LongWord;
Var
Fetch_Bits: Integer;
Begin
Result := 0;
Fetch_Bits := NumBits;
While (Fetch_Bits > 0) Do
Begin
// Is there anything left over from the last call?
If State.remainder_bits > 0 Then
Begin
If State.remainder_bits <= Fetch_Bits Then
Begin
// reminder is less than or equal to what is needed
Result := (Result Shl 6) + State.remainder;
Fetch_Bits := Fetch_Bits - State.remainder_bits;
State.remainder := 0;
State.remainder_bits := 0;
End
Else
Begin
{ remainder is larger than what is needed Take the bits from
the top of remainder }
Result := Result Shl Fetch_Bits;
Result := Result + State.remainder Shr (State.remainder_bits - Fetch_Bits);
// Fixup remainder
State.remainder_bits := State.remainder_bits - Fetch_Bits;
State.remainder := State.remainder And pow2_mask[State.remainder_bits];
Break;
End;
End;
// Get the next block of 6 bits from the ASCII string
If State.p^ <> #0 Then
Begin
State.remainder := binfrom6bit(State.p^);
State.remainder_bits := 6;
Inc(State.p);
End
Else
// Nothing more to fetch, return what we have
Break;
End;
End;
{===============================================================================
NMEA Functions
NMEA 0183 Sentence Parser Module
Copyright 2006 by Brian C. Lane <bcl@brianlane.com>, All Rights Reserved
version 1.0
This module provides utility Functions for handling NMEA 0183 data
streams. The stream data is 8 bit ASCII with comma separated data
fields. The Functions in this module can be used to generate and
verify the checksum, find the start of the sentence, find the next
field, convert a field to an integer and copy a field to a destination
buffer.
===============================================================================}
Function IsXDigit(C: Char): Boolean;
Begin
Result := C In ['0'..'9', 'A'..'F', 'a'..'f'];
End;
(* -----------------------------------------------------------------------
Return a pointer to the next field in the string
\param p Pointer to the NMEA 0183 field
Returns:
- pointer to next field in string
- NULL if the end of the string has been reached
Example:
\code
char buf[255];
char *p;
strcpy( buf, "!AIVDM,1,1,,A,19NWoq000Wrt<RJHEuuqiWlN061d,0*5F" );
p = nmea_next_field( p );
*p == '1'
\endcode
----------------------------------------------------------------------- *)
Function NMEANextField(P: PChar): PChar;
Begin
While Assigned(P) And (P^ <> #0) And (P^ <> ',') And (P^ <> '*') Do
Inc(P);
If (P^ <> #0) Then
Result := P + 1
Else
Result := P;
End;
(* -----------------------------------------------------------------------
Convert the current field to an unsigned integer
\param p Pointer to the NMEA 0183 field
Returns:
- unsigned int
Example:
\code
char buf[255];
char *p;
unsigned int i;
strcpy( buf, "!AIVDM,1,1,,A,19NWoq000Wrt<RJHEuuqiWlN061d,0*5F" );
p = nmea_next_field( p );
i = nmea_uint( p );
i == 1
\endcode
----------------------------------------------------------------------- *)
Function NMEAUInt(P: PChar): DWORD;
Var
I: Integer;
Begin
I := 0;
While Assigned(P) And (P^ <> #0) And (P^ <> ',') And (P^ <> '*') Do
Begin
I := I * 10;
I := I + Ord(P^) - Ord('0');
Inc(P);
End;
Result := I;
End;
(* -----------------------------------------------------------------------
Copy len bytes from a field to a destination buffer
\param dest pointer to destination buffer
\param src pointer to 0 terminated source buffer
\param len maximum number of characters to copy
Returns:
- unsigned int
This routine stops copying when it hits the end of the field, end of
the string or len.
Example:
\code
char buf1[255];
char buf2[255];
char *p;
strcpy( buf1, "!AIVDM,1,1,,A,19NWoq000Wrt<RJHEuuqiWlN061d,0*5F" );
buf2[0] = 0;
p = buf1;
nmea_copy_field( buf2, p, 254 );
buf2 == buf1
\endcode
----------------------------------------------------------------------- *)
Procedure NMEACopyField(Dest, Src: PChar; Len: Integer);
Begin
While (Len > 0) And (Src^ <> #0) And (Src^ <> ',') And (Src^ <> '*') Do
Begin
Dest^ := Src^;
Inc(Dest);
Inc(Src);
Dec(Len);
End;
Dest^ := #0;
End;
(* -----------------------------------------------------------------------
Find the start of a NMEA sentence '!' or '$' character
\param buffer pointer to a 0 terminated string buffer
Returns:
- pointer to start character or NULL if not found
The NMEA sentence may not always start at the beginning of the buffer,
use this routine to make sure the start of the sentence has been found.
Example:
\code
char buf[255];
char *p;
strcpy( (char * ) buf, "678,4343,123,585*FF\n$GPGGA,32,121,676,29394,29234*AA\n" );
p = find_nmea_start( buf ) );
*p == "$GPGGA,..."
\endcode
----------------------------------------------------------------------- *)
Function FindNMEAStart(Buffer: PChar): PChar;
Var
P: PChar;
Begin
Result := Nil;
If Not Assigned(Buffer) Then
Exit;
P := @Buffer[0];
While Assigned(P) And (P^ <> #0) And (P^ <> '!') And (P^ <> '$') Do
Inc(P);
If (P^ <> #0) Then
Result := P;
End;
(* -----------------------------------------------------------------------
Calculate the checksum of a NMEA 0183 sentence
\param buffer pointer to a 0 terminated buffer
\param checksum pointer to variable where checksum will be stored
Returns:
- 0 if no error
- 1 if there was an error
- Fills in *checksum with calculated checksum
This Function will calculate the checksum of the string by skipping the
! or $ character and stopping at the * character or end of string.
Example:
\code
char buf[255];
unsigned char checksum;
strcpy( (char * ) buf, "!AIVDM,1,1,,A,15N;<J0P00Jro1<H>bAP0?vL00Rb,0*1B\n" );
nmea_checksum( buf, &checksum )
checksum == 0x1B
\endcode
----------------------------------------------------------------------- *)
Function NMEACheckSum(Buffer: PChar; Var CheckSum: Byte): Integer;
Var
P: PChar;
Begin
Result := 1;
If Not Assigned(Buffer) Then
Exit;
{ Find start of sentence, after a '!' or '$' }
P := FindNMEAStart(Buffer);
If Not Assigned(P) Then
Exit;
Inc(P);
CheckSum := 0;
{ Run checksum until end or illegal character }
While (P^ <> #0) And (P^ <> '*') And (Not ((P^ = '!') Or (P^ = '$'))) Do
Begin
Checksum := CheckSum Xor Ord(P^);
Inc(P);
End;
{ Check for illegal character }
If (P^ = '*') Then
Result := 0;
End;
(* -----------------------------------------------------------------------
Check and return the checksum of a NMEA 0183 sentence
\param buffer pointer to a 0 terminated buffer
\param checksum pointer to variable where checksum will be stored
Returns:
- 0 if it does match
- 1 if it does not match
- 2 if there was an error
This Function checks the checksum of a string and returns the result.
The string is expected to start with a ! or $ and end after the
2 hex checksum characters. Trailing CR and/or LF are optional. The
actual checksum is returned in the variable pointed to by checksum.
Example:
\code
char buf[255];
unsigned char checksum;
strcpy( (char * ) buf, "!AIVDM,1,1,,A,15N;<J0P00Jro1<H>bAP0?vL00Rb,0*1B\n" );
if( check_nmea_checksum( buf, &checksum ) != 0 )
{
fprintf( stderr, "Checksum failed\n" );
}
checksum == 0x1B
\endcode
----------------------------------------------------------------------- *)
Function CheckNMEACheckSum(Buffer: PChar; Var CheckSum: Byte): Integer;
Var
RV: Integer;
P: PChar;
SSum: Byte;
Begin
If Not Assigned(Buffer) Then
Result := 2
Else
Begin
RV := NMEACheckSum(Buffer, CheckSum);
If RV <> 0 Then
Result := 2
Else
Begin
{ Find the checksum in the sentence }
P := StrScan(Buffer, '*');
If Not Assigned(P) Then
Result := 2
{ Make sure it found the end of the sentence }
Else If (P^ <> '*') Then
Result := 1
{ Make sure there is a checksum to check }
Else If Not (IsXDigit((P + 1)^) And IsXDigit((P + 2)^)) Then
Result := 1
Else
Begin
{ Convert the checksum and check it }
HexToBin(PChar(P + 1), @SSum, SizeOf(SSum));
If (SSum = CheckSum) Then
Result := 0
Else
Result := 1;
End;
End;
End;
End;
{===============================================================================
VDM_PARSE Functions
AIVDM/AIVDO AIS Sentence Parser
Copyright 2006 by Brian C. Lane <bcl@brianlane.com>, All Rights Reserved
Version 1.0
This module contains the Functions to parse incoming Automatic
Identification System (AIS) serial messages as defined by IEC-61993-2
Each message type has its own structure, of the form aismsg_XX, based
on the message id of the message. The parse routine for each message
is of the form ParseAIS_<msgid>, eg, ParseAIS_5()
Each of the aismsg_XX parsing Functions expect to be passed a pointer
to a ais_sate structure containing the raw 6-bit data and a pointer
to the aismsg_XX structure to place the parsed information into.
All aismsg_XX structures are cleared by their respecive parsers, except
for ParseAIS_24() which stores 2 messages into a single structure.
Data like the ship's name and callsign are converted to ASCII
before being stored. Positions are converted to signed long values,
and other fields like course over ground, speed, heading, etc.
are left for further decoding. 1/1000 minute positions are converted
to 1/10000 minute positions to make comparisons easier.
Not all of these parsers have been fully tested with live data.
Here is a list of the ones that have been tested so far:
1,3,4,5,7,12,15,20
If you have valid data for other message ids and would like to
contribute them please email them to bcl@brianlane.com
Example:
\code
ais_state State;
aismsg_1 message;
unsigned int result;
char buf[] = "!AIVDM,1,1,,B,19NS7Sp02wo?HETKA2K6mUM20<L=,0*27";
memset( &State, 0, sizeof(State) );
assemble_vdm( &State, buf )
State.msgid = (char) get_6bit( &State.six_state, 6 );
if (State.msgid == 1)
ParseAIS_1( &State, &message )
message now contains all of the data from the AIS Message 1
\endcode
===============================================================================}
(* -----------------------------------------------------------------------
Convert a AIS 6-bit character to ASCII
\param value 6-bit value to be converted
return
- corresponding ASCII value (0x20-0x5F)
This function is used to convert binary data to ASCII. This is
different from the 6-bit ASCII to binary conversion for VDM
messages; it is used for strings within the datastream itself.
eg. Ship Name and Destination.
----------------------------------------------------------------------- *)
Function AIS2ASCII(C: Byte): Char;
Begin
Byte(Result) := C And $3f;
If Byte(Result) < $20 Then
Byte(Result) := Byte(Result) + $40;
End;
(* -----------------------------------------------------------------------
Convert 1/10000 minute position to signed DD.DDDDDD format
\param latitude signed latitude in 1/10000 minute format
\param longitude signed longitude in 1/10000 minute format
\param lat_dd pointer to hold signed latitude in DD.DDDDDD format
\param long_ddd pointer to hold signed longitude in DD.DDDDDD format
This function converts 1/10000 minute formatted positions to standard
Degrees and decimal degrees format.
----------------------------------------------------------------------- *)
Function Pos2DDD(Latitude, Longitude: LongInt; Var Lat_DD,
Long_DDD: Double): Integer;
Begin
// Convert 1/10000 Minute Latitude to DD.DDDDDD
Lat_DD := Latitude Div 600000;
Lat_DD := Lat_DD + (Latitude - (Lat_DD * 600000)) / 600000;
// Convert 1/10000 Minute Longitude to DDD.DDDDDD
Long_DDD := Longitude Div 600000;
Long_DDD := Long_DDD + (Longitude - (Long_DDD * 600000)) / 600000;
Result := 0;
End;
(* -----------------------------------------------------------------------
Convert 1/10000 minute position to signed DD MM.MMMM format
\param latitude signed latitude in 1/10000 minute format
\param longitude signed longitude in 1/10000 minute format
\param lat_dd pointer to hold signed latitude in DD format
\param lat_min pointer to hold minutes in mm.mmmm format
\param long_ddd pointer to hold signed longitude in DDD format
\param long_min pointer to hold minutes in mm.mmmm format
This function converts 1/10000 minute formatted positions to standard
Degrees and decimal minutes format.
----------------------------------------------------------------------- *)
Function Pos2DMM(Latitude, Longitude: LongInt; Var Lat_DD: SmallInt;
Var Lat_Min: Double; Var Long_DDD: SmallInt; Var Long_Min: Double): Integer;
Begin
// Convert 1/10000 minute Latitude to DD MM.MMMM format
Lat_DD := (Latitude Div 600000);
Lat_Min := Abs((Latitude - (Lat_DD * 600000))) / 10000.0;
// Convert 1/10000 minute Longitude to DDD MM.MMMM format
Long_DDD := (Longitude Div 600000);
Long_Min := Abs((Longitude - (Long_DDD * 600000))) / 10000.0;
Result := 0;
End;
(* -----------------------------------------------------------------------
Convert unsigned 1/10000 minute position to signed
\param latitude pointer to an unsigned latitude
\param longitude pointer to an unsigned longitude
This function converts the raw 2's complement values to signed long
1/10000 minute position. It is used internally by all of the messages
that contain position information.
----------------------------------------------------------------------- *)
Function ConvPos(Var Latitude, Longitude: LongInt): Integer;
Begin
// LATITUDE
// Convert latitude to signed number
If (Latitude And $4000000) <> 0 Then { 61708864 }
Begin
Latitude := $8000000 - Latitude; { 134217728 }
Latitude := Latitude * -1;
End;
// LONGITUDE
// Convert longitude to signed number
If (Longitude And $8000000) <> 0 Then { 134217728 }
Begin
Longitude := $10000000 - Longitude; { 268435456 }
Longitude := Longitude * -1;
End;
Result := 0;
End;
(* -----------------------------------------------------------------------
Assemble AIVDM/VDO sentences
This function handles re-assembly and extraction of the 6-bit data
from AIVDM/AIVDO sentences.
Because the NMEA standard limits the length of a line to 80 characters
some AIS messages, such as message 5, are output as a multipart VDM
messages.
This routine collects the 6-bit encoded data from these parts and
returns a 1 when all pieces have been reassembled.
It expects the sentences to:
- Be in order, part 1, part 2, etc.
- Be from a single sequence
It will return an error if it receives a piece out of order or from
a new sequence before the previous one is finished.
Returns
- 0 Complete packet
- 1 Incomplete packet
- 2 NMEA 0183 checksum failed
- 3 Not an AIS message
- 4 Error with nmea_next_field
- 5 Out of sequence packet
Example:
\code
ais_state state;
char buf[3][255] = { "!AIVDM,1,1,,B,19NS7Sp02wo?HETKA2K6mUM20<L=,0*27\r\n",
"!AIVDM,2,1,9,A,55Mf@6P00001MUS;7GQL4hh61L4hh6222222220t41H,0*49\r\n",
"!AIVDM,2,2,9,A,==40HtI4i@E531H1QDTVH51DSCS0,2*16\r\n"
};
memset( &state, 0, sizeof(state) );
assemble_vdm( &state, buf[0] )
state.six_state now has the 6-bit data from the message
assemble_vdm( &state, buf[1] );
This returns a 1 because not all the pieces have been received.
assemble_vdm( &state, buf[2] );
This returns a 0 and state.six_state has the complete 6-bit data for
the message 5.
\endcode
----------------------------------------------------------------------- *)
Function AssembleVDM(Var State: TAIS_State; Str: PChar): Integer;
Var
I, Len: Integer;
Total, Num, Sequence: DWORD;
P, D: PChar;
CheckSum: Byte;
Begin
Total := 0;
Num := 0;
Sequence := 0;
// Check the strings's checksum
If CheckNMEAChecksum(Str, CheckSum) <> 0 Then
Begin
// Checksum failed
Result := 2;
Exit;
End;
// Is the string an AIS message?
P := FindNMEAStart(Str);
If (StrLComp(P, PChar('!AIVDM'), 6) <> 0) And
(StrLComp(P, PChar('!AIVDO'), 6) <> 0) Then
Begin
// Not an AIS message
Result := 3;
Exit;
End;
// Get the 3 message info values from the packet
For I := 0 To 2 Do
Begin
P := NMEANextField(P);
If Not Assigned(P) Then
Begin
// Error with the string;
Result := 4;
Exit;
End;
Case I Of
0: Total := NMEAUint(P);
1: Num := NMEAUint(P);
2: Sequence := NMEAUint(P);
End;
End;
// Are we looking for more parts?
If State.total > 0 Then
Begin
// If the sequence doesn't match, or the number is not in
// order: reset and exit
If (State.sequence <> Sequence) Or (State.num <> (Num - 1)) Then
Begin
State.total := 0;
State.sequence := 0;
State.num := 0;
Result := 5;
Exit;
End;
State.num := State.num + 1;
End
Else
Begin
// Not looking for more parts. Reset the state.
State.total := Total;
State.num := Num;
State.sequence := Sequence;
Init6Bit(State.six_state);
End;
// Get the channel character
P := NMEANextField(P);
If Not Assigned(P) Then
Begin
// Error with the string.
Result := 4;
Exit;
End;
State.channel := P^;
// Point to the 6-bit data
P := NMEANextField(P);
If Not Assigned(P) Then
Begin
// Error with the string.
Result := 4;
Exit;
End;
// Copy the 6-bit ASCII field over to the sixbit_state buffer
D := @State.six_state.bits;
Len := 0;
// Find the end of the current string and count the number of bytes
While (D^ <> #0) Do
Begin
Inc(Len);
Inc(D);
End;
NMEACopyField(D, P, SIXBIT_LEN - Len);
// Is this the last part of the sequence?
If (Total = 0) Or (State.total = Num) Then
Begin
State.total := 0;
State.num := 0;
State.sequence := 0;
// Found a complete packet
Result := 0;
End
Else
// Waiting for more packets to complete data
Result := 1;
End;
(* -----------------------------------------------------------------------
Parse an AIS message 1 into an aismsg_1 structure
Ship Position report with SOTDMA Communication state
\param state pointer to ais_state
\param result pointer to parsed message result structure to be filled
return:
- 0 if no errors
- 1 if there is an error
- 2 if there is a packet length error
Note that the latitude and longitude are converted to signed values
before being returned.
----------------------------------------------------------------------- *)
Function ParseAIS_1(Var State: TAIS_State; Var Msg: TAISMsg_1): Integer;
Begin
If StrLen(State.six_state.Bits) <> 28 Then
Result := 2
Else
Begin
// Clear out the structure first
FillChar(Msg, SizeOf(Msg), 0);
Msg.msgid := State.msgid;
// Parse the Message 1
Msg.isrepeat := Get6Bit(State.six_state, 2 );
Msg.userid := Get6Bit(State.six_state, 30 );
Msg.nav_status := Get6Bit(State.six_state, 4 );
Msg.rot := Get6Bit(State.six_state, 8 );
Msg.sog := Get6Bit(State.six_state, 10 );
Msg.pos_acc := Get6Bit(State.six_state, 1 );
Msg.longitude := Get6Bit(State.six_state, 28 );
Msg.latitude := Get6Bit(State.six_state, 27 );
Msg.cog := Get6Bit(State.six_state, 12 );
Msg.true := Get6Bit(State.six_state, 9 );
Msg.utc_sec := Get6Bit(State.six_state, 6 );
Msg.regional := Get6Bit(State.six_state, 4 );
Msg.spare := Get6Bit(State.six_state, 1 );
Msg.raim := Get6Bit(State.six_state, 1 );
Msg.sync_state := Get6Bit(State.six_state, 2 );
Msg.slot_timeout := Get6Bit(State.six_state, 3 );
Msg.sub_message := Get6Bit(State.six_state, 14 );
// Convert the position to signed value
ConvPos(Msg.latitude, Msg.longitude);
Result := 0;
End;
End;
(* -----------------------------------------------------------------------
Parse an AIS message 2 into an aismsg_2 structure
Ship Position report with SOTDMA Communication state
\param state pointer to ais_state
\param result pointer to parsed message result structure to be filled
return:
- 0 if no errors
- 1 if there is an error
- 2 if there is a packet length error
Note that the latitude and longitude are converted to signed values
before being returned.
----------------------------------------------------------------------- *)
Function ParseAIS_2(Var State: TAIS_State; Var Msg: TAISMsg_2): Integer;
Var
Len: Integer;
Begin
Len := StrLen(State.six_state.Bits) * 6;
If Len <> 168 Then
Result := 2
Else
Begin
// Clear out the structure first
FillChar(Msg, SizeOf(Msg), 0);
Msg.msgid := State.msgid;
// Parse the Message 2
Msg.isrepeat := Get6Bit(State.six_state, 2 );
Msg.userid := Get6Bit(State.six_state, 30 );
Msg.nav_status := Get6Bit(State.six_state, 4 );
Msg.rot := Get6Bit(State.six_state, 8 );
Msg.sog := Get6Bit(State.six_state, 10 );
Msg.pos_acc := Get6Bit(State.six_state, 1 );
Msg.longitude := Get6Bit(State.six_state, 28 );
Msg.latitude := Get6Bit(State.six_state, 27 );
Msg.cog := Get6Bit(State.six_state, 12 );
Msg.true := Get6Bit(State.six_state, 9 );
Msg.utc_sec := Get6Bit(State.six_state, 6 );
Msg.regional := Get6Bit(State.six_state, 4 );
Msg.spare := Get6Bit(State.six_state, 1 );
Msg.raim := Get6Bit(State.six_state, 1 );
Msg.sync_state := Get6Bit(State.six_state, 2 );
Msg.slot_timeout := Get6Bit(State.six_state, 3 );
Msg.sub_message := Get6Bit(State.six_state, 14 );
// Convert the position to signed value
ConvPos(Msg.latitude, Msg.longitude);
Result := 0;
End;
End;
(* -----------------------------------------------------------------------
Parse an AIS message 3 into an aismsg_3 structure
Ship Position report with ITDMA Communication state
\param state pointer to ais_state
\param result pointer to parsed message result structure to be filled
return:
- 0 if no errors
- 1 if there is an error
- 2 if there is a packet length error
Note that the latitude and longitude are converted to signed values
before being returned.
----------------------------------------------------------------------- *)
Function ParseAIS_3(Var State: TAIS_State; Var Msg: TAISMsg_3): Integer;
Begin
If StrLen(State.six_state.Bits) <> 28 Then
Result := 2
Else
Begin
// Clear out the structure first
FillChar(Msg, SizeOf(Msg), 0);
Msg.msgid := State.msgid;
// Parse the Message 3
Msg.isrepeat := Get6Bit(State.six_state, 2 );
Msg.userid := Get6Bit(State.six_state, 30 );
Msg.nav_status := Get6Bit(State.six_state, 4 );
Msg.rot := Get6Bit(State.six_state, 8 );
Msg.sog := Get6Bit(State.six_state, 10 );
Msg.pos_acc := Get6Bit(State.six_state, 1 );
Msg.longitude := Get6Bit(State.six_state, 28 );
Msg.latitude := Get6Bit(State.six_state, 27 );
Msg.cog := Get6Bit(State.six_state, 12 );
Msg.true := Get6Bit(State.six_state, 9 );
Msg.utc_sec := Get6Bit(State.six_state, 6 );
Msg.regional := Get6Bit(State.six_state, 4 );
Msg.spare := Get6Bit(State.six_state, 1 );
Msg.raim := Get6Bit(State.six_state, 1 );
Msg.sync_state := Get6Bit(State.six_state, 2 );
Msg.slot_increment := Get6Bit(State.six_state, 13 );
Msg.num_slots := Get6Bit(State.six_state, 3 );
Msg.keep := Get6Bit(State.six_state, 1 );
// Convert the position to signed value
ConvPos(Msg.latitude, Msg.longitude);
Result := 0;
End;
End;
(* -----------------------------------------------------------------------
Parse an AIS message 4 into an aismsg_4 structure
Base Station Report
\param state pointer to ais_state
\param result pointer to parsed message result structure to be filled
return:
- 0 if no errors
- 1 if there is an error
- 2 if there is a packet length error
Note that the latitude and longitude are converted to signed values
before being returned.
----------------------------------------------------------------------- *)
Function ParseAIS_4(Var State: TAIS_State; Var Msg: TAISMsg_4): Integer;
Begin
If StrLen(State.six_state.Bits) <> 28 Then
Result := 2
Else
Begin
// Clear out the structure first
FillChar(Msg, SizeOf(Msg), 0);
Msg.msgid := State.msgid;
// Parse the Message 4
Msg.isrepeat := Get6Bit(State.six_state, 2 );
Msg.userid := Get6Bit(State.six_state, 30 );
Msg.utc_year := Get6Bit(State.six_state, 14 );
Msg.utc_month := Get6Bit(State.six_state, 4 );
Msg.utc_day := Get6Bit(State.six_state, 5 );
Msg.utc_hour := Get6Bit(State.six_state, 5 );
Msg.utc_minute := Get6Bit(State.six_state, 6 );
Msg.utc_second := Get6Bit(State.six_state, 6 );
Msg.pos_acc := Get6Bit(State.six_state, 1 );
Msg.longitude := Get6Bit(State.six_state, 28 );
Msg.latitude := Get6Bit(State.six_state, 27 );
Msg.pos_type := Get6Bit(State.six_state, 4 );
Msg.spare := Get6Bit(State.six_state, 10 );
Msg.raim := Get6Bit(State.six_state, 1 );
Msg.sync_state := Get6Bit(State.six_state, 2 );
Msg.slot_timeout := Get6Bit(State.six_state, 3 );
Msg.sub_message := Get6Bit(State.six_state, 14 );
// Convert the position to signed value
ConvPos(Msg.latitude, Msg.longitude);
Result := 0;
End;
End;
(* -----------------------------------------------------------------------
Parse an AIS message 5 into an aismsg_5 structure
Ship Static and Voyage Data
\param state pointer to ais_state
\param result pointer to parsed message result structure to be filled
return:
- 0 if no errors
- 1 if there is an error
- 2 if there is a packet length error
Note that the ship's callsign, name and destination are converted to
ASCII before storage.
----------------------------------------------------------------------- *)
Function ParseAIS_5(Var State: TAIS_State; Var Msg: TAISMsg_5): Integer;
Var
I: Integer;
Begin
If StrLen(State.six_state.Bits) <> 71 Then
Result := 2
Else
Begin
// Clear out the structure first
FillChar(Msg, SizeOf(Msg), 0);
Msg.msgid := State.msgid;
// Parse the Message 4
Msg.isrepeat := Get6Bit(State.six_state, 2 );
Msg.userid := Get6Bit(State.six_state, 30 );
Msg.version := Get6Bit(State.six_state, 2 );
Msg.imo := Get6Bit(State.six_state, 30 );
// Get the Callsign, convert to ASCII
For I := 0 To 6 Do
Msg.callsign[I] := AIS2ASCII(Get6Bit(State.six_state, 6));
Msg.callsign[7] := #0;
// Get the Ship Name, convert to ASCII
For I := 0 To 19 Do
Msg.name[I] := AIS2ASCII(Get6Bit(State.six_state, 6));
Msg.name[20] := #0;
Msg.ship_type := Get6Bit(State.six_state, 8 );
Msg.dim_bow := Get6Bit(State.six_state, 9 );
Msg.dim_stern := Get6Bit(State.six_state, 9 );
Msg.dim_port := Get6Bit(State.six_state, 6 );
Msg.dim_starboard:= Get6Bit(State.six_state, 6 );
Msg.pos_type := Get6Bit(State.six_state, 4 );
Msg.eta := Get6Bit(State.six_state, 20 );
Msg.draught := Get6Bit(State.six_state, 8 );
// Get the Ship Destination, convert to ASCII
For I := 0 To 19 Do
Msg.dest[I] := AIS2ASCII(Get6Bit(State.six_state, 6));
Msg.name[20] := #0;
Msg.dte := Get6Bit(State.six_state, 1 );
Msg.spare := Get6Bit(State.six_state, 1 );
Result := 0;
End;
End;
(* -----------------------------------------------------------------------
Parse an AIS message 6 into an aismsg_6 structure
Addressed Binary Message
\param state pointer to ais_state
\param result pointer to parsed message result structure to be filled
return:
- 0 if no errors
- 1 if there is an error
- 2 if there is a packet length error
Note: the binary payload of the message is left in its 6-bit ASCII
form when stored into result->data. This allows the data to
be passed to the sixbit module for parsing.
----------------------------------------------------------------------- *)
Function ParseAIS_6(Var State: TAIS_State; Var Msg: TAISMsg_6): Integer;
Var
Len: Integer;
Begin
Len := StrLen(State.six_state.Bits) * 6;
If (Len < 88) Or (Len > 1008) Then
Result := 2
Else
Begin
// Clear out the structure first
FillChar(Msg, SizeOf(Msg), 0);
Msg.msgid := State.msgid;
// Parse the Message 6
Msg.isrepeat := Get6Bit(State.six_state, 2 );
Msg.userid := Get6Bit(State.six_state, 30 );
Msg.sequence := Get6Bit(State.six_state, 2 );
Msg.destination := Get6Bit(State.six_state, 30 );
Msg.retransmit := Get6Bit(State.six_state, 1 );
Msg.spare := Get6Bit(State.six_state, 1 );
Msg.app_id := Get6Bit(State.six_state, 16 );
// Store the remaining payload of the packet as 6-bit data
StrLCopy(@Msg.data, State.six_state.p, 154);
Result := 0;
End;
End;
(* -----------------------------------------------------------------------
Parse an AIS message 7 into an aismsg_7 structure
Binary acknowledge
\param state pointer to ais_state
\param result pointer to parsed message result structure to be filled
return:
- 0 if no errors
- 1 if there is an error
- 2 if there is a packet length error
Depending on the length of the message some of the fields may be 0.
result->num_acks has the number of acks received.
----------------------------------------------------------------------- *)
Function ParseAIS_7(Var State: TAIS_State; Var Msg: TAISMsg_7): Integer;
Var
Len: Integer;
Begin
Len := StrLen(State.six_state.Bits) * 6;
If (Len < 72) Or (Len > 168) Then
Result := 2
Else
Begin
// Clear out the structure first
FillChar(Msg, SizeOf(Msg), 0);
Msg.msgid := State.msgid;
// Parse the Message 7
Msg.isrepeat := Get6Bit(State.six_state, 2 );
Msg.userid := Get6Bit(State.six_state, 30 );
Msg.spare := Get6Bit(State.six_state, 2 );
Msg.destid_1 := Get6Bit(State.six_state, 30 );
Msg.sequence_1 := Get6Bit(State.six_state, 2 );
Msg.num_acks := 1;
if (Len > 72) Then
Begin
Msg.destid_2 := Get6Bit(State.six_state, 30 );
Msg.sequence_2 := Get6Bit(State.six_state, 2 );
Inc(Msg.num_acks);
End;
If (Len > 104) Then
Begin
Msg.destid_3 := Get6Bit(State.six_state, 30 );
Msg.sequence_3 := Get6Bit(State.six_state, 2 );
Inc(Msg.num_acks);
End;
If (Len > 136) Then
Begin
Msg.destid_4 := Get6Bit(State.six_state, 30 );
Msg.sequence_4 := Get6Bit(State.six_state, 2 );
Inc(Msg.num_acks);
End;
Result := 0;
End;
End;
(* -----------------------------------------------------------------------
Parse an AIS message 8 into an aismsg_8 structure
Binary Broadcast Message
\param state pointer to ais_state
\param result pointer to parsed message result structure to be filled
return:
- 0 if no errors
- 1 if there is an error
- 2 if there is a packet length error
Note: the binary payload of the message is left in its 6-bit ASCII
form when stored into result->data. This allows the data to
be passed to the sixbit module for parsing.
----------------------------------------------------------------------- *)
Function ParseAIS_8(Var State: TAIS_State; Var Msg: TAISMsg_8): Integer;
Var
Len: Integer;
Begin
Len := StrLen(State.six_state.Bits) * 6;
If (Len < 56) Or (Len > 1008) Then
Result := 2
Else
Begin
// Clear out the structure first
FillChar(Msg, SizeOf(Msg), 0);
Msg.msgid := State.msgid;
// Parse the Message 8
Msg.isrepeat := Get6Bit(State.six_state, 2 );
Msg.userid := Get6Bit(State.six_state, 30 );
Msg.spare := Get6Bit(State.six_state, 1 );
Msg.app_id := Get6Bit(State.six_state, 16 );
// Store the remaining payload of the packet as 6-bit data
StrLCopy(@Msg.data, State.six_state.p, 160);
Result := 0;
End;
End;
(* -----------------------------------------------------------------------
Parse an AIS message 9 into an aismsg_9 structure
Search And Rescue(SAR) position report
\param state pointer to ais_state
\param result pointer to parsed message result structure to be filled
return:
- 0 if no errors
- 1 if there is an error
- 2 if there is a packet length error
Note that the latitude and longitude are converted to signed values
before being returned.
----------------------------------------------------------------------- *)
Function ParseAIS_9(Var State: TAIS_State; Var Msg: TAISMsg_9): Integer;
Begin
If StrLen(State.six_state.Bits) <> 28 Then
Result := 2
Else
Begin
// Clear out the structure first
FillChar(Msg, SizeOf(Msg), 0);
Msg.msgid := State.msgid;
// Parse the Message 9
Msg.isrepeat := Get6Bit(State.six_state, 2 );
Msg.userid := Get6Bit(State.six_state, 30 );
Msg.altitude := Get6Bit(State.six_state, 12 );
Msg.sog := Get6Bit(State.six_state, 10 );
Msg.pos_acc := Get6Bit(State.six_state, 1 );
Msg.longitude := Get6Bit(State.six_state, 28 );
Msg.latitude := Get6Bit(State.six_state, 27 );
Msg.cog := Get6Bit(State.six_state, 12 );
Msg.utc_sec := Get6Bit(State.six_state, 6 );
Msg.regional := Get6Bit(State.six_state, 8 );
Msg.dte := Get6Bit(State.six_state, 1 );
Msg.spare := Get6Bit(State.six_state, 3 );
Msg.assigned := Get6Bit(State.six_state, 1 );
Msg.raim := Get6Bit(State.six_state, 1 );
Msg.comm_state := Get6Bit(State.six_state, 1 );
If (Msg.comm_state = 0) Then
Begin
Msg.sotdma.sync_state := Get6Bit(State.six_state, 2 );
Msg.sotdma.slot_timeout := Get6Bit(State.six_state, 3 );
Msg.sotdma.sub_message := Get6Bit(State.six_state, 14 );
End
Else
Begin
Msg.itdma.sync_state := Get6Bit(State.six_state, 2 );
Msg.itdma.slot_inc := Get6Bit(State.six_state, 13 );
Msg.itdma.num_slots := Get6Bit(State.six_state, 3 );
Msg.itdma.keep_flag := Get6Bit(State.six_state, 1 );
End;
// Convert the position to signed value
ConvPos(Msg.latitude, Msg.longitude);
Result := 0;
End;
End;
(* -----------------------------------------------------------------------
Parse an AIS message 10 into an aismsg_10 structure
UTC and Date Inquiry
\param state pointer to ais_state
\param result pointer to parsed message result structure to be filled
return:
- 0 if no errors
- 1 if there is an error
- 2 if there is a packet length error
----------------------------------------------------------------------- *)
Function ParseAIS_10(Var State: TAIS_State; Var Msg: TAISMsg_10): Integer;
Begin
If StrLen(State.six_state.Bits) <> 28 Then
Result := 2
Else
Begin
// Clear out the structure first
FillChar(Msg, SizeOf(Msg), 0);
Msg.msgid := State.msgid;
// Parse the Message 10
Msg.isrepeat := Get6Bit(State.six_state, 2 );
Msg.userid := Get6Bit(State.six_state, 30 );
Msg.spare1 := Get6Bit(State.six_state, 2 );
Msg.destination := Get6Bit(State.six_state, 30 );
Msg.spare2 := Get6Bit(State.six_state, 2 );
Result := 0;
End;
End;
(* -----------------------------------------------------------------------
Parse an AIS message 11 into an aismsg_11 structure
UTC and Date Response
\param state pointer to ais_state
\param result pointer to parsed message result structure to be filled
return:
- 0 if no errors
- 1 if there is an error
- 2 if there is a packet length error
----------------------------------------------------------------------- *)
Function ParseAIS_11(Var State: TAIS_State; Var Msg: TAISMsg_11): Integer;
Begin
If StrLen(State.six_state.Bits) <> 28 Then
Result := 2
Else
Begin
// Clear out the structure first
FillChar(Msg, SizeOf(Msg), 0);
Msg.msgid := State.msgid;
// Parse the Message 11
Msg.isrepeat := Get6Bit(State.six_state, 2 );
Msg.userid := Get6Bit(State.six_state, 30 );
Msg.utc_year := Get6Bit(State.six_state, 14 );
Msg.utc_month := Get6Bit(State.six_state, 4 );
Msg.utc_day := Get6Bit(State.six_state, 5 );
Msg.utc_hour := Get6Bit(State.six_state, 5 );
Msg.utc_minute := Get6Bit(State.six_state, 6 );
Msg.utc_second := Get6Bit(State.six_state, 6 );
Msg.pos_acc := Get6Bit(State.six_state, 1 );
Msg.longitude := Get6Bit(State.six_state, 28 );
Msg.latitude := Get6Bit(State.six_state, 27 );
Msg.pos_type := Get6Bit(State.six_state, 4 );
Msg.spare := Get6Bit(State.six_state, 10 );
Msg.raim := Get6Bit(State.six_state, 1 );
Msg.sync_state := Get6Bit(State.six_state, 2 );
Msg.slot_timeout := Get6Bit(State.six_state, 3 );
Msg.sub_message := Get6Bit(State.six_state, 14 );
// Convert the position to signed value
ConvPos(Msg.latitude, Msg.longitude);
Result := 0;
End;
End;
(* -----------------------------------------------------------------------
Parse an AIS message 12 into an aismsg_12 structure
Addressed Safety Related Message
\param state pointer to ais_state
\param result pointer to parsed message result structure to be filled
return:
- 0 if no errors
- 1 if there is an error
- 2 if there is a packet length error
The safety message is converted to ASCII before storage in the
result->message field.
----------------------------------------------------------------------- *)
Function ParseAIS_12(Var State: TAIS_State; Var Msg: TAISMsg_12): Integer;
Var
I,
Len: Integer;
Begin
Len := StrLen(State.six_state.Bits) * 6;
If (Len < 72) Or (Len > 1008) Then
Result := 2
Else
Begin
// Clear out the structure first
FillChar(Msg, SizeOf(Msg), 0);
Msg.msgid := State.msgid;
// Parse the Message 12
Msg.isrepeat := Get6Bit(State.six_state, 2 );
Msg.userid := Get6Bit(State.six_state, 30 );
Msg.sequence := Get6Bit(State.six_state, 2 );
Msg.destination := Get6Bit(State.six_state, 30 );
Msg.retransmit := Get6Bit(State.six_state, 1 );
Msg.spare := Get6Bit(State.six_state, 1 );
// Get the message, convert to ASCII
I := 0;
While (I <> ((Len - 72) Div 6)) Do
Begin
Msg.msg[I] := AIS2ASCII(Get6Bit(State.six_state, 6));
Inc(I);
End;
Msg.msg[I] := #0;
Result := 0;
End;
End;
(* -----------------------------------------------------------------------
Parse an AIS message 13 into an aismsg_13 structure
Safety Related Acknowledge
\param state pointer to ais_state
\param result pointer to parsed message result structure to be filled
return
- 0 if no errors
- 1 if there is an error
- 2 if there is a packet length error
Depending on the length of the message some of the fields may be 0.
result->num_acks has the number of acks received.
----------------------------------------------------------------------- *)
Function ParseAIS_13(Var State: TAIS_State; Var Msg: TAISMsg_13): Integer;
Var
Len: Integer;
Begin
Len := StrLen(State.six_state.Bits) * 6;
If (Len < 72) Or (Len > 168) Then
Result := 2
Else
Begin
// Clear out the structure first
FillChar(Msg, SizeOf(Msg), 0);
Msg.msgid := State.msgid;
// Parse the Message 13
Msg.isrepeat := Get6Bit(State.six_state, 2 );
Msg.userid := Get6Bit(State.six_state, 30 );
Msg.spare := Get6Bit(State.six_state, 2 );
Msg.destid_1 := Get6Bit(State.six_state, 30 );
Msg.sequence_1 := Get6Bit(State.six_state, 2 );
Msg.num_acks := 1;
If (Len > 72) Then
Begin
Msg.destid_2 := Get6Bit(State.six_state, 30 );
Msg.sequence_2 := Get6Bit(State.six_state, 2 );
Inc(Msg.num_acks);
End;
If (Len > 104) Then
Begin
Msg.destid_3 := Get6Bit(State.six_state, 30 );
Msg.sequence_3 := Get6Bit(State.six_state, 2 );
Inc(Msg.num_acks);
End;
If (Len > 136) Then
Begin
Msg.destid_4 := Get6Bit(State.six_state, 30 );
Msg.sequence_4 := Get6Bit(State.six_state, 2 );
Inc(Msg.num_acks);
End;
Result := 0;
End;
End;
(* -----------------------------------------------------------------------
Parse an AIS message 14 into an aismsg_14 structure
Safety Related Broadcast
\param state pointer to ais_state
\param result pointer to parsed message result structure to be filled
return:
- 0 if no errors
- 1 if there is a parameter error
- 2 if there is a packet length error
The safety message is converted to ASCII before storage in the
result->message field.
----------------------------------------------------------------------- *)
Function ParseAIS_14(Var State: TAIS_State; Var Msg: TAISMsg_14): Integer;
Var
I,
Len: Integer;
Begin
Len := StrLen(State.six_state.Bits) * 6;
If (Len < 40) Or (Len > 1008) Then
Result := 2
Else
Begin
// Clear out the structure first
FillChar(Msg, SizeOf(Msg), 0);
Msg.msgid := State.msgid;
// Parse the Message 14
Msg.isrepeat := Get6Bit(State.six_state, 2 );
Msg.userid := Get6Bit(State.six_state, 30 );
Msg.spare := Get6Bit(State.six_state, 2 );
// Get the message, convert to ASCII
I := 0;
While (I <> ((Len - 40) Div 6)) Do
Begin
Msg.msg[I] := AIS2ASCII(Get6Bit(State.six_state, 6));
Inc(I);
End;
Msg.msg[I] := #0;
Result := 0;
End;
End;
(* -----------------------------------------------------------------------
Parse an AIS message 15 into an aismsg_15 structure
Interrogation
\param state pointer to ais_state
\param result pointer to parsed message result structure to be filled
return
- 0 if no errors
- 1 if there is an error
- 2 if there is a packet length error
Depending on the length of the message some if the fields may be 0.
result->num_reqs has the number of interrogation requests.
----------------------------------------------------------------------- *)
Function ParseAIS_15(Var State: TAIS_State; Var Msg: TAISMsg_15): Integer;
Var
Len: Integer;
Begin
Len := StrLen(State.six_state.Bits) * 6;
If (Len < 88) Or (Len > 162) Then
Result := 2
Else
Begin
// Clear out the structure first
FillChar(Msg, SizeOf(Msg), 0);
Msg.msgid := State.msgid;
// Parse the Message 15
Msg.isrepeat := Get6Bit(State.six_state, 2 );
Msg.userid := Get6Bit(State.six_state, 30 );
Msg.spare1 := Get6Bit(State.six_state, 2 );
Msg.destid1 := Get6Bit(State.six_state, 30 );
Msg.msgid1_1 := Get6Bit(State.six_state, 6 );
Msg.offset1_1 := Get6Bit(State.six_state, 12 );
Msg.num_reqs := 1;
If (Len > 88) Then
Begin
Msg.spare2 := Get6Bit(State.six_state, 2 );
Msg.msgid1_2 := Get6Bit(State.six_state, 6 );
Msg.offset1_2 := Get6Bit(State.six_state, 12 );
Msg.num_reqs := 2;
End;
If (Len = 160) Then
Begin
Msg.spare3 := Get6Bit(State.six_state, 2 );
Msg.destid2 := Get6Bit(State.six_state, 30 );
Msg.msgid2_1 := Get6Bit(State.six_state, 6 );
Msg.offset2_1 := Get6Bit(State.six_state, 12 );
Msg.spare4 := Get6Bit(State.six_state, 2 );
Msg.num_reqs := 3;
End;
Result := 0;
End;
End;
(* -----------------------------------------------------------------------
Parse an AIS message 16 into an aismsg_16 structure
Assigned mode command
\param state pointer to ais_state
\param result pointer to parsed message result structure to be filled
return
- 0 if no errors
- 1 if there is an error
- 2 if there is a packet length error
Depending on the length of the message some of the fields may be 0.
result->num_cmds has the number of commands received.
----------------------------------------------------------------------- *)
Function ParseAIS_16(Var State: TAIS_State; Var Msg: TAISMsg_16): Integer;
Var
Len: Integer;
Begin
Len := StrLen(State.six_state.Bits) * 6;
If (Len <> 96) And (Len <> 144) Then
Result := 2
Else
Begin
// Clear out the structure first
FillChar(Msg, SizeOf(Msg), 0);
Msg.msgid := State.msgid;
// Parse the Message 16
Msg.isrepeat := Get6Bit(State.six_state, 2 );
Msg.userid := Get6Bit(State.six_state, 30 );
Msg.spare1 := Get6Bit(State.six_state, 2 );
Msg.destid_a := Get6Bit(State.six_state, 30 );
Msg.offset_a := Get6Bit(State.six_state, 12 );
Msg.increment_a := Get6Bit(State.six_state, 10 );
Msg.num_cmds := 1;
If (Len = 144) Then
Begin
Msg.destid_b := Get6Bit(State.six_state, 30 );
Msg.offset_b := Get6Bit(State.six_state, 12 );
Msg.increment_b := Get6Bit(State.six_state, 10 );
Msg.spare2 := Get6Bit(State.six_state, 4 );
Msg.num_cmds := 2;
End;
Result := 0;
End;
End;
(* -----------------------------------------------------------------------
Parse an AIS message 17 into an aismsg_17 structure
GNSS Binary Broadcast Message
\param state pointer to ais_state
\param result pointer to parsed message result structure to be filled
return:
- 0 if no errors
- 1 if there is an error
- 2 if there is a packet length error
Note: the binary payload of the message is left in its 6-bit ASCII
form when stored into result->data. This allows the data to
be passed to the sixbit module for parsing.
----------------------------------------------------------------------- *)
Function ParseAIS_17(Var State: TAIS_State; Var Msg: TAISMsg_17): Integer;
Var
Len: Integer;
Begin
Len := StrLen(State.six_state.Bits) * 6;
If (Len < 80) Or (Len > 816) Then
Result := 2
Else
Begin
// Clear out the structure first
FillChar(Msg, SizeOf(Msg), 0);
Msg.msgid := State.msgid;
// Parse the Message 17
Msg.isrepeat := Get6Bit(State.six_state, 2 );
Msg.userid := Get6Bit(State.six_state, 30 );
Msg.spare1 := Get6Bit(State.six_state, 2 );
Msg.longitude := Get6Bit(State.six_state, 18 );
Msg.latitude := Get6Bit(State.six_state, 17 );
Msg.spare2 := Get6Bit(State.six_state, 5 );
Msg.msg_type := Get6Bit(State.six_state, 6 );
Msg.station_id := Get6Bit(State.six_state, 10 );
Msg.z_count := Get6Bit(State.six_state, 13 );
Msg.seq_num := Get6Bit(State.six_state, 3 );
Msg.num_words := Get6Bit(State.six_state, 5 );
Msg.health := Get6Bit(State.six_state, 3 );
// Store the remaining payload of the packet as 6-bit data
StrLCopy(@Msg.data, State.six_state.p, 117);
// Convert the position to signed value
ConvPos(Msg.latitude, Msg.longitude);
Result := 0;
End;
End;
(* -----------------------------------------------------------------------
Parse an AIS message 18 into an aismsg_18 structure
Class B Position Report
\param state pointer to ais_state
\param result pointer to parsed message result structure to be filled
return:
- 0 if no errors
- 1 if there is an error
- 2 if there is a packet length error
Note that the latitude and longitude are converted to signed values
before being returned.
----------------------------------------------------------------------- *)
Function ParseAIS_18(Var State: TAIS_State; Var Msg: TAISMsg_18): Integer;
Begin
If StrLen(State.six_state.Bits) <> 28 Then
Result := 2
Else
Begin
// Clear out the structure first
FillChar(Msg, SizeOf(Msg), 0);
Msg.msgid := State.msgid;
// Parse the Message 18
Msg.isrepeat := Get6Bit(State.six_state, 2 );
Msg.userid := Get6Bit(State.six_state, 30 );
Msg.regional1 := Get6Bit(State.six_state, 8 );
Msg.sog := Get6Bit(State.six_state, 10 );
Msg.pos_acc := Get6Bit(State.six_state, 1 );
Msg.longitude := Get6Bit(State.six_state, 28 );
Msg.latitude := Get6Bit(State.six_state, 27 );
Msg.cog := Get6Bit(State.six_state, 12 );
Msg.true := Get6Bit(State.six_state, 9 );
Msg.utc_sec := Get6Bit(State.six_state, 6 );
Msg.regional2 := Get6Bit(State.six_state, 2 );
Msg.unit_flag := Get6Bit(State.six_state, 1 );
Msg.display_flag := Get6Bit(State.six_state, 1 );
Msg.dsc_flag := Get6Bit(State.six_state, 1 );
Msg.band_flag := Get6Bit(State.six_state, 1 );
Msg.msg22_flag := Get6Bit(State.six_state, 1 );
Msg.mode_flag := Get6Bit(State.six_state, 1 );
Msg.raim := Get6Bit(State.six_state, 1 );
Msg.comm_state := Get6Bit(State.six_state, 1 );
If (Msg.comm_state = 0) Then
Begin
Msg.sotdma.sync_state := Get6Bit(State.six_state, 2 );
Msg.sotdma.slot_timeout := Get6Bit(State.six_state, 3 );
Msg.sotdma.sub_message := Get6Bit(State.six_state, 14 );
End
Else
Begin
Msg.itdma.sync_state := Get6Bit(State.six_state, 2 );
Msg.itdma.slot_inc := Get6Bit(State.six_state, 13 );
Msg.itdma.num_slots := Get6Bit(State.six_state, 3 );
Msg.itdma.keep_flag := Get6Bit(State.six_state, 1 );
End;
// Convert the position to signed value
ConvPos(Msg.latitude, Msg.longitude);
Result := 0;
End;
End;
(* -----------------------------------------------------------------------
Parse an AIS message 19 into an aismsg_19 structure
Extended Class B Position Report
\param state pointer to ais_state
\param result pointer to parsed message result structure to be filled
return:
- 0 if no errors
- 1 if there is an error
- 2 if there is a packet length error
Note that the latitude and longitude are converted to signed values
before being returned. And the ship's name is converted to ASCII
before being stored.
----------------------------------------------------------------------- *)
Function ParseAIS_19(Var State: TAIS_State; Var Msg: TAISMsg_19): Integer;
Var
I: Integer;
Begin
If StrLen(State.six_state.Bits) <> 52 Then
Result := 2
Else
Begin
// Clear out the structure first
FillChar(Msg, SizeOf(Msg), 0);
Msg.msgid := State.msgid;
// Parse the Message 19
Msg.isrepeat := Get6Bit(State.six_state, 2 );
Msg.userid := Get6Bit(State.six_state, 30 );
Msg.regional1 := Get6Bit(State.six_state, 8 );
Msg.sog := Get6Bit(State.six_state, 10 );
Msg.pos_acc := Get6Bit(State.six_state, 1 );
Msg.longitude := Get6Bit(State.six_state, 28 );
Msg.latitude := Get6Bit(State.six_state, 27 );
Msg.cog := Get6Bit(State.six_state, 12 );
Msg.true := Get6Bit(State.six_state, 9 );
Msg.utc_sec := Get6Bit(State.six_state, 6 );
Msg.regional2 := Get6Bit(State.six_state, 4 );
// Get the Ship Name, convert to ASCII
For I := 0 To 19 Do
Msg.name[I] := AIS2ASCII(Get6Bit(State.six_state, 6 ));
Msg.name[20] := #0;
Msg.ship_type := Get6Bit(State.six_state, 8 );
Msg.dim_bow := Get6Bit(State.six_state, 9 );
Msg.dim_stern := Get6Bit(State.six_state, 9 );
Msg.dim_port := Get6Bit(State.six_state, 6 );
Msg.dim_starboard:= Get6Bit(State.six_state, 6 );
Msg.pos_type := Get6Bit(State.six_state, 4 );
Msg.raim := Get6Bit(State.six_state, 1 );
Msg.dte := Get6Bit(State.six_state, 1 );
Msg.spare := Get6Bit(State.six_state, 5 );
// Convert the position to signed value
ConvPos(Msg.latitude, Msg.longitude);
Result := 0;
End;
End;
(* -----------------------------------------------------------------------
Parse an AIS message 20 into an aismsg_20 structure
Data link management message
\param state pointer to ais_state
\param result pointer to parsed message result structure to be filled
return:
- 0 if no errors
- 1 if there is an error
- 2 if there is a packet length error
Depending on the length of the message some fields may be 0.
result->num_cmds will have the number of commands received.
----------------------------------------------------------------------- *)
Function ParseAIS_20(Var State: TAIS_State; Var Msg: TAISMsg_20): Integer;
Var
Len: Integer;
Begin
Len := StrLen(State.six_state.Bits) * 6;
If (Len < 72) Or (Len > 162) Then
Result := 2
Else
Begin
// Clear out the structure first
FillChar(Msg, SizeOf(Msg), 0);
Msg.msgid := State.msgid;
// Parse the Message 20
Msg.isrepeat := Get6Bit(State.six_state, 2 );
Msg.userid := Get6Bit(State.six_state, 30 );
Msg.spare1 := Get6Bit(State.six_state, 2 );
Msg.offset1 := Get6Bit(State.six_state, 12 );
Msg.slots1 := Get6Bit(State.six_state, 4 );
Msg.timeout1 := Get6Bit(State.six_state, 3 );
Msg.increment1 := Get6Bit(State.six_state, 11 );
Msg.num_cmds := 1;
If (Len > 72) Then
Begin
Msg.offset2 := Get6Bit(State.six_state, 12 );
Msg.slots2 := Get6Bit(State.six_state, 4 );
Msg.timeout2 := Get6Bit(State.six_state, 3 );
Msg.increment2 := Get6Bit(State.six_state, 11 );
Msg.num_cmds := 2;
End;
If (Len > 104) Then
Begin
Msg.offset3 := Get6Bit(State.six_state, 12 );
Msg.slots3 := Get6Bit(State.six_state, 4 );
Msg.timeout3 := Get6Bit(State.six_state, 3 );
Msg.increment3 := Get6Bit(State.six_state, 11 );
Msg.num_cmds := 3;
End;
If (Len > 136) Then
Begin
Msg.offset4 := Get6Bit(State.six_state, 12 );
Msg.slots4 := Get6Bit(State.six_state, 4 );
Msg.timeout4 := Get6Bit(State.six_state, 3 );
Msg.increment4 := Get6Bit(State.six_state, 11 );
Msg.num_cmds := 4;
End;
Result := 0;
End;
End;
(* -----------------------------------------------------------------------
Parse an AIS message 21 into an aismsg_21 structure
Aids To Navigation position report (AtoN)
\param state pointer to ais_state
\param result pointer to parsed message result structure to be filled
return:
- 0 if no errors
- 1 if there is an error
- 2 if there is a packet length error
Note that the latitude and longitude are converted to signed values
before being returned. And the AtoN name and extended name are converted
to ASCII before storage.
----------------------------------------------------------------------- *)
Function ParseAIS_21(Var State: TAIS_State; Var Msg: TAISMsg_21): Integer;
Var
I,
Len: Integer;
Begin
Len := StrLen(State.six_state.Bits) * 6;
If (Len < 272) Or (Len > 360) Then
Result := 2
Else
Begin
// Clear out the structure first
FillChar(Msg, SizeOf(Msg), 0);
Msg.msgid := State.msgid;
// Parse the Message 21
Msg.isrepeat := Get6Bit(State.six_state, 2 );
Msg.userid := Get6Bit(State.six_state, 30 );
Msg.aton_type := Get6Bit(State.six_state, 5 );
// Get the AtoN name, convert to ASCII
For I := 0 To 19 Do
Msg.name[I] := AIS2ASCII(Get6Bit(State.six_state, 6 ));
Msg.name[20] := #0;
Msg.pos_acc := Get6Bit(State.six_state, 1 );
Msg.longitude := Get6Bit(State.six_state, 28 );
Msg.latitude := Get6Bit(State.six_state, 27 );
Msg.dim_bow := Get6Bit(State.six_state, 9 );
Msg.dim_stern := Get6Bit(State.six_state, 9 );
Msg.dim_port := Get6Bit(State.six_state, 6 );
Msg.dim_starboard := Get6Bit(State.six_state, 6 );
Msg.pos_type := Get6Bit(State.six_state, 4 );
Msg.utc_sec := Get6Bit(State.six_state, 6 );
Msg.off_position := Get6Bit(State.six_state, 1 );
Msg.regional := Get6Bit(State.six_state, 8 );
Msg.raim := Get6Bit(State.six_state, 1 );
Msg.virtual := Get6Bit(State.six_state, 1 );
Msg.assigned := Get6Bit(State.six_state, 1 );
Msg.spare1 := Get6Bit(State.six_state, 1 );
If (Len > 272) Then
Begin
// Get the extended name 1-14 characters
I := 0;
While (I < ((Len - 272) / 6)) Do
Begin
Msg.name_ext[I] := AIS2ASCII(Get6Bit(State.six_state, 6));
Inc(I);
End;
Msg.name_ext[I] := #0;
End;
// Convert the position to signed value
ConvPos(Msg.latitude, Msg.longitude);
Result := 0;
End;
End;
(* -----------------------------------------------------------------------
Parse an AIS message 22 into an aismsg_22 structure
Channel Management
\param state pointer to ais_state
\param result pointer to parsed message result structure to be filled
return
- 0 if no errors
- 1 if there is an error
- 2 if there is a packet length error
Check the addressed flag to decide whether to use the positions in
NE and SW or the addresses in addressed_1 and addressed_2
Note that the latitudes and longitudes are converted to signed values
before being returned and that they are converted to 1/10000 minute
format from 1/1000 minute as received.
----------------------------------------------------------------------- *)
Function ParseAIS_22(Var State: TAIS_State; Var Msg: TAISMsg_22): Integer;
Begin
If StrLen(State.six_state.Bits) <> 28 Then
Result := 2
Else
Begin
// Clear out the structure first
FillChar(Msg, SizeOf(Msg), 0);
Msg.msgid := State.msgid;
// Parse the Message 22
Msg.isrepeat := Get6Bit(State.six_state, 2 );
Msg.userid := Get6Bit(State.six_state, 30 );
Msg.spare1 := Get6Bit(State.six_state, 1 );
Msg.channel_a := Get6Bit(State.six_state, 12 );
Msg.channel_b := Get6Bit(State.six_state, 12 );
Msg.txrx_mode := Get6Bit(State.six_state, 4 );
Msg.power := Get6Bit(State.six_state, 1 );
Msg.NE_longitude := Get6Bit(State.six_state, 18 );
Msg.NE_latitude := Get6Bit(State.six_state, 17 );
Msg.SW_longitude := Get6Bit(State.six_state, 18 );
Msg.SW_latitude := Get6Bit(State.six_state, 17 );
Msg.addressed := Get6Bit(State.six_state, 1 );
Msg.bw_a := Get6Bit(State.six_state, 1 );
Msg.bw_b := Get6Bit(State.six_state, 1 );
Msg.tz_size := Get6Bit(State.six_state, 3 );
// Is the position actually an address?
If (Msg.addressed <> 0) Then
Begin
// Convert the positions to addresses
Msg.addressed_1 := (Msg.NE_longitude Shl 12) + (Msg.NE_latitude Shr 5);
Msg.addressed_2 := (Msg.SW_longitude Shl 12) + (Msg.SW_latitude Shr 5);
End
Else
Begin
// Convert 1/10 to 1/10000 before conversion
Msg.NE_longitude := Msg.NE_longitude * 1000;
Msg.NE_latitude := Msg.NE_latitude * 1000;
Msg.SW_longitude := Msg.SW_longitude * 1000;
Msg.SW_latitude := Msg.SW_latitude * 1000;
End;
// Convert the position to signed value
ConvPos(Msg.NE_latitude, Msg.NE_longitude);
ConvPos(Msg.SW_latitude, Msg.SW_longitude);
Result := 0;
End;
End;
(* -----------------------------------------------------------------------
Parse an AIS message 23 into an aismsg_23 structure
Group Assignment Command
\param state pointer to ais_state
\param result pointer to parsed message result structure to be filled
return:
- 0 if no errors
- 1 if there is an error
- 2 if there is a packet length error
Note that the latitudes and longitudes are converted to signed values
before being returned and that they are converted to 1/10000 minute
format from 1/1000 minute as received.
----------------------------------------------------------------------- *)
Function ParseAIS_23(Var State: TAIS_State; Var Msg: TAISMsg_23): Integer;
Begin
If StrLen(State.six_state.Bits) <> 28 Then
Result := 2
Else
Begin
// Clear out the structure first
FillChar(Msg, SizeOf(Msg), 0);
Msg.msgid := State.msgid;
// Parse the Message 23
Msg.isrepeat := Get6Bit(State.six_state, 2 );
Msg.userid := Get6Bit(State.six_state, 30 );
Msg.spare1 := Get6Bit(State.six_state, 2 );
Msg.NE_longitude := Get6Bit(State.six_state, 18 );
Msg.NE_latitude := Get6Bit(State.six_state, 17 );
Msg.SW_longitude := Get6Bit(State.six_state, 18 );
Msg.SW_latitude := Get6Bit(State.six_state, 17 );
Msg.station_type := Get6Bit(State.six_state, 4 );
Msg.ship_type := Get6Bit(State.six_state, 8 );
Msg.spare2 := Get6Bit(State.six_state, 22 );
Msg.txrx_mode := Get6Bit(State.six_state, 2 );
Msg.report_interval:= Get6Bit(State.six_state, 4 );
Msg.quiet_time := Get6Bit(State.six_state, 4 );
Msg.spare3 := Get6Bit(State.six_state, 6 );
Msg.NE_longitude := Msg.NE_longitude * 1000;
Msg.NE_latitude := Msg.NE_latitude * 1000;
Msg.SW_longitude := Msg.SW_longitude * 1000;
Msg.SW_latitude := Msg.SW_latitude * 1000;
// Convert the position to signed value
ConvPos(Msg.NE_latitude, Msg.NE_longitude);
ConvPos(Msg.SW_latitude, Msg.SW_longitude);
Result := 0;
End;
End;
(* -----------------------------------------------------------------------
Parse an AIS message 24 into an aismsg_24 structure
Class B"CS" Static Data Report
\param state pointer to ais_state
\param result pointer to parsed message result structure to be filled
return:
- 0 if no errors
- 1 if there is an error
- 2 if there is a packet length error
- 3 if unknown part number
Message 24 is a 2 part message. The first part only contains the MMSI
and the ship name. The second message contains the ship dimensions,
etc.
Check the result->part_number field to determine which message this
is. The same structure is used for both messages and the result->flags
field will have a 0x03 in it when both messages have been parsed.
The ship name, vendor id and callsign are all converted to ASCII before
storage.
Note that the latitude and longitude are converted to signed values
before being returned
----------------------------------------------------------------------- *)
Function ParseAIS_24(Var State: TAIS_State; Var Msg: TAISMsg_24): Integer;
Var
I,
Len: Integer;
Begin
Len := StrLen(State.six_state.Bits) * 6;
If (Len <> 162) And (Len <> 168) Then
Result := 2
Else
Begin
// Clear out the structure first
FillChar(Msg, SizeOf(Msg), 0);
Msg.msgid := State.msgid;
// Parse the Message 24
Msg.isrepeat := Get6Bit(State.six_state, 2 );
Msg.userid := Get6Bit(State.six_state, 30 );
Msg.part_number := Get6Bit(State.six_state, 2 );
If (Msg.part_number = 0) Then
Begin
// Parse 24A
// Get the Ship Name, convert to ASCII
For I := 0 To 19 Do
Msg.name[I] := AIS2ASCII(Get6Bit(State.six_state, 6 ));
Msg.name[20] := #0;
// Indicate reception of part A
Msg.flags := Msg.flags Or $01;
End
Else If (Msg.part_number = 1) Then
Begin
// Parse 24B
Msg.ship_type := Get6Bit(State.six_state, 8 );
For I := 0 To 6 Do
Msg.vendor_id[I] := AIS2ASCII(Get6Bit(State.six_state, 6 ));
Msg.name[7] := #0;
For I := 0 To 6 Do
Msg.callsign[I] := AIS2ASCII(Get6Bit(State.six_state, 6 ));
Msg.name[7] := #0;
Msg.dim_bow := Get6Bit(State.six_state, 9 );
Msg.dim_stern := Get6Bit(State.six_state, 9 );
Msg.dim_port := Get6Bit(State.six_state, 6 );
Msg.dim_starboard:= Get6Bit(State.six_state, 6 );
Msg.spare := Get6Bit(State.six_state, 6 );
// Indicate reception of part A
Msg.flags := Msg.flags Or $02;
End
Else
Begin
Result := 3;
Exit;
End;
Result := 0;
End;
End;
End.
|
{*******************************************************************************
作者: dmzn@163.com 2008-08-07
描述: 系统数据库常量定义
备注:
*.自动创建SQL语句,支持变量:$Inc,自增;$Float,浮点;$Integer=sFlag_Integer;
$Decimal=sFlag_Decimal;$Image,二进制流
*******************************************************************************}
unit USysDB;
{$I Link.inc}
interface
uses
SysUtils, Classes;
const
cSysDatabaseName: array[0..4] of String = (
'Access', 'SQL', 'MySQL', 'Oracle', 'DB2');
//db names
type
TSysDatabaseType = (dtAccess, dtSQLServer, dtMySQL, dtOracle, dtDB2);
//db types
PSysTableItem = ^TSysTableItem;
TSysTableItem = record
FTable: string;
FNewSQL: string;
end;
//系统表项
var
gSysTableList: TList = nil; //系统表数组
gSysDBType: TSysDatabaseType = dtSQLServer; //系统数据类型
//------------------------------------------------------------------------------
const
//自增字段
sField_Access_AutoInc = 'Counter';
sField_SQLServer_AutoInc = 'Integer IDENTITY (1,1) PRIMARY KEY';
//小数字段
sField_Access_Decimal = 'Float';
sField_SQLServer_Decimal = 'Decimal(15, 5)';
//图片字段
sField_Access_Image = 'OLEObject';
sField_SQLServer_Image = 'Image';
//日期相关
sField_SQLServer_Now = 'getDate()';
ResourceString
{*权限项*}
sPopedom_Read = 'A'; //浏览
sPopedom_Add = 'B'; //添加
sPopedom_Edit = 'C'; //修改
sPopedom_Delete = 'D'; //删除
sPopedom_Preview = 'E'; //预览
sPopedom_Print = 'F'; //打印
sPopedom_Export = 'G'; //导出
{*相关标记*}
sFlag_Yes = 'Y'; //是
sFlag_No = 'N'; //否
sFlag_Unknow = 'U'; //未知
sFlag_Enabled = 'Y'; //启用
sFlag_Disabled = 'N'; //禁用
sFlag_Integer = 'I'; //整数
sFlag_Decimal = 'D'; //小数
sFlag_TypeVIP = 'V';
sFlag_TypeCommon = 'C';
sFlag_NotMatter = '@'; //无关编号(任意编号都可)
sFlag_ForceDone = '#'; //强制完成(未完成前不换)
sFlag_FixedNo = '$'; //指定编号(使用相同编号)
sFlag_ForceHint = 'Bus_HintMsg'; //强制提示
sFlag_SerailSYS = 'SYSTableID'; //SYS编码组
sFlag_TruckLog = 'SYS_TruckLog'; //车辆记录
sFlag_PoundLog = 'SYS_PoundLog'; //过磅记录
sFlag_SysParam = 'SysParam'; //系统参数
sFlag_Company = 'Company'; //公司名
sFlag_ValidDate = 'SysValidDate'; //有效期
sFlag_JBTime = 'JiaoBanTime'; //交班时间
sFlag_JBParam = 'JiaoBanParam'; //交班参数
sFlag_AutoIn = 'Truck_AutoIn'; //自动进厂
sFlag_AutoOut = 'Truck_AutoOut'; //自动出厂
sFlag_EnableBakdb = 'Uses_BackDB'; //备用库
sFlag_CusType = 'CustomerType'; //客户类型
sFlag_SAPSrvURL = 'SAPServiceURL';
sFlag_MITSrvURL = 'MITServiceURL';
sFlag_HardSrvURL = 'HardMonURL';
sFlag_CommonItem = 'CommonItem'; //公共信息
sFlag_SaveKeepTime = 'SaveKeepTime'; //保存记录间隔
sFlag_ProviderItem = 'ProviderItem'; //供应商信息项
sFlag_CustomerItem = 'CustomerItem'; //客户信息项
{*数据表*}
sTable_Group = 'Sys_Group'; //用户组
sTable_User = 'Sys_User'; //用户表
sTable_Menu = 'Sys_Menu'; //菜单表
sTable_Popedom = 'Sys_Popedom'; //权限表
sTable_PopItem = 'Sys_PopItem'; //权限项
sTable_Entity = 'Sys_Entity'; //字典实体
sTable_DictItem = 'Sys_DataDict'; //字典明细
sTable_SysDict = 'Sys_Dict'; //系统字典
sTable_ExtInfo = 'Sys_ExtInfo'; //附加信息
sTable_SysLog = 'Sys_EventLog'; //系统日志
sTable_BaseInfo = 'Sys_BaseInfo'; //基础信息
sTable_SerialBase = 'Sys_SerialBase'; //编码种子
sTable_SerialStatus = 'Sys_SerialStatus'; //编号状态
sTable_Card = 'S_Card'; //销售磁卡
sTable_Truck = 'S_Truck'; //车辆表
sTable_TruckLog = 'S_TruckLog'; //车辆日志
sTable_HYReader = 'S_HYReader'; //车辆日志
sTable_Provider = 'P_Provider'; //客户表
sTable_PoundLog = 'S_PoundLog'; //过磅数据
sTable_PoundBak = 'S_PoundBak'; //过磅作废
sTable_Picture = 'Sys_Picture'; //存放图片
{*新建表*}
sSQL_NewSysDict = 'Create Table $Table(D_ID $Inc, D_Name varChar(15),' +
'D_Desc varChar(30), D_Value varChar(50), D_Memo varChar(20),' +
'D_ParamA $Float, D_ParamB varChar(50), D_Index Integer Default 0)';
{-----------------------------------------------------------------------------
系统字典: SysDict
*.D_ID: 编号
*.D_Name: 名称
*.D_Desc: 描述
*.D_Value: 取值
*.D_Memo: 相关信息
*.D_ParamA: 浮点参数
*.D_ParamB: 字符参数
*.D_Index: 显示索引
-----------------------------------------------------------------------------}
sSQL_NewExtInfo = 'Create Table $Table(I_ID $Inc, I_Group varChar(20),' +
'I_ItemID varChar(20), I_Item varChar(30), I_Info varChar(500),' +
'I_ParamA $Float, I_ParamB varChar(50), I_Index Integer Default 0)';
{-----------------------------------------------------------------------------
扩展信息表: ExtInfo
*.I_ID: 编号
*.I_Group: 信息分组
*.I_ItemID: 信息标识
*.I_Item: 信息项
*.I_Info: 信息内容
*.I_ParamA: 浮点参数
*.I_ParamB: 字符参数
*.I_Memo: 备注信息
*.I_Index: 显示索引
-----------------------------------------------------------------------------}
sSQL_NewSysLog = 'Create Table $Table(L_ID $Inc, L_Date DateTime,' +
'L_Man varChar(32),L_Group varChar(20), L_ItemID varChar(20),' +
'L_KeyID varChar(20), L_Event varChar(220))';
{-----------------------------------------------------------------------------
系统日志: SysLog
*.L_ID: 编号
*.L_Date: 操作日期
*.L_Man: 操作人
*.L_Group: 信息分组
*.L_ItemID: 信息标识
*.L_KeyID: 辅助标识
*.L_Event: 事件
-----------------------------------------------------------------------------}
sSQL_NewBaseInfo = 'Create Table $Table(B_ID $Inc, B_Group varChar(15),' +
'B_Text varChar(100), B_Py varChar(25), B_Memo varChar(50),' +
'B_PID Integer, B_Index Float)';
{-----------------------------------------------------------------------------
基本信息表: BaseInfo
*.B_ID: 编号
*.B_Group: 分组
*.B_技术部Text: 内容
*.B_Py: 拼音简写
*.B_Memo: 备注信息
*.B_PID: 上级节点
*.B_Index: 创建顺序
-----------------------------------------------------------------------------}
sSQL_NewSerialBase = 'Create Table $Table(R_ID $Inc, B_Group varChar(15),' +
'B_Object varChar(32), B_Prefix varChar(25), B_IDLen Integer,' +
'B_Base Integer, B_Date DateTime)';
{-----------------------------------------------------------------------------
串行编号基数表: SerialBase
*.R_ID: 编号
*.B_Group: 分组
*.B_Object: 对象
*.B_Prefix: 前缀
*.B_IDLen: 编号长
*.B_Base: 基数
*.B_Date: 参考日期
-----------------------------------------------------------------------------}
sSQL_NewSerialStatus = 'Create Table $Table(R_ID $Inc, S_Object varChar(32),' +
'S_SerailID varChar(32), S_PairID varChar(32), S_Status Char(1),' +
'S_Date DateTime)';
{-----------------------------------------------------------------------------
串行状态表: SerialStatus
*.R_ID: 编号
*.S_Object: 对象
*.S_SerailID: 串行编号
*.S_PairID: 配对编号
*.S_Status: 状态(Y,N)
*.S_Date: 创建时间
-----------------------------------------------------------------------------}
sSQL_NewCard = 'Create Table $Table(R_ID $Inc, C_Card varChar(16),' +
'C_Card2 varChar(32), C_Card3 varChar(32),' +
'C_Owner varChar(15), C_TruckNo varChar(15), C_Status Char(1),' +
'C_Freeze Char(1), C_Used Char(1), C_UseTime Integer Default 0,' +
'C_Man varChar(32), C_Date DateTime, C_Memo varChar(500))';
{-----------------------------------------------------------------------------
磁卡表:Card
*.R_ID:记录编号
*.C_Card:主卡号
*.C_Card2,C_Card3:副卡号
*.C_Owner:持有人标识
*.C_TruckNo:提货车牌
*.C_Used:用途(供应,销售)
*.C_UseTime:使用次数
*.C_Status:状态(空闲,使用,注销,挂失)
*.C_Freeze:是否冻结
*.C_Man:办理人
*.C_Date:办理时间
*.C_Memo:备注信息
-----------------------------------------------------------------------------}
sSQL_NewTruck = 'Create Table $Table(R_ID $Inc, T_Truck varChar(15), ' +
'T_PY varChar(15), T_Owner varChar(32), T_Phone varChar(15), T_Used Char(1), ' +
'T_PrePValue $Float, T_PrePMan varChar(32), T_PrePTime DateTime, ' +
'T_PrePUse Char(1), T_MinPVal $Float, T_MaxPVal $Float, ' +
'T_PValue $Float Default 0, T_PTime Integer Default 0,' +
'T_PlateColor varChar(12),T_Type varChar(12), T_LastTime DateTime, ' +
'T_Card varChar(32), T_CardUse Char(1), T_NoVerify Char(1),' +
'T_Valid Char(1), T_VIPTruck Char(1), T_HasGPS Char(1),' +
'T_StartTime DateTime, T_EndTime DateTime, ' +
'T_MatePID varChar(15), T_MateID varChar(15), T_MateName varChar(80),' +
'T_SrcAddr varChar(150), T_DestAddr varChar(150)' +
')';
{-----------------------------------------------------------------------------
车辆信息:Truck
*.R_ID: 记录号
*.T_Truck: 车牌号
*.T_PY: 车牌拼音
*.T_Owner: 车主
*.T_Phone: 联系方式
*.T_Used: 用途(供应,销售)
*.T_PrePValue: 预置皮重
*.T_PrePMan: 预置司磅
*.T_PrePTime: 预置时间
*.T_PrePUse: 使用预置
*.T_MinPVal: 历史最小皮重
*.T_MaxPVal: 历史最大皮重
*.T_PValue: 有效皮重
*.T_PTime: 过皮次数
*.T_PlateColor: 车牌颜色
*.T_Type: 车型
*.T_LastTime: 上次活动
*.T_Card: 电子标签
*.T_CardUse: 使用电子签(Y/N)
*.T_NoVerify: 不校验时间
*.T_Valid: 是否有效
*.T_VIPTruck:是否VIP
*.T_HasGPS:安装GPS(Y/N)
//---------------------------短倒业务数据信息--------------------------------
*.T_MatePID:上个物料编号
*.T_MateID:物料编号
*.T_MateName: 物料名称
*.T_SrcAddr:倒出地址
*.T_DestAddr:倒入地址
---------------------------------------------------------------------------//
有效平均皮重算法:
T_PValue = (T_PValue * T_PTime + 新皮重) / (T_PTime + 1)
-----------------------------------------------------------------------------}
sSQL_NewTruckLog = 'Create Table $Table(R_ID $Inc, T_ID varChar(15),' +
'T_Truck varChar(15),T_Status Char(1), T_NextStatus Char(1),' +
'T_IsHK Char(1),' +
'T_InTime DateTime, T_InMan varChar(32),' +
'T_OutTime DateTime, T_OutMan varChar(32),' +
'T_BFPTime DateTime, T_BFPMan varChar(32), T_BFPValue $Float Default 0,' +
'T_BFMTime DateTime, T_BFMMan varChar(32), T_BFMValue $Float Default 0,' +
'T_FHSTime DateTime, T_FHETime DateTime, T_FHLenth Integer,' +
'T_FHMan varChar(32), T_FHValue Decimal(15,5),' +
'T_ZTTime DateTime, T_ZTMan varChar(32),' +
'T_ZTValue $Float,T_ZTCount Integer, T_ZTDiff Integer)';
{-----------------------------------------------------------------------------
车辆日志:TruckLog
*.T_ID:记录编号
*.T_Truck:车牌号
*.T_Status,T_NextStatus:状态
*.T_IsHK: 是否合卡
*.T_InTime,T_InMan:进厂时间,放行人
*.T_OutTime,T_OutMan:出厂时间,放行人
*.T_BFPTime,T_BFPMan,T_BFPValue:皮重时间,操作人,皮重
*.T_BFMTime,T_BFMMan,T_BFMValue:毛重时间,操作人,毛重
*.T_FHSTime,T_FHETime,
T_FHLenth,T_FHMan,T_FHValue:开始时间,结束时间,时长操作人,放灰量
*.T_ZTTime,T_ZTMan,
T_ZTValue,T_ZTCount,T_ZTDiff:栈台时间,操作人,提货量,袋数,补差
-----------------------------------------------------------------------------}
sSQL_NewHYReader = 'Create Table $Table(R_ID $Inc, H_ID varChar(32),' +
'H_Name varChar(32), H_Host varChar(25), H_Port Integer,' +
'H_Memo varChar(64))';
{-----------------------------------------------------------------------------
门岗读卡器表: HYReader
*.R_ID: 编号
*.H_ID: 读卡器编号
*.H_Name: 名称
*.H_Host: IP地址
*.H_Port: 端口
*.H_Memo: 备注
-----------------------------------------------------------------------------}
sSQL_NewPoundLog = 'Create Table $Table(R_ID $Inc, P_ID varChar(15),' +
'P_Type varChar(1), P_Order varChar(20), P_Card varChar(16),' +
'P_Bill varChar(20), P_Truck varChar(15), P_CusID varChar(32),' +
'P_CusName varChar(80), P_MID varChar(32),P_MName varChar(80),' +
'P_MType varChar(10), P_LimValue $Float,' +
'P_PValue $Float, P_PDate DateTime, P_PMan varChar(32), ' +
'P_MValue $Float, P_MDate DateTime, P_MMan varChar(32), ' +
'P_FactID varChar(32), P_Station varChar(10), P_MAC varChar(32),' +
'P_Direction varChar(10), P_PModel varChar(10), P_Status Char(1),' +
'P_Valid Char(1), P_PrintNum Integer Default 1,' +
'P_DelMan varChar(32), P_DelDate DateTime)';
{-----------------------------------------------------------------------------
过磅记录: Materails
*.P_ID: 编号
*.P_Type: 类型(销售,供应,临时)
*.P_Order: 订单号
*.P_Bill: 交货单
*.P_Truck: 车牌
*.P_CusID: 客户号
*.P_CusName: 物料名
*.P_MID: 物料号
*.P_MName: 物料名
*.P_MType: 包,散等
*.P_LimValue: 票重
*.P_PValue,P_PDate,P_PMan: 皮重
*.P_MValue,P_MDate,P_MMan: 毛重
*.P_FactID: 工厂编号
*.P_Station,P_MAC: 磅站标识
*.P_Direction: 物料流向(进,出)
*.P_PModel: 过磅模式(标准,配对等)
*.P_Status: 记录状态
*.P_Valid: 是否有效
*.P_PrintNum: 打印次数
*.P_DelMan,P_DelDate: 删除记录
-----------------------------------------------------------------------------}
sSQL_NewProvider = 'Create Table $Table(R_ID $Inc, P_ID varChar(32),' +
'P_Name varChar(80),P_PY varChar(80), P_Phone varChar(20),' +
'P_Saler varChar(32),P_Memo varChar(50))';
{-----------------------------------------------------------------------------
供应商: Provider
*.P_ID: 编号
*.P_Name: 名称
*.P_PY: 拼音简写
*.P_Phone: 联系方式
*.P_Saler: 业务员
*.P_Memo: 备注
-----------------------------------------------------------------------------}
sSQL_NewPicture = 'Create Table $Table(R_ID $Inc, P_ID varChar(32),' +
'P_Name varChar(32), P_Mate varChar(80), P_Date DateTime, P_Picture Image)';
{-----------------------------------------------------------------------------
图片: Picture
*.P_ID: 编号
*.P_Name: 名称
*.P_Mate: 物料
*.P_Date: 时间
*.P_Picture: 图片
-----------------------------------------------------------------------------}
//------------------------------------------------------------------------------
// 数据查询
//------------------------------------------------------------------------------
sQuery_SysDict = 'Select D_ID, D_Value, D_Memo, D_ParamA, ' +
'D_ParamB From $Table Where D_Name=''$Name'' Order By D_Index ASC';
{-----------------------------------------------------------------------------
从数据字典读取数据
*.$Table:数据字典表
*.$Name:字典项名称
-----------------------------------------------------------------------------}
sQuery_ExtInfo = 'Select I_ID, I_Item, I_Info From $Table Where ' +
'I_Group=''$Group'' and I_ItemID=''$ID'' Order By I_Index Desc';
{-----------------------------------------------------------------------------
从扩展信息表读取数据
*.$Table:扩展信息表
*.$Group:分组名称
*.$ID:信息标识
-----------------------------------------------------------------------------}
implementation
//------------------------------------------------------------------------------
//Desc: 添加系统表项
procedure AddSysTableItem(const nTable,nNewSQL: string);
var nP: PSysTableItem;
begin
New(nP);
gSysTableList.Add(nP);
nP.FTable := nTable;
nP.FNewSQL := nNewSQL;
end;
//Desc: 系统表
procedure InitSysTableList;
begin
gSysTableList := TList.Create;
AddSysTableItem(sTable_SysDict, sSQL_NewSysDict);
AddSysTableItem(sTable_ExtInfo, sSQL_NewExtInfo);
AddSysTableItem(sTable_SysLog, sSQL_NewSysLog);
AddSysTableItem(sTable_BaseInfo, sSQL_NewBaseInfo);
AddSysTableItem(sTable_SerialBase, sSQL_NewSerialBase);
AddSysTableItem(sTable_SerialStatus, sSQL_NewSerialStatus);
AddSysTableItem(sTable_Card, sSQL_NewCard);
AddSysTableItem(sTable_Picture, sSQL_NewPicture);
AddSysTableItem(sTable_Provider, ssql_NewProvider);
AddSysTableItem(sTable_Truck, sSQL_NewTruck);
AddSysTableItem(sTable_TruckLog, sSQL_NewTruckLog);
AddSysTableItem(sTable_HYReader, sSQL_NewHYReader);
// AddSysTableItem(sTable_PoundLog, sSQL_NewPoundLog);
// AddSysTableItem(sTable_PoundBak, sSQL_NewPoundLog);
end;
//Desc: 清理系统表
procedure ClearSysTableList;
var nIdx: integer;
begin
for nIdx:= gSysTableList.Count - 1 downto 0 do
begin
Dispose(PSysTableItem(gSysTableList[nIdx]));
gSysTableList.Delete(nIdx);
end;
FreeAndNil(gSysTableList);
end;
initialization
InitSysTableList;
finalization
ClearSysTableList;
end.
|
{
Single Source Shortest Paths - With Negative Weight Edges
BellmanFord Algorthm O(N3)
Input:
G: Directed weighted graph (No Edge = Infinity)
N: Number of vertices
S: The source vertex
Output:
D[I]: Length of minimum path from S to I
P[I]: Parent of vertex I in its path from S, P[S] = 0
NoAnswer: Graph has cycle with negative length
Note:
Infinity should be less than the max value of its type
Reference:
CLR, p532
By Ali
}
program
BellmanFord;
const
MaxN = 100 + 2;
Infinity = 10000;
var
N, S: Integer;
G: array [1 .. MaxN, 1 .. MaxN] of Integer;
D, P: Array[1..MaxN] of Integer;
NoAnswer: Boolean;
procedure Relax(V, U: Integer);
begin
if D[U] > D[V] + G[V, U] then
begin
D[U] := D[V] + G[V, U];
P[U] := V;
end;
end;
procedure SSSPNeg;
var
I, J, K: Integer;
begin
FillChar(P, SizeOf(P), 0);
for i := 1 to N do
D[I] := Infinity;
D[S] := 0;
for K := 1 to N - 1 do
for I := 1 to N do
for J := 1 to N do
Relax(I, J);
NoAnswer := False;
for I := 1 to N do
for J := 1 to N do
if D[J] > D[I] + G[I, J] then
begin
NoAnswer := True;
Exit;
end;
end;
begin
SSSPNeg;
end.
|
unit g_Heap;
interface
uses
Windows;
type
THeap = class
private
FInitialSize: Integer;
FMaximumSize: Integer;
FHeap: THandle;
public
constructor Create(InitialSize, MaximumSize: Integer);
destructor Destroy; override;
function AllocMem(Size: Integer): Pointer;
function ReallocMem(P: Pointer; Size: Integer): Pointer;
procedure FreeMem(P: Pointer);
property MaximumSize: Integer read FMaximumSize;
property InitialSize: Integer read FInitialSize;
property Handle: THandle read FHeap;
end;
implementation
// consts: winnt.h
const
HEAP_NO_SERIALIZE = $00000001;
HEAP_GROWABLE = $00000002;
HEAP_GENERATE_EXCEPTIONS = $00000004;
HEAP_ZERO_MEMORY = $00000008;
HEAP_REALLOC_IN_PLACE_ONLY = $00000010;
//...
BLOCK_SIZE = 1024 * 1024;
{ THeap }
function THeap.AllocMem(Size: Integer): Pointer;
begin
Result := HeapAlloc(FHeap, HEAP_NO_SERIALIZE or HEAP_ZERO_MEMORY, Size);
end;
constructor THeap.Create(InitialSize, MaximumSize: Integer);
begin
FInitialSize := InitialSize;
FMaximumSize := MaximumSize;
FHeap := HeapCreate(HEAP_NO_SERIALIZE, FInitialSize, FMaximumSize);
end;
destructor THeap.Destroy;
begin
HeapDestroy(FHeap);
end;
procedure THeap.FreeMem(P: Pointer);
begin
HeapFree(FHeap, HEAP_NO_SERIALIZE, P);
end;
function THeap.ReallocMem(P: Pointer; Size: Integer): Pointer;
begin
Result := HeapRealloc(FHeap, HEAP_NO_SERIALIZE or HEAP_ZERO_MEMORY, P, Size);
end;
end.
|
unit FC.StockChart.UnitTask.Calendar.BarList;
interface
{$I Compiler.inc}
uses
SysUtils,Classes, BaseUtils, Serialization, StockChart.Definitions.Units,StockChart.Definitions,
FC.Definitions, FC.Singletons,
FC.StockChart.UnitTask.Base;
implementation
uses
FC.StockChart.UnitTask.Calendar.BarListDialog;
type
//Специальный Unit Task для автоматического подбора размеров грани и длины периода.
//Подюор оусщестьвляется прямым перебором.
TStockUnitTaskCalendarBarList = class(TStockUnitTaskBase)
public
function CanApply(const aIndicator: ISCIndicator; out aOperationName: string): boolean; override;
procedure Perform(const aIndicator: ISCIndicator; const aStockChart: IStockChart; const aCurrentPosition: TStockPosition); override;
end;
{ TStockUnitTaskCalendarBarList }
function TStockUnitTaskCalendarBarList.CanApply(const aIndicator: ISCIndicator; out aOperationName: string): boolean;
begin
result:=Supports(aIndicator,ISCIndicatorCalendar);
if result then
aOperationName:='Calendar: List Items For This Bar';
end;
procedure TStockUnitTaskCalendarBarList.Perform(const aIndicator: ISCIndicator; const aStockChart: IStockChart; const aCurrentPosition: TStockPosition);
begin
if (aCurrentPosition.X>0) and (aCurrentPosition.X<aStockChart.GetInputData.Count) then
TfmCalendarBarListDialog.Run(
aIndicator as ISCIndicatorCalendar,
aStockChart,
aStockChart.GetInputData.DirectGetItem_DataDateTime(Trunc(aCurrentPosition.X)));
end;
initialization
//Регистрируем Unit Task
StockUnitTaskRegistry.AddUnitTask(TStockUnitTaskCalendarBarList.Create);
end.
|
unit ANovaOrdemProducao;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, formularios,
Componentes1, ExtCtrls, PainelGradiente, StdCtrls, Buttons, numericos,
Mask, Localizacao,UnDados, ComCtrls, UnordemProducao,UnProdutos,
DBKeyViolation, EditorImagem, Grids, CGrades, Db, DBTables, DBCtrls,
Tabela, DBGrids, UnDadosProduto, DBClient, UnRave;
type
TRBStatusCadastro = (scInserindo,scAlterando,scConsultando);
TFNovaOrdemProducao = class(TFormularioPermissao)
PainelGradiente1: TPainelGradiente;
PanelColor2: TPanelColor;
BGravar: TBitBtn;
BCancelar: TBitBtn;
BFechar: TBitBtn;
Localiza: TConsultaPadrao;
EditorImagem1: TEditorImagem;
BImpOP: TBitBtn;
BCadastrar: TBitBtn;
CadProdutos: TSQL;
PageControl1: TPageControl;
PCadastro: TTabSheet;
PColetas: TTabSheet;
ScrollBox1: TScrollBox;
PanelColor1: TPanelColor;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
SpeedButton3: TSpeedButton;
Label8: TLabel;
Label11: TLabel;
SpeedButton5: TSpeedButton;
Label12: TLabel;
Label13: TLabel;
Label14: TLabel;
Label15: TLabel;
Label16: TLabel;
Label20: TLabel;
Label21: TLabel;
Label22: TLabel;
Label23: TLabel;
SpeedButton6: TSpeedButton;
Label24: TLabel;
Label25: TLabel;
Label26: TLabel;
SpeedButton7: TSpeedButton;
Label27: TLabel;
SpeedButton8: TSpeedButton;
Label28: TLabel;
Label17: TLabel;
Label19: TLabel;
Label9: TLabel;
Label10: TLabel;
Label29: TLabel;
Label18: TLabel;
Label30: TLabel;
Label31: TLabel;
Label32: TLabel;
EMaquina: TEditLocaliza;
EPedido: Tnumerico;
EProduto: TEditLocaliza;
ETipoPedido: TComboBoxColor;
ECliente: TEditLocaliza;
ELargura: Tnumerico;
EComprimento: Tnumerico;
EFigura: Tnumerico;
EDatEmissao: TCalendario;
EDatEntrega: TCalendario;
EPrateleira: TEditColor;
EQtdFitas: Tnumerico;
ENumFios: TEditColor;
EBatidas: TEditColor;
ETipoEmenda: TEditLocaliza;
ECalandragem: TEditColor;
EEngomagem: TEditColor;
ETipoFundo: TEditLocaliza;
GCombinacoes: TRBStringGridColor;
ETotalMetros: Tnumerico;
EMetrosFita: Tnumerico;
EHorasProducao: TMaskEditColor;
EValUnitario: Tnumerico;
ENroOPCliente: Tnumerico;
EPerAcrescimo: Tnumerico;
EUMPedido: TComboBoxColor;
EObservacoes: TMemoColor;
ETipoTear: TComboBoxColor;
PanelColor3: TPanelColor;
GColeta: TRBStringGridColor;
Label33: TLabel;
GridIndice1: TGridIndice;
Label34: TLabel;
Coleta: TSQL;
ColetaDATCOL: TSQLTimeStampField;
ColetaINDFIN: TWideStringField;
ColetaC_NOM_USU: TWideStringField;
ColetaCODCOM: TFMTBCDField;
ColetaNROFIT: TFMTBCDField;
ColetaMETAPR: TFMTBCDField;
ColetaMETCOL: TFMTBCDField;
ColetaMETFAL: TFMTBCDField;
DataColeta: TDataSource;
EPente: TEditColor;
Label35: TLabel;
ColetaCODMAN: TWideStringField;
EMotivoReprogramacao: TEditLocaliza;
Label36: TLabel;
SpeedButton4: TSpeedButton;
Label37: TLabel;
ValidaGravacao1: TValidaGravacao;
EBatidasTear: TEditColor;
Label38: TLabel;
EProdutoNovo: TEditColor;
Label39: TLabel;
ETipoCorte: TEditLocaliza;
Label40: TLabel;
SpeedButton9: TSpeedButton;
Label41: TLabel;
PRevisaoExterna: TTabSheet;
PanelColor4: TPanelColor;
ColetaOPCorpo: TSQL;
ColetaOPCorpoEMPFIL: TFMTBCDField;
ColetaOPCorpoSEQORD: TFMTBCDField;
ColetaOPCorpoSEQCOL: TFMTBCDField;
ColetaOPCorpoDATCOL: TSQLTimeStampField;
ColetaOPCorpoINDFIN: TWideStringField;
ColetaOPCorpoINDREP: TWideStringField;
ColetaOPCorpoC_NOM_PRO: TWideStringField;
ColetaOPCorpoUNMPED: TWideStringField;
ColetaOPCorpoC_NOM_USU: TWideStringField;
ColetaOPCorpoDATREV: TSQLTimeStampField;
ColetaOPCorpoCODUSU: TFMTBCDField;
DataColetaOpCorpo: TDataSource;
GridIndice2: TGridIndice;
DataColetaOpItem: TDataSource;
ColetaOpItem: TSQL;
ColetaOpItemCODCOM: TFMTBCDField;
ColetaOpItemCODMAN: TWideStringField;
ColetaOpItemNROFIT: TFMTBCDField;
ColetaOpItemMETCOL: TFMTBCDField;
GridIndice3: TGridIndice;
PMetroFaturado: TTabSheet;
GradeMetrosFaturados: TGridIndice;
MetroFaturado: TSQL;
DataMetroFaturado: TDataSource;
MetroFaturadoI_NRO_NOT: TFMTBCDField;
MetroFaturadoD_DAT_EMI: TSQLTimeStampField;
MetroFaturadoT_HOR_SAI: TSQLTimeStampField;
MetroFaturadoCODCOM: TFMTBCDField;
MetroFaturadoCODMAN: TWideStringField;
MetroFaturadoMETCOL: TFMTBCDField;
ColetaOPCorpoCODPRO: TWideStringField;
Label44: TLabel;
Label42: TLabel;
SpeedButton10: TSpeedButton;
Label43: TLabel;
EProgramador: TRBEditLocaliza;
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure EProdutoSelect(Sender: TObject);
procedure BFecharClick(Sender: TObject);
procedure BGravarClick(Sender: TObject);
procedure BCancelarClick(Sender: TObject);
procedure EProdutoRetorno(Retorno1, Retorno2: String);
procedure EProdutoCadastrar(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
procedure EProdutoChange(Sender: TObject);
procedure EMaquinaCadastrar(Sender: TObject);
procedure EClienteCadastrar(Sender: TObject);
procedure ETotalMetrosChange(Sender: TObject);
procedure EMaquinaRetorno(Retorno1, Retorno2: String);
procedure EQtdFitasExit(Sender: TObject);
procedure SpeedButton7Click(Sender: TObject);
procedure GCombinacoesCarregaItemGrade(Sender: TObject;
VpaLinha: Integer);
procedure GCombinacoesDadosValidos(Sender: TObject;
var VpaValidos: Boolean);
procedure GCombinacoesGetEditMask(Sender: TObject; ACol, ARow: Integer;
var Value: String);
procedure GCombinacoesMudouLinha(Sender: TObject; VpaLinhaAtual,
VpaLinhaAnterior: Integer);
procedure GCombinacoesNovaLinha(Sender: TObject);
procedure BImpOPClick(Sender: TObject);
procedure BCadastrarClick(Sender: TObject);
procedure GCombinacoesSelectCell(Sender: TObject; ACol, ARow: Integer;
var CanSelect: Boolean);
procedure GCombinacoesKeyPress(Sender: TObject; var Key: Char);
procedure GCombinacoesDepoisExclusao(Sender: TObject);
procedure EUMPedidoExit(Sender: TObject);
procedure GCombinacoesEnter(Sender: TObject);
procedure ETipoTearExit(Sender: TObject);
procedure GColetaCarregaItemGrade(Sender: TObject; VpaLinha: Integer);
procedure EMotivoReprogramacaoCadastrar(Sender: TObject);
procedure EProdutoNovoKeyPress(Sender: TObject; var Key: Char);
procedure ColetaOPCorpoAfterScroll(DataSet: TDataSet);
procedure PageControl1Change(Sender: TObject);
procedure GradeMetrosFaturadosOrdem(Ordem: String);
procedure GCombinacoesKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
private
{ Private declarations }
VprStatusCadastro: TRBStatusCadastro;
VprDOrdem : TRBDOrdemProducaoEtiqueta;
VprDOrdemItem : TRBDOrdemProducaoItem;
VprDProduto : TRBDProduto;
VprSeqProdutoAnterior,
VprTearAnterior : Integer;
VprUMPedidoAnterior, VprOrdemMetroFaturado : String;
FunOrdemProducao : TRBFuncoesOrdemProducao;
FunProduto : TFuncoesProduto;
FunRave : TRBFunRave;
function RetornaCodPro(SeqPro: integer): string;
procedure PosHistoricoColeta(VpaEmpFil, VpaSeqOrdem : String);
procedure PosRevisaoExterna(VpaEmpFil, VpaSeqOrdem : String);
procedure PosRevisaoExternaItem(VpaEmpFil,VpaSeqOrdem,VpaSeqColeta : String);
procedure PosMetrosFaturados(VpaEmpfil,VpaSeqOrdem : String);
procedure CarTituloGrade;
procedure CarDClasse;
procedure CarDOrdemItem;
procedure CarDTela;
procedure carProdutoTela(VpaDProduto : TRBDProduto);
procedure LimpaDadosTela;
procedure AtualizaEnableBotoes;
procedure Cadastrar;
procedure CalculaMetrosFitaCombinacao;
procedure CalculaPecasFitaCombinacao;
procedure CalculaHorasProducao;
procedure VerificaEstoque;
public
{ Public declarations }
procedure NovaOrdem;
procedure ConsultaOrdem(VpaEmpFil, VpaSeqOrdem : Integer);
procedure AlteraOrdem(VpaCodFilial, VpaSeqOrdem : Integer);
end;
var
FNovaOrdemProducao: TFNovaOrdemProducao;
implementation
uses APrincipal,Constantes, FunData, ConstMsg, AMaquinas,
ANovoCliente,FunObjeto, FunNumeros, FunSql, FunString,
AMotivoReprogramacao, ATipoCorte, AMostraEstoqueProdutoCor,
ANovoProdutoPro;
{$R *.DFM}
{ ****************** Na criação do Formulário ******************************** }
procedure TFNovaOrdemProducao.FormCreate(Sender: TObject);
begin
{ abre tabelas }
{ chamar a rotina de atualização de menus }
FunRave := TRBFunRave.cria(FPrincipal.BaseDados);
VprOrdemMetroFaturado := 'order by NOTA.I_NRO_NOT';
PageControl1.ActivePageIndex := 0;
VprSeqProdutoAnterior := -1;
VprTearAnterior := -1;
VprDOrdem := TRBDOrdemProducaoEtiqueta.cria;
GCombinacoes.ADados := VprDOrdem.Items;
GCombinacoes.CarregaGrade;
GColeta.ADados := VprDOrdem.Items;
FunOrdemProducao := TRBFuncoesOrdemProducao.cria(FPrincipal.BaseDados);
FunProduto := TFuncoesProduto.criar(nil,FPrincipal.BaseDados);
VprDProduto := TRBDProduto.Cria;
VprDProduto.CodEmpresa := varia.CodigoEmpresa;
VprDProduto.CodEmpFil := varia.CodigoEmpFil;
CarTituloGrade;
if Varia.EstagioOrdemProducao = 0 then
begin
aviso('ESTÁGIO INICIAL DA ORDEM DE PRODUÇÃO INVÁLIDO!!!'#13'Para alterar o estágio inicial da ordem de produção é necessário entrar no módulo de configurações do sistema --> Configurações Produtos...');
close;
end;
end;
{ ******************* Quando o formulario e fechado ************************** }
procedure TFNovaOrdemProducao.FormClose(Sender: TObject; var Action: TCloseAction);
begin
{ fecha tabelas }
{ chamar a rotina de atualização de menus }
FunRave.Free;
VprDOrdem.free;
VprDProduto.free;
FunOrdemProducao.free;
FunProduto.free;
Action := CaFree;
end;
{(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
Ações Diversas
)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))}
function TFNovaOrdemProducao.RetornaCodPro(SeqPro: integer): string;
begin
AdicionaSQLAbreTabela(CadProdutos,
' Select * ' +
' from CADPRODUTOS ' +
' Where I_SEQ_PRO = ' + IntToStr(SeqPro) +
' and C_ATI_PRO = ''S''');
Result := CadProdutos.FieldByName(Varia.CodigoProduto).AsString;
FechaTabela(CadProdutos);
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.AtualizaEnableBotoes;
begin
BImpOP.Enabled := (VprStatusCadastro in [scConsultando]) and (VprDOrdem.SeqOrdem > 0);
BCadastrar.Enabled := VprStatusCadastro in [scConsultando];
BGravar.Enabled := (VprStatusCadastro in [scInserindo,scAlterando]);
BCancelar.Enabled := VprStatusCadastro in [scInserindo,scAlterando];
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.EProdutoSelect(Sender: TObject);
begin
EProduto.ASelectValida.Text := 'Select * from CADPRODUTOS Where '+Varia.CodigoProduto + ' = ''@'' and C_ATI_PRO = ''S''';
EPRoduto.ASelectLocaliza.Text := 'Select * from CADPRODUTOS Where C_NOM_PRO like ''@%'' and C_ATI_PRO = ''S''';
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.CarTituloGrade;
begin
if VprDOrdem.TipTear = 0 then //tear convencial
FunOrdemProducao.ConfigGradeTearConvencional(VprDOrdem,GCombinacoes)
else
FunOrdemProducao.ConfigGradeTearH(VprDOrdem,GCombinacoes);
if VprDOrdem.TipTear = 0 then //tear convencial
FunOrdemProducao.ConfigGradeTearConvencional(VprDOrdem,GColeta)
else
FunOrdemProducao.ConfigGradeTearH(VprDOrdem,GColeta);
GColeta.Cells[6,0] := 'Qtd Produzido';
GColeta.Cells[7,0] := 'Saldo Produzir';
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.PosHistoricoColeta(VpaEmpFil, VpaSeqOrdem : String);
begin
Coleta.Sql.Clear;
Coleta.Sql.Add('select COP.DATCOL, COP.INDFIN, USU.C_NOM_USU , '+
' COI.CODCOM, COI.CODMAN, COI.NROFIT, COI.METAPR, COI.METCOL, COI.METFAL ' +
' from COLETAOPCORPO COP , COLETAOPITEM COI, CADUSUARIOS USU '+
' WHERE COP.EMPFIL = COI.EMPFIL ' +
' AND COP.SEQORD = COI.SEQORD ' +
' AND COP.SEQCOL = COI.SEQCOL ' +
' AND COP.CODUSU = USU.I_COD_USU ' +
' and COP.EMPFIL = ' + VpaEmpFil +
' AND COP.SEQORD = ' + VpaSeqOrdem+' '#13);
Coleta.Sql.Add(' order by COP.DATCOL');
Coleta.Open;
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.PosRevisaoExterna(VpaEmpFil, VpaSeqOrdem : String);
begin
ColetaOPCorpo.Sql.Clear;
ColetaOPCorpo.Sql.Add('select OPC.EMPFIL, OPC.SEQORD, OPC.SEQCOL, OPC.DATCOL,'+
' OPC.INDFIN, OPC.INDREP, ' +
' PRO.C_NOM_PRO, '+
' OP.UNMPED, OP.CODPRO, USU.C_NOM_USU, OPE.DATREV, OPE.CODUSU '+
' from coletaopcorpo opc, ORDEMPRODUCAOCORPO OP, '+
' CADPRODUTOS PRO, REVISAOOPEXTERNA OPE, CADUSUARIOS USU'+
' Where OPC.EMPFIL = '+VpaEmpFil+
' and OPC.SEQORD = '+ VpaSeqOrdem +
' AND OPC.EMPFIL = OP.EMPFIL'+
' AND OPC.SEQORD = OP.SEQORD'+
' AND OP.SEQPRO = PRO.I_SEQ_PRO'+
' AND OPE.EMPFIL = OPC.EMPFIL '+
' AND OPE.SEQORD = OPC.SEQORD '+
' AND OPE.SEQCOL = OPC.SEQCOL '+
' AND USU.I_COD_USU = OPE.CODUSU');
ColetaOPCorpo.Sql.Add('Order by DATCOL');
ColetaOpCorpo.Open;
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.PosRevisaoExternaItem(VpaEmpFil,VpaSeqOrdem,VpaSeqColeta : String);
begin
if VpaEmpFil <> '' then
begin
ColetaOPItem.Sql.Clear;
ColetaOpItem.Sql.Add('select OPI.CODCOM,OPI.CODMAN, OPI.NROFIT, OPI.METCOL'+
' from COLETAOPITEM OPI '+
' Where EMPFIL = '+ VpaEmpFil+
' and SEQORD = '+VpaSeqOrdem+
' and SEQCOL = ' + VpaSeqColeta);
ColetaOpItem.Open;
end;
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.PosMetrosFaturados(VpaEmpfil,VpaSeqOrdem : String);
begin
if VpaEmpFil <> '' then
begin
MetroFaturado.Sql.clear;
MetroFaturado.Sql.add('select NOTA.I_NRO_NOT, NOTA.D_DAT_EMI, NOTA.T_HOR_SAI, COL.CODCOM, COL.CODMAN, COL.METCOL '+
' FROM METROFATURADOITEM FAT, ROMANEIOITEM ROM, COLETAOPITEM COL, CADNOTAFISCAIS NOTA ' +
' WHERE ROM.EMPFIL = FAT.EMPFIL '+
' AND ROM.SEQROM = FAT.SEQROM '+
' AND COL.EMPFIL = ROM.EMPFIL '+
' AND COL.SEQORD = ROM.SEQORD '+
' AND COL.SEQCOL= ROM.SEQCOL ' +
' AND COL.EMPFIL = '+VpaEmpfil+
' AND COL.SEQORD = ' + VpaSeqOrdem+
' AND FAT.FILNOT = NOTA.I_EMP_FIL '+
' AND FAT.SEQNOT = NOTA.I_SEQ_NOT ');
MetroFaturado.Sql.Add(VprOrdemMetroFaturado);
MetroFaturado.Open;
end;
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.CarDClasse;
begin
with VprDOrdem do
begin
DatEmissao :=EDatEmissao.DateTime;
DatEntrega := EDatEntrega.Datetime;
DatEntregaPrevista := EDatEntrega.DateTime;
NumPedido := EPedido.AsInteger;
NroOPCliente := ENroOPCliente.AsInteger;
TipPedido := ETipoPedido.ItemIndex;
TipTear := ETipoTear.ItemIndex;
CodCliente := ECliente.AInteiro;
CodProduto := EProduto.Text;
CodMotivoReprogramacao := EMotivoReprogramacao.AInteiro;
CodMaquina := EMaquina.AInteiro;
SeqProduto := VprDProduto.SeqProduto;
TotMetros := ETotalMetros.AsInteger;
PerAcrescimo := EPerAcrescimo.AsInteger;
MetFita := EMetrosFita.AValor;
ValUnitario := EValUnitario.AValor;
HorProducao := EHorasProducao.Text;
UMPedido := EUMPedido.Text;
DesObservacoes := EObservacoes.Lines.Text;
IndProdutoNovo := EProdutoNovo.Text;
CodTipoCorte := ETipoCorte.AInteiro;
CodProgramador := EProgramador.AInteiro;
end;
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.CarDOrdemItem;
begin
VprDOrdemItem.CodCombinacao := StrToInt(GCombinacoes.Cells[1,GCombinacoes.Alinha]);
if GCombinacoes.Cells[2,GCombinacoes.Alinha] <> '' then
VprDOrdemItem.CodManequim := GCombinacoes.Cells[2,GCombinacoes.Alinha]
else
VprDOrdemItem.CodManequim := '';
VprDOrdemItem.QtdEtiquetas := StrToInt(GCombinacoes.Cells[3,GCombinacoes.Alinha]);
VprDOrdemItem.QtdFitas := StrToInt(GCombinacoes.Cells[4,GCombinacoes.Alinha]);
VprDOrdemItem.MetrosFita := StrToFloat(GCombinacoes.Cells[5,GCombinacoes.Alinha]);
if VprDOrdem.TipTear = 0 then
CalculaMetrosFitaCombinacao
else
CalculaPecasFitaCombinacao;
FunOrdemProducao.CalculaTotaisMetros(VprDOrdem,VprDProduto);
ETotalMetros.AValor := VprDOrdem.TotMetros;
if VprDOrdem.TipTear = 0 then //tear convencional
EMetrosFita.AValor := VprDOrdem.MetFita
else
EMetrosFita.AValor := 0;
CalculaHorasProducao;
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.CarDTela;
begin
with VprDOrdem do
begin
EDatEmissao.DateTime := DatEmissao;
EDatEntrega.Datetime := DatEntregaPrevista;
EPedido.AsInteger := NumPedido;
ENroOPCliente.AsInteger := NroOPCliente;
ETipoPedido.ItemIndex := TipPedido;
ETipoTear.ItemIndex := TipTear;
ECliente.AInteiro := CodCliente;
ECliente.Atualiza;
EProduto.Text := RetornaCodPro(SeqProduto);
EProgramador.AInteiro := CodProgramador;
EProgramador.Atualiza;
EMotivoReprogramacao.AInteiro := CodMotivoReprogramacao;
EMotivoReprogramacao.Atualiza;
EProduto.Atualiza;
ETipoCorte.AInteiro := CodTipoCorte;
EMaquina.AInteiro := CodMaquina;
EMaquina.Atualiza;
ETotalMetros.AValor := TotMetros;
EPerAcrescimo.AsInteger := PerAcrescimo;
EMetrosFita.Avalor := MetFita;
EQtdFitas.AsInteger := QtdFita;
EHorasProducao.Text := HorProducao;
EValUnitario.AValor := ValUnitario;
EUMPedido.ItemIndex := EUMPedido.Items.IndexOf(UMPedido);
EObservacoes.Lines.Text := DesObservacoes;
EProdutoNovo.Text := IndProdutoNovo;
VprUMPedidoAnterior := UMPedido;
VprTearAnterior := TipTear;
end;
GCombinacoes.CarregaGrade;
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.carProdutoTela(VpaDProduto : TRBDProduto);
begin
ELargura.AsInteger := VpaDProduto.LarProduto;
EComprimento.AsInteger := VpaDProduto.CmpProduto;
EFigura.AsInteger := VpaDProduto.CmpFigura;
EPrateleira.Text := VpaDProduto.PraProduto;
ENumFios.Text := VpaDProduto.NumFios;
EPente.Text := VpaDProduto.Pente;
EBatidas.Text := VpaDProduto.BatProduto;
EBatidasTear.Text := VpaDProduto.NumBatidasTear;
ETipoEmenda.AInteiro := VpaDProduto.CodTipoEmenda;
ETipoEmenda.Atualiza;
ECalandragem.Text := VpaDProduto.IndCalandragem;
EEngomagem.Text := VpaDProduto.IndEngomagem;
ETipoFundo.AInteiro := VpaDProduto.CodTipoFundo;
ETipoFundo.Atualiza;
EObservacoes.Lines.Text := VpaDProduto.DesObservacao;
if VprDOrdem.CodTipoCorte = 0 then
ETipoCorte.AInteiro := VpaDProduto.CodTipoCorte;
ETipoCorte.Atualiza;
if VpaDProduto.CodTipoCorte = 22 then
EUMPedido.ItemIndex := 1
else
EUMPedido.ItemIndex := 0;
EUMPedidoExit(eumPedido);
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.LimpaDadosTela;
begin
ScrollBox1.HorzScrollBar.Position := 0;
EDatEmissao.DateTime := now;
EDatEntrega.DateTime :=now;
EMotivoReprogramacao.AInteiro := 0;
EProduto.Text := '';
EProduto.Atualiza;
EPerAcrescimo.AValor := 5;
EUMPedido.ItemIndex := 0;
ELargura.Clear;
EComprimento.Clear;
EFigura.Clear;
EPrateleira.Clear;
ENumFios.Clear;
EPente.Clear;
EBatidas.Clear;
EBatidasTear.Clear;
ETipoEmenda.Clear;
ETipoEmenda.Atualiza;
ECalandragem.Clear;
EEngomagem.Clear;
ETipoFundo.Clear;
ETipoFundo.Atualiza;
EObservacoes.Clear;
VprSeqProdutoAnterior := 0;
VprDOrdem.SeqOrdem := 0;
VprDOrdem.CodEstagio := Varia.EstagioOrdemProducao;
if config.EstoqueCentralizado then
VprDOrdem.CodEmpresafilial := varia.CodFilialControladoraEstoque
else
VprDOrdem.CodEmpresafilial := Varia.CodigoEmpFil;
with VprDOrdem do
begin
DatEmissao := now;
DatEntregaPrevista := date;
EProgramador.AInteiro := varia.CodigoUsuario;
EProgramador.Atualiza;
NumPedido := 0;
NroOPCliente := 0;
TipPedido := 1;
TipTear := 0;
CodCliente := 11024;
CodProduto := '';
CodMaquina := 0;
CodTipoCorte := 0;
CodMotivoReprogramacao := 0;
SeqProduto := 0;
TotMetros := 0;
PerAcrescimo := 5;
MetFita := 0;
ValUnitario := 0;
HorProducao := '';
UMPedido := 'PC';
VprUMPedidoAnterior := 'PC';
DesObservacoes := '';
IndProdutoNovo := 'N';
FreeTObjectsList(Items);
VprDOrdemItem := nil;
GCombinacoes.CarregaGrade;
CarTituloGrade;
end;
GCombinacoes.Col := 1;
CarDTela;
end;
procedure TFNovaOrdemProducao.Cadastrar;
begin
ScrollBox1.VertScrollBar.Position := 0;
VprStatusCadastro := scInserindo;
EMaquina.ACampoObrigatorio := false;
AtualizaEnableBotoes;
LimpaDadosTela;
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.CalculaMetrosFitaCombinacao;
begin
if (VprDOrdemItem.QtdFitas > 0) and (VprDOrdemItem.QtdEtiquetas > 0) then
begin
if UpperCase(VprDOrdem.UMPedido) = 'PC' then
VprDOrdemItem.MetrosFita := (((VprDOrdemItem.QtdEtiquetas * VprDProduto.CmpProduto)/1000)/VprDOrdemItem.QtdFitas)
else
VprDOrdemItem.MetrosFita := (VprDOrdemItem.QtdEtiquetas / VprDOrdemItem.QtdFitas);
VprDOrdemItem.MetrosFita := FunOrdemProducao.ArredondaMetroFita(VprDOrdemItem.MetrosFita + ((VprDOrdemItem.MetrosFita * EPerAcrescimo.AValor)/100));
end
else
VprDOrdemItem.MetrosFita := 0;
GCombinacoes.Cells[5,GCombinacoes.ALinha] := FormatFloat('0.0',VprDOrdemItem.MetrosFita);
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.CalculaPecasFitaCombinacao;
begin
if (VprDOrdemItem.QtdFitas > 0) and (VprDOrdemItem.QtdEtiquetas > 0) then
begin
if UpperCase(VprDOrdem.UMPedido) = 'PC' then
VprDOrdemItem.MetrosFita := (VprDOrdemItem.QtdEtiquetas / VprDOrdemItem.QtdFitas)
else
VprDOrdemItem.MetrosFita := (((VprDOrdemItem.QtdEtiquetas / VprDProduto.CmpProduto)*1000)/VprDOrdemItem.QtdFitas);
VprDOrdemItem.MetrosFita := FunOrdemProducao.ArredondaMetroFita(VprDOrdemItem.MetrosFita + ((VprDOrdemItem.MetrosFita * EPerAcrescimo.AValor)/100));
end
else
VprDOrdemItem.MetrosFita := 0;
VprDOrdemItem.MetrosFita := trunc(VprDOrdemItem.MetrosFita);
GCombinacoes.Cells[5,GCombinacoes.ALinha] := FormatFloat('0',VprDOrdemItem.MetrosFita);
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.CalculaHorasProducao;
begin
EHorasProducao.text := FunOrdemProducao.RQtdHoras(VprDOrdem,VprDProduto);
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.VerificaEstoque;
begin
if FunOrdemProducao.ExisteEstoqueCombinacao(VprDProduto.SeqProduto) then
begin
FMostraEstoqueProdutoCor := TFMostraEstoqueProdutoCor.CriarSDI(application,'', FPrincipal.VerificaPermisao('FMostraEstoqueProdutoCor'));
FMostraEstoqueProdutoCor.MostraEstoque(VprDProduto.SeqProduto);
FMostraEstoqueProdutoCor.free;
end;
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.NovaOrdem;
begin
Cadastrar;
PColetas.TabVisible := false;
Self.ShowModal;
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.ConsultaOrdem(VpaEmpFil, VpaSeqOrdem : Integer);
begin
VprStatusCadastro := scConsultando;
AtualizaEnableBotoes;
VprDOrdem.CodEmpresafilial := VpaEmpFil;
VprDOrdem.SeqOrdem := VpaSeqOrdem;
FunOrdemProducao.CarDOrdemProducao(VprDOrdem);
VprDProduto.SeqProduto := VprDOrdem.SeqProduto;
FunProduto.CarDProduto(VprDProduto);
CarDTela;
carProdutoTela(VprDProduto);
AlterarEnabledDet([BGravar,BCancelar],false);
AtualizaLocalizas([ECliente,EProduto,EMaquina,ETipoCorte]);
GCombinacoes.ADados := VprDOrdem.Items;
GCombinacoes.CarregaGrade;
GColeta.ADados := VprDOrdem.Items;
GColeta.CarregaGrade;
CarTituloGrade;
PosHistoricoColeta(IntToStr(VpaEmpFil),IntToStr(VpaSeqOrdem));
Showmodal;
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.AlteraOrdem(VpaCodFilial, VpaSeqOrdem : Integer);
begin
VprStatusCadastro := scConsultando;
VprDOrdem.CodEmpresafilial := VpaCodFilial;
VprDOrdem.SeqOrdem := VpaSeqOrdem;
FunOrdemProducao.CarDOrdemProducao(VprDOrdem);
VprDProduto.SeqProduto := VprDOrdem.SeqProduto;
FunProduto.CarDProduto(VprDProduto);
CarDTela;
carProdutoTela(VprDProduto);
AtualizaLocalizas([ECliente,EProduto,EMaquina,ETipoCorte]);
GCombinacoes.ADados := VprDOrdem.Items;
GCombinacoes.CarregaGrade;
GColeta.ADados := VprDOrdem.Items;
GColeta.CarregaGrade;
CarTituloGrade;
PosHistoricoColeta(IntToStr(VpaCodfilial),IntToStr(VpaSeqOrdem));
VprStatusCadastro := scAlterando;
AtualizaEnableBotoes;
Showmodal;
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.BFecharClick(Sender: TObject);
begin
close;
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.BGravarClick(Sender: TObject);
var
VpfResultado : String;
begin
CarDClasse;
if VprStatusCadastro = scAlterando then
VerificaEstoque;
VpfResultado := FunOrdemProducao.GravaOrdemProducao(VprDOrdem);
if Vpfresultado = '' then
begin
VprStatusCadastro := scConsultando;
AtualizaEnableBotoes;
end
else
aviso(VpfResultado);
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.BCancelarClick(Sender: TObject);
begin
if confirmacao('Tem certeza que deseja cancelar essa operação?') then
begin
LimpaDadosTela;
VprStatusCadastro := scConsultando;
AtualizaEnableBotoes;
end;
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.EProdutoRetorno(Retorno1, Retorno2: String);
begin
if VprStatusCadastro in [scinserindo,scAlterando] then
begin
if Retorno1 <> '' then
begin
if VprSeqProdutoAnterior <> StrtoInt(Retorno1) then
begin
VprSeqProdutoAnterior := StrtoInt(Retorno1);
VprDProduto.SeqProduto := StrtoInt(Retorno1);
FunProduto.CarDProduto(VprDProduto);
carProdutoTela(VprDProduto);
FreeTObjectsList(VprDOrdem.Items);
GCombinacoes.CarregaGrade;
CalculaHorasProducao;
VerificaEstoque;
end;
end;
end;
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.EProdutoCadastrar(Sender: TObject);
begin
FNovoProdutoPro := TFNovoProdutoPro.CriarSDI(self,'',FPrincipal.VerificaPermisao('FNovoProdutoPro'));
FNovoProdutoPro.NovoProduto('');
FNovoProdutoPro.free;
Localiza.AtualizaConsulta;
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.SpeedButton2Click(Sender: TObject);
begin
FNovoProdutoPro := TFNovoProdutoPro.CriarSDI(self,'',FPrincipal.VerificaPermisao('FNovoProdutoPro'));
FNovoProdutoPro.AlterarProduto(varia.codigoEmpresa,varia.CodigoEmpFil,VprDProduto.SeqProduto);
FNovoProdutoPro.free;
FunProduto.CarDProduto(VprDProduto);
carProdutoTela(VprDProduto);
end;
procedure TFNovaOrdemProducao.EProdutoChange(Sender: TObject);
begin
if VprStatusCadastro in [scInserindo,scAlterando] then
ValidaGravacao1.execute;
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.EMaquinaCadastrar(Sender: TObject);
begin
FTipoCorte := TFTipoCorte.CriarSDI(application , '', FPrincipal.VerificaPermisao('FTipoCorte'));
FTipoCorte.BotaoCadastrar1.Click;
FTipoCorte.showmodal;
FTipoCorte.free;
Localiza.AtualizaConsulta;
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.EClienteCadastrar(Sender: TObject);
begin
FNovoCliente := tFNovoCliente.criarSDI(Application,'',FPrincipal.verificaPermisao('FNovoCliente'));
FNovoCliente.CadClientes.Insert;
FNovoCliente.ShowModal;
FNovoCliente.Free;
Localiza.AtualizaConsulta;
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.ETotalMetrosChange(Sender: TObject);
begin
if (ETotalMetros.AValor <> 0) and (VprDOrdem.QtdFita <> 0) then
EMetrosFita.AValor := ArredondaDecimais(((ETotalMetros.AValor + (ETotalMetros.AValor * (EPerAcrescimo.AValor /100))) / VprDOrdem.QtdFita),2)
else
EMetrosFita.AValor := 0;
CalculaHorasProducao;
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.EMaquinaRetorno(Retorno1, Retorno2: String);
begin
if retorno1 <> '' then
VprDOrdem.QtdFita := StrToInt(retorno1)
else
VprDOrdem.QtdFita := 0;
EQtdFitas.AValor := VprDOrdem.QtdFita;
if Retorno2 <> '' then
VprDOrdem.QtdRPMMaquina := StrtoInt(Retorno2)
else
VprDOrdem.QtdRPMMaquina := 0;
CalculaHorasProducao;
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.EQtdFitasExit(Sender: TObject);
begin
if EQtdFitas.AsInteger <> VprDOrdem.QtdFita then
begin
VprDOrdem.QtdFita := EQtdFitas.AsInteger;
ETotalMetrosChange(EQtdFitas);
end;
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.SpeedButton7Click(Sender: TObject);
begin
editorImagem1.execute(varia.DriveFoto + VprDProduto.PatFoto);
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.GCombinacoesCarregaItemGrade(Sender: TObject;
VpaLinha: Integer);
begin
VprDOrdemItem := TRBDOrdemProducaoItem(VprDOrdem.Items[VpaLinha-1]);
if VprDOrdemItem.CodCombinacao <> 0 then
GCombinacoes.Cells[1,VpaLinha] := IntToStr(VprDOrdemItem.CodCombinacao)
else
GCombinacoes.Cells[1,VpaLinha] := '';
GCombinacoes.Cells[2,VpaLinha] := VprDOrdemItem.CodManequim;
if VprDOrdemItem.QtdEtiquetas <> 0 then
GCombinacoes.Cells[3,VpaLinha] := IntToStr(VprDOrdemItem.QtdEtiquetas)
else
GCombinacoes.Cells[3,VpaLinha] := '';
if VprDOrdemItem.QtdFitas <> 0 then
GCombinacoes.Cells[4,VpaLinha] := IntToStr(VprDOrdemItem.QtdFitas)
else
GCombinacoes.Cells[4,VpaLinha] := '';
if VprDOrdemItem.MetrosFita <> 0 then
GCombinacoes.Cells[5,VpaLinha] := FormatFloat('0.0',VprDOrdemItem.MetrosFita)
else
GCombinacoes.Cells[5,VpaLinha] := '';
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.GCombinacoesDadosValidos(Sender: TObject;
var VpaValidos: Boolean);
var
VpfTextoEstoque : String;
begin
vpaValidos := false;
if GCombinacoes.Cells[1,GCombinacoes.ALinha] = '' then
begin
Aviso('COMBINAÇÃO NÃO PREENCHIDA!!!'#13'Não foi preenchido o código da combinação.');
GCombinacoes.Col := 1;
end
else
if GCombinacoes.Cells[3,GCombinacoes.ALinha] = '' then
begin
Aviso('QUANTIDADE DE ETIQUETAS NÃO PREENCHIDA!!!'#13'Não foi preenchido a quantidade da combinação.');
GCombinacoes.Col := 3;
end
else
if GCombinacoes.Cells[4,GCombinacoes.ALinha] = '' then
begin
Aviso('QUANTIDADE FITAS NÃO PREENCHIDA!!!'#13'Não foi preenchido a quantidade de fitas do tear');
GCombinacoes.Col := 4;
end
else
if GCombinacoes.Cells[5,GCombinacoes.ALinha] = '' then
begin
Aviso('METROS POR FITA PREENCHIDO!!!'#13'Não foi preenchido a quantidade de metros por fitas');
GCombinacoes.Col := 4;
end
else
VpaValidos := true;
if VpaValidos then
begin
CarDOrdemItem;
if VprDOrdemItem.CodCombinacao = 0 then
begin
Aviso('COMBINAÇÃO NÃO PREENCHIDA!!!'#13'Não foi preenchido o código da combinação.');
GCombinacoes.Col := 1;
VpaValidos := false;
end
else
if VprDOrdemItem.QtdEtiquetas = 0 then
begin
Aviso('QUANTIDADE DE ETIQUETAS NÃO PREENCHIDA!!!'#13'Não foi preenchido a quantidade da combinação.');
GCombinacoes.Col := 3;
VpaValidos := false;
end
else
If VprDOrdemItem.QtdFitas = 0 then
begin
Aviso('QUANTIDADE FITAS NÃO PREENCHIDA!!!'#13'Não foi preenchido a quantidade de fitas do tear');
GCombinacoes.Col := 3;
VpaValidos := false;
end
else
If VprDOrdemItem.MetrosFita = 0 then
begin
Aviso('METROS POR FITA PREENCHIDO!!!'#13'Não foi preenchido a quantidade de metros por fitas');
GCombinacoes.Col := 3;
VpaValidos := false;
end;
if VpaValidos then
begin
VpaValidos := FunProduto.ExisteCombinacao(VprDProduto.SeqProduto,VprDOrdemItem.CodCombinacao);
if not VpaValidos then
begin
Aviso('COMBINAÇÃO INVÁLIDA!!!'#13'Combinação "'+IntToStr(VprDOrdemItem.CodCombinacao)+'" não cadastrada.');
GCombinacoes.Col := 1;
end;
if VpaValidos then
begin
VpfTextoEstoque := FunProduto.ExisteEstoqueCor(VprDProduto.SeqProduto,VprDOrdemItem.CodCombinacao);
if VpfTextoEstoque <> '' then
aviso(VpfTextoEstoque);
if FunOrdemProducao.CombinacaoManequimDuplicado(VprDOrdem) then
begin
VpaValidos := false;
Aviso('COMBINAÇÃO MANEQUIM DUPLICADO!!!'#13'Já existe cadastrado esse manequim e combinação para essa ordem de produção.');
GCombinacoes.Col := 1;
end;
end;
end;
end;
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.GCombinacoesGetEditMask(Sender: TObject;
ACol, ARow: Integer; var Value: String);
begin
case ACol of
1 : Value := '000;0; ';
3 : Value := '0000000;0; ';
4 : Value := '0000000;0; ';
end;
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.GCombinacoesMudouLinha(Sender: TObject;
VpaLinhaAtual, VpaLinhaAnterior: Integer);
begin
if VprDOrdem.Items.Count >0 then
begin
VprDOrdemItem := TRBDOrdemProducaoItem(VprDOrdem.Items[VpaLinhaAtual-1]);
end;
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.GCombinacoesNovaLinha(Sender: TObject);
begin
VprDOrdemItem := VprDOrdem.AddItems;
VprDOrdemItem.QtdFitas := VprDOrdem.QtdFita;
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.BImpOPClick(Sender: TObject);
begin
FunRave.ImprimeOrdemProducaoEtikArt(VprDOrdem,true);
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.BCadastrarClick(Sender: TObject);
begin
Cadastrar;
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.GCombinacoesSelectCell(Sender: TObject; ACol,
ARow: Integer; var CanSelect: Boolean);
begin
if GCombinacoes.AEstadoGrade in [egInsercao,EgEdicao] then
if GCombinacoes.AColuna <> ACol then
begin
case GCombinacoes.AColuna of
3,4 :
begin
if GCombinacoes.Cells[3,GCombinacoes.ALinha] <> '' then
VprDOrdemItem.QtdEtiquetas := StrToInt(GCombinacoes.Cells[3,GCombinacoes.ALinha])
else
VprDOrdemItem.QtdEtiquetas := 0;
if GCombinacoes.Cells[4,GCombinacoes.ALinha] <> '' then
VprDOrdemItem.QtdFitas := StrToInt(GCombinacoes.Cells[4,GCombinacoes.ALinha])
else
VprDOrdemItem.QtdFitas := 0;
if VprDOrdem.TipTear = 0 then
CalculaMetrosFitaCombinacao
else
CalculaPecasFitaCombinacao;
end;
end;
end;
end;
procedure TFNovaOrdemProducao.GCombinacoesKeyPress(Sender: TObject;
var Key: Char);
begin
if GCombinacoes.Col = 2 then
key := UpCase(key)
else
if (key = '.') then
key := ',';
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.GCombinacoesDepoisExclusao(Sender: TObject);
begin
FunOrdemProducao.CalculaTotaisMetros(VprDOrdem,VprDProduto);
ETotalMetros.AValor := VprDOrdem.TotMetros;
if VprDOrdem.TipTear = 0 then //tear convencional
EMetrosFita.AValor := VprDOrdem.MetFita
else
if VprDOrdem.TipTear = 1 then //tear H
EMetrosFita.AValor := VprDOrdem.MetFita
else
EMetrosFita.AValor := 0;
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.EUMPedidoExit(Sender: TObject);
begin
if VprStatusCadastro in [scinserindo,scAlterando] then
begin
if VprUMPedidoAnterior <> EUMPedido.Text then
begin
VprUMPedidoAnterior := EUMPedido.Text;
VprDOrdem.UMPedido := EUMPedido.Text;
CarTituloGrade;
FreeTObjectsList(VprDOrdem.Items);
end;
end;
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.GCombinacoesEnter(Sender: TObject);
begin
CarTituloGrade;
end;
procedure TFNovaOrdemProducao.ETipoTearExit(Sender: TObject);
begin
if VprStatusCadastro in [scinserindo,scAlterando] then
begin
if VprTearAnterior <> ETipoTear.ItemIndex then
begin
VprTearAnterior := ETipoTear.ItemIndex;
VprDOrdem.TipTear := ETipoTear.ItemIndex;
CarTituloGrade;
FreeTObjectsList(VprDOrdem.Items);
end;
end;
end;
procedure TFNovaOrdemProducao.GColetaCarregaItemGrade(Sender: TObject;
VpaLinha: Integer);
begin
VprDOrdemItem := TRBDOrdemProducaoItem(VprDOrdem.Items[VpaLinha-1]);
GColeta.Cells[1,VpaLinha] := IntToStr(VprDOrdemItem.CodCombinacao);
GColeta.Cells[2,VpaLinha] := VprDOrdemItem.CodManequim;
GColeta.Cells[3,VpaLinha] := IntToStr(VprDOrdemItem.QtdEtiquetas);
GColeta.Cells[4,VpaLinha] := IntToStr(VprDOrdemItem.QtdFitas);
GColeta.Cells[5,VpaLinha] := FormatFloat('0.0',VprDOrdemItem.MetrosFita);
GColeta.Cells[6,VpaLinha] := FormatFloat('0.0',VprDOrdemItem.QtdProduzido);
GColeta.Cells[7,VpaLinha] := FormatFloat('0.0',VprDOrdemItem.QtdFaltante);
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.EMotivoReprogramacaoCadastrar(
Sender: TObject);
begin
FMotivoReprogramacao := TFMotivoReprogramacao.CriarSDI(application , '', FPrincipal.VerificaPermisao('FMotivoReprogramacao'));
FMotivoReprogramacao.BotaoCadastrar1.Click;
FMotivoReprogramacao.Showmodal;
FMotivoReprogramacao.free;
Localiza.AtualizaConsulta;
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.EProdutoNovoKeyPress(Sender: TObject;
var Key: Char);
begin
if (key <> 'S')and (key <> 'N') and (key <> 's') and (key <> 'n') then
key := #0;
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.ColetaOPCorpoAfterScroll(DataSet: TDataSet);
begin
if ColetaOPCorpoEMPFIL.AsInteger <> 0 then
PosRevisaoExternaItem(ColetaOPCorpoEMPFIL.AsString,ColetaOPCorpoSEQORD.AsString,ColetaOPCorpoSEQCOL.AsString);
end;
procedure TFNovaOrdemProducao.PageControl1Change(Sender: TObject);
begin
if PageControl1.ActivePage = PRevisaoExterna then
PosRevisaoExterna(IntToStr(VprDOrdem.CodEmpresafilial),IntToStr(VprDOrdem.SeqOrdem))
else
if PageControl1.ActivePage = PMetroFaturado then
PosMetrosFaturados(IntToStr(VprDOrdem.CodEmpresafilial),IntToStr(VprDOrdem.SeqOrdem));
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.GradeMetrosFaturadosOrdem(Ordem: String);
begin
VprOrdemMetroFaturado := Ordem;
end;
{******************************************************************************}
procedure TFNovaOrdemProducao.GCombinacoesKeyDown(Sender: TObject;
var Key: Word; Shift: TShiftState);
begin
if Key = VK_F4 then
ActiveControl:= EValUnitario;
end;
Initialization
{ *************** Registra a classe para evitar duplicidade ****************** }
RegisterClasses([TFNovaOrdemProducao]);
end.
|
{ Invokable interface IClientsTalking }
unit uClientsTalkingIntf;
interface
uses Soap.InvokeRegistry, System.Types, Soap.XSBuiltIns,
System.IOUtils, FMX.Dialogs, FMX.Forms, Classes, SysUtils, System.UITypes,
System.Variants;
type
TClientServ = class(TRemotable)
private
FAdress: string;
FPhone: string;
FId: string;
FFIO: string;
FPhoto: string;
FDataTime: string;
procedure SetAdress(const Value: string);
procedure SetFIO(const Value: string);
procedure SetId(const Value: string);
procedure SetPhone(const Value: string);
procedure SetPhoto(const Value: string);
procedure SetDataTime(const Value: string);
published
property Id: string read FId write SetId;
property FIO: string read FFIO write SetFIO;
property Adress: string read FAdress write SetAdress;
property Phone: string read FPhone write SetPhone;
property Photo: string read FPhoto write SetPhoto;
property DataTime: string read FDataTime write SetDataTime;
end;
ClientsArray = array of TClientServ;
{ Invokable interfaces must derive from IInvokable }
IClientsTalking = interface(IInvokable)
['{F0BF78D6-6E25-4930-AE62-F518D8BB09B2}']
procedure Update(Item: TClientServ);
procedure Delete(Id: string);
procedure AddClientInBd(Item: TClientServ);
function LoadClients: ClientsArray;
procedure DeleteDataFromTable;
procedure UpdateOrInsert(Item: TClientServ);
function LogIn(name, password: string): Boolean;
procedure Autorisation(name, password: string);
function CheckUser(name: string): Boolean;
function SelectUser(Id: string): Boolean;
function SelectClient(Id: string): TClientServ;
// procedure DropAllDb;
{ Methods of Invokable interface must not use the default }
{ calling convention; stdcall is recommended }
end;
implementation
{ TClient }
{ TClientServ }
procedure TClientServ.SetAdress(const Value: string);
begin
FAdress := Value;
end;
procedure TClientServ.SetDataTime(const Value: string);
begin
FDataTime := Value;
end;
procedure TClientServ.SetFIO(const Value: string);
begin
FFIO := Value;
end;
procedure TClientServ.SetId(const Value: string);
begin
FId := Value;
end;
procedure TClientServ.SetPhone(const Value: string);
begin
FPhone := Value;
end;
procedure TClientServ.SetPhoto(const Value: string);
begin
FPhoto := Value;
end;
initialization
{ Invokable interfaces must be registered }
InvRegistry.RegisterInterface(TypeInfo(IClientsTalking));
end.
|
unit WideComboBox;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TWideComboBox = class(TComboBox)
private
protected
procedure ComboWndProc(var Message: TMessage; ComboWnd: HWnd;
ComboProc: Pointer); override;
function GetDroppedWidth: Integer;
procedure SetDroppedWidth(Value: Integer);
public
property DroppedWidth: Integer read GetDroppedWidth write SetDroppedWidth;
published
end;
procedure Register;
implementation
function TWideComboBox.GetDroppedWidth: Integer;
begin
Result := Perform(CB_GETDROPPEDWIDTH, 0, 0);
end;
procedure TWideComboBox.SetDroppedWidth(Value: Integer);
var
S: string;
begin
S := Text;
Perform(CB_SETDROPPEDWIDTH, Value, 0);
Text := S;
end;
const
WideComboBoxText: array[0..1023] of Char = '';
procedure TWideComboBox.ComboWndProc(var Message: TMessage; ComboWnd: HWnd;
ComboProc: Pointer);
var
I: Integer;
begin
with Message do
begin
case Msg of
WM_SETTEXT:
begin
StrLCopy(WideComboBoxText, PChar(LParam), SizeOf(WideComboBoxText)-1);
I := Pos(' |', WideComboBoxText);
if I>0 then
begin
Dec(I);
while (I>0) and (WideComboBoxText[I-1]=' ') do
Dec(I);
WideComboBoxText[I] := #0;
end;
LParam := Integer(PChar(@WideComboBoxText));
end;
end;
end;
inherited ComboWndProc(Message, ComboWnd, ComboProc);
end;
procedure Register;
begin
RegisterComponents('BankClient', [TWideComboBox]);
end;
end.
|
{=============================== Program Header ================================
PROGRAM-NAME : PSA3220A(사내근로복지기금 대출 지급등록)
SYSTEM-NAME : 복리후생
SUBSYSTEM-NAME : 사내근로복지기금 대출
Programmer : 사내근로복지기금 대출 신청
Version :
Date :
Update Contents
버전 수정일 수정자 수정내용 관련근거
1.00 2012.6.08 이희용 신규개발 노사협력팀 요청
================================================================================}
unit Psa32701;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons, ExtCtrls, Mask, numedit, Db, DBTables, quickrpt, qrprntr,
MemDS, DBAccess, Ora, Comobj, Func, OnEditStdCtrl, OnFocusButton,
OnEditNumCtl, OnEditBaseCtrl, OnLineLabel, OnScheme;
type
TFpsa32701 = class(TForm)
Phelpmsg: TPanel;
SpeedButton3: TSpeedButton;
Panel1: TPanel;
PrintDialog1: TPrintDialog;
PrinterSetupDialog1: TPrinterSetupDialog;
OraQuery1: TOraQuery;
SF_Main: TOnSchemeForm;
Shape4: TShape;
OnSectionLabel2: TOnSectionLabel;
Panel4: TPanel;
Label2: TLabel;
Lempno: TLabel;
Lsysdate: TLabel;
OnSectionLabel1: TOnSectionLabel;
Shape1: TShape;
OnSectionLabel3: TOnSectionLabel;
MEfrom: TOnMaskEdit;
Pcount: TOnNumberEdit;
Panel5: TPanel;
BBexcel: TOnFocusButton;
BBclose: TOnFocusButton;
OnEdit6: TOnEdit;
OnEdit1: TOnEdit;
Shape2: TShape;
OnSectionLabel4: TOnSectionLabel;
OnEdit2: TOnEdit;
OnNumberEdit1: TOnNumberEdit;
RB2: TRadioButton;
RB1: TRadioButton;
Panel2: TPanel;
RBprint: TRadioButton;
RBscreen: TRadioButton;
OnFocusButton2: TOnFocusButton;
BBprnset: TOnFocusButton;
procedure FormActivate(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure BBcloseClick(Sender: TObject);
procedure SpeedButton3Click(Sender: TObject);
procedure BBrunClick(Sender: TObject);
procedure BBprnsetClick(Sender: TObject);
procedure MEfromChange(Sender: TObject);
procedure RBscreenClick(Sender: TObject);
procedure RBprintClick(Sender: TObject);
procedure BBexcelClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
Startup, CheckOfdate : Boolean;
GSempno, GSkorname, GSpass, GSgrade, userid, word : String;
GSsysdate, SDFM : String;
SelectOfPrint : String;
GSGroupId : String[4]; //GroupId
procedure SetNow;
end;
var
Fpsa32701: TFpsa32701;
AReport : TQuickRep;
implementation
uses Pass, kylib1, userhelp, FormMon1, Psa32702; //Calen2,
{$R *.DFM}
// 날짜와 시간
procedure TFpsa32701.SetNow;
begin
with OraQuery1 do
begin
Close;
Sql.Clear;
Sql.Add(' SELECT TO_CHAR(SYSDATE,''YYYYMMDDHH24MISSD'') D ');
Sql.Add(' FROM DUAL ');
Open;
GSsysdate := FieldByName('D').AsString;
end;
end;
procedure TFpsa32701.FormActivate(Sender: TObject);
var i : Integer;
begin
if StartUp = True then System.Exit
else StartUp := True;
Phelpmsg.Caption := ' 종합인사시스템에 접속중입니다, 잠시만기다리세요...';
Application.ProcessMessages;
OraConnect;
with OraQuery1 do
begin
close;
Sql.Clear;
Sql.Text := 'select Groupid from pymenuuser '+
' where empno = '''+ Pempno +''' ';
open;
GSGroupID := Fields[0].AsString;
end;
{
if Copy(Pempno,1,1) ='D' then //if (GSGroupid = 'G001') then
begin
BBexcel.Visible := True;
end
else
begin
BBexcel.Visible := False;
end;
}
Lempno.Caption := Pkorname + '(' + Pempno+')';
Lsysdate.Caption := fn_GetDateStr;
Pgrade := copy(Pgrade,3,1);
SDFM := '-'; //SystemDateFormatMask;
SetNow;
MEfrom.Text := Copy(GSsysdate, 1, 6);
SelectOfPrint := 'A';
AReport := Fpsa32702.QuickReport1;
Phelpmsg.Caption := ' 대출상환 내역출력작업을 시작하세요.';
SendMessage(Phelpmsg.Handle, WM_Paint , 0, 0);
end;
procedure TFpsa32701.FormCreate(Sender: TObject);
begin
StartUp := False;
end;
procedure TFpsa32701.BBcloseClick(Sender: TObject);
begin
Close;
end;
procedure TFpsa32701.SpeedButton3Click(Sender: TObject);
begin
Try
MonthForm := TMonthForm.Create(Self);
MonthForm.ShowModal;
if MonthForm.DayCaption <> '' then
MEfrom.Text := Copy(MonthForm.DayCaption,1,6);
Finally
MonthForm.Free;
End;
end;
procedure TFpsa32701.BBrunClick(Sender: TObject);
begin
if DateCheck(Copy(MEfrom.Text,1,4),Copy(MEfrom.Text,5,2),'01')= -1 then
begin
MessageBox(Handle,'기준년월 확인바랍니다', '일자오류', mb_iconwarning);
SendMessage(Phelpmsg.Handle, WM_Paint , 0, 0);
Exit;
end;
if (MEfrom.Text = '') or (Length(MEfrom.Text) <> 6) then
begin
MessageBox(Handle,' 날짜설정이 서로 맞지않습니다','날짜입력오류', mb_iconwarning);
Exit;
end;
with PrintDialog1 do
begin
MaxPage := 0;
Copies := 0;
FromPage := 0;
MinPage := 0;
ToPage := 0;
PrintRange := prAllPages;
end;
Phelpmsg.Caption := ' 추출/출력작업중입니다.';
SendMessage(Phelpmsg.Handle, WM_Paint , 0, 0);
if RBscreen.Checked then AReport.Preview;
if RBprint.Checked then
if PrintDialog1.Execute then
begin
AReport.Print;
Phelpmsg.Caption := ' 추출/출력작업이 완료되었습니다.';
end
else
Phelpmsg.Caption := ' 추출/출력작업이 취소되었습니다.';
SendMessage(Phelpmsg.Handle, WM_Paint , 0, 0);
QRPrinter.Cleanup;
end;
procedure TFpsa32701.BBprnsetClick(Sender: TObject);
begin
PrinterSetupDialog1.Execute;
end;
procedure TFpsa32701.MEfromChange(Sender: TObject);
begin
// PrintDialog1.MaxPage := 0;
end;
procedure TFpsa32701.RBscreenClick(Sender: TObject);
begin
SelectOfPrint := 'A';
end;
procedure TFpsa32701.RBprintClick(Sender: TObject);
begin
SelectOfPrint := 'B';
end;
procedure TFpsa32701.BBexcelClick(Sender: TObject);
var XL, XArr: Variant;
i,j,k,Cap_empno: integer;
SavePlace: TBookmark;
begin
Phelpmsg.Caption :=' 엑셀 변환할 자료를 검색중입니다.';
with OraQuery1 do
begin
close;
Sql.Clear;
Sql.Text := 'SELECT C.REPLDATE 상환월, A.EMPNO 사번, B.KORNAME 성명, A.LOANDATE 대출일, A.REPFRDATE 상환개시, A.LOANAMT 대출금, ' + #13
+ ' TRUNC(A.LOANAMT / A.REPMAXMM) 분할액, C.REPAMT 당월원금, C.REPINT 당월이자, C.REPAMT+C.REPINT 당월원리금, ' + #13
+ ' (A.LOANAMT - (TRUNC(A.LOANAMT / A.REPMAXMM) * (C.REPCNT - 1))) - C.REPAMT 원금잔액, ' + #13
+ ' C.REPCNT 최종상환회수, A.REPMAXMM 분할회수 ' + #13
+ ' FROM PSNLOAN A, PSCMAN B, PSNREPAY C ' + #13
+ ' WHERE C.REPLDATE = :P_DATE ' + #13
+ ' AND A.EMPNO = C.EMPNO ' + #13
+ ' AND A.APPDATE = C.APPDATE AND A.EMPNO = B.EMPNO ' + #13
+ 'UNION ' + #13
+ 'SELECT C.REPLDATE 상환월, A.EMPNO 사번, B.KORNAME 성명, A.LOANDATE 대출일, A.REPFRDATE 상환개시, A.LOANAMT 대출금, ' + #13
+ ' TRUNC(A.LOANAMT / A.REPMAXMM) 분할액, C.REPAMT 당월원금, C.REPINT 당월이자, C.REPAMT+C.REPINT 당월원리금, ' + #13
+ ' (A.LOANAMT - (TRUNC(A.LOANAMT / A.REPMAXMM) * (C.REPCNT - 1))) - C.REPAMT 원금잔액, ' + #13
+ ' C.REPCNT 최종상환회수, A.REPMAXMM 분할회수 ' + #13
+ ' FROM PSELOAN A, PSCMAN B, PSOREPAY C ' + #13
+ ' WHERE C.REPLDATE = :P_DATE ' + #13
+ ' AND A.EMPNO = C.EMPNO ' + #13
+ ' AND A.APPDATE = C.APPDATE AND A.EMPNO = B.EMPNO ' ;
if Rb1.Checked then
Sql.Text := Sql.Text + ' ORDER BY 사번 ASC, 대출일 ASC '
else if Rb2.Checked then
Sql.Text := Sql.Text + ' ORDER BY 대출일 ASC, 사번 ASC ' ;
ParamByName('P_DATE').AsString := MEfrom.Text;
open;
end;
if OraQuery1.RecordCount < 1 then
begin
Phelpmsg.Caption :='';
showmessage('엑셀 변환할 자료가 없습니다.');
exit;
end;
Phelpmsg.Caption := 'Excel이 설치되어 있는지 검색하고 있습니다.';
XArr := VarArrayCreate([1, OraQuery1.Fields.Count], VarVariant); //Gird 출력시
try
XL := CreateOLEObject('Excel.Application');
except
MessageDlg('Excel이 설치되어 있지 않습니다.', MtWarning, [mbok], 0);
Phelpmsg.Caption := '';
Exit;
end;
Phelpmsg.Caption := '자료를 변환하고 있습니다.';
XL.WorkBooks.Add; //새로운 페이지 생성
XL.Visible := false;
XL.WorkSheets[1].Name := MEfrom.Text; //시트명 부여
//TITLE NAME 설정
//XL.Range['A1'].value := '';
//XL.Range['A1'].font.Size := 16;
//컬럼명 지정_서브타이블 지정
for i := 1 to OraQuery1.Fields.Count do
begin
if OraQuery1.Fields[i-1].FullName = '사번' then Cap_empno := i;
XArr[i] := OraQuery1.Fields[i-1].FullName;
end;
XL.Range['A1' , CHR(64 + OraQuery1.Fields.Count)+'1'].Value := XArr; //Gird 출력시
k := 1;
for i := 1 to OraQuery1.Fields.Count do //Gird 출력시
begin
XL.Range[CHR(64 + i) + '1'].HorizontalAlignment := 3;
XL.Range[CHR(64 + i) + '1'].Interior.Color:= $00CBF0B3;
XL.Range[CHR(64 + i) + '1'].font.Size := 9;
XL.Range[CHR(64 + i) + '1'].font.Bold := True;
end;
//검색된 자료를 excel에 export처리 시킨다.
SavePlace := OraQuery1.GetBookmark;
OraQuery1.DisableControls;
OraQuery1.First;
while not OraQuery1.eof do
begin
for j := 1 to OraQuery1.Fields.Count do
begin
if (j = Cap_empno) then //사원번호 칼럼에 ' 문자 넣어주기 위해.
XArr[j] := ''''+OraQuery1.Fields[j-1].AsString
else XArr[j] := OraQuery1.Fields[j-1].AsString;
end;
XL.Range['A' + IntToStr(k+1), CHR(64 + OraQuery1.Fields.Count) + IntToStr(k+1)].Value := XArr;
inc(k);
OraQuery1.Next;
end;
//여기서 부터는 EXPORT된 EXCEL자료를 예쁘게 꾸미는 부분입니다.
XL.Range['A1', CHR(64 + OraQuery1.Fields.Count) + IntToStr(k)].Borders.LineStyle := 1; //테두리선을 만든다. 1은 실선
XL.Range['A1', CHR(64 + OraQuery1.Fields.Count) + IntToStr(k)].Borders.Weight := 2; //테두리선 두깨 설정 2는 보통두깨, 3은 무지 두꺼움
XL.Range['A1', CHR(64 + OraQuery1.Fields.Count) + IntToStr(k)].Borders.ColorIndex := 1; //테두리선 색상설정 1은 검은색
XL.Range['A1', CHR(64 + OraQuery1.Fields.Count) + IntToStr(k)].font.name := '굴림체';
XL.Range['A1', 'A1'].HorizontalAlignment := 3; //가운데 정렬
XL.Range['A2', CHR(64 + OraQuery1.Fields.Count) + IntToStr(k)].font.Size := 9;
//XL.Range['A2', CHR(64 + OraQuery1.Fields.Count) + IntToStr(k)].HorizontalAlignment := 2; //좌측정렬
XL.Range['A1', CHR(64 + OraQuery1.Fields.Count) + IntToStr(k)].Select; //자료를 모두 SELECT한 후 --하는 이유: AutoFit 처리하기 위해서임
XL.Selection.Columns.AutoFit; //자동정렬
XL.Range['A2', 'A2'].Select; //A2열에 커서 위치시킴
XL.Visible := true; //엑셀자료 보여줌
Screen.Cursor := crDefault;
OraQuery1.GotoBookmark(SavePlace);
OraQuery1.FreeBookmark(SavePlace);
OraQuery1.EnableControls;
Phelpmsg.Caption := '';
end;
end.
|
unit JWT.ES;
interface
uses System.SysUtils, JWT, ipcecc, ipctypes;
type
TJWTSigner_ECC = class abstract(TInterfacedObject, IJWTSigner)
private
FCipher: TipcECC;
protected
class function HashAlgorithm: TipcECCHashAlgorithms; virtual; abstract;
class function UsePSS: Boolean; virtual; abstract;
function Sign(Key, Input: TBytes): TBytes;
function Validate(Key, Input, Signature: TBytes): Boolean;
public
procedure AfterConstruction; override;
procedure BeforeDestruction; override;
end;
TJWTSigner_ES256 = class(TJWTSigner_ECC)
protected
class function HashAlgorithm: TipcECCHashAlgorithms; override;
end;
TJWTSigner_ES384 = class(TJWTSigner_ECC)
protected
class function HashAlgorithm: TipcECCHashAlgorithms; override;
end;
TJWTSigner_ES512 = class(TJWTSigner_ECC)
protected
class function HashAlgorithm: TipcECCHashAlgorithms; override;
end;
implementation
uses JWKS;
procedure TJWTSigner_ECC.AfterConstruction;
begin
inherited;
FCipher := TipcECC.Create(nil);
end;
procedure TJWTSigner_ECC.BeforeDestruction;
begin
FCipher.Free;
inherited;
end;
function TJWTSigner_ECC.Sign(Key, Input: TBytes): TBytes;
begin
FCipher.Reset;
FCipher.HashAlgorithm := HashAlgorithm;
FCipher.Key.PrivateKey := TEncoding.ANSI.GetString(Key);
FCipher.InputMessageB := Input;
FCipher.Sign;
Result := FCipher.HashSignatureB;
end;
function TJWTSigner_ECC.Validate(Key, Input, Signature: TBytes): Boolean;
begin
FCipher.Reset;
FCipher.HashAlgorithm := HashAlgorithm;
FCipher.SignerKey.PublicKey := TEncoding.ANSI.GetString(Key);
FCipher.InputMessageB := Input;
FCipher.HashSignatureB := Signature;
Result := FCipher.VerifySignature;
end;
class function TJWTSigner_ES256.HashAlgorithm: TipcECCHashAlgorithms;
begin
Result := ehaSHA256;
end;
class function TJWTSigner_ES384.HashAlgorithm: TipcECCHashAlgorithms;
begin
Result := ehaSHA384;
end;
class function TJWTSigner_ES512.HashAlgorithm: TipcECCHashAlgorithms;
begin
Result := ehaSHA512;
end;
initialization
TJWTSigner.Register(ES256, TJWTSigner_ES256);
TJWTSigner.Register(ES384, TJWTSigner_ES384);
TJWTSigner.Register(ES512, TJWTSigner_ES512);
end.
|
unit f14_save;
interface
uses
csv_parser,
buku_handler,
user_handler,
peminjaman_Handler,
pengembalian_Handler,
kehilangan_handler,
tipe_data;
{ DEKLARASI FUNGSI DAN PROSEDUR }
procedure save(var data_buku: tabel_buku; var data_user: tabel_user; var data_peminjaman: tabel_peminjaman; var data_pengembalian: tabel_pengembalian; var data_kehilangan: tabel_kehilangan);
{ IMPLEMENTASI FUNGSI DAN PROSEDUR }
implementation
procedure save(var data_buku: tabel_buku; var data_user: tabel_user; var data_peminjaman: tabel_peminjaman; var data_pengembalian: tabel_pengembalian; var data_kehilangan: tabel_kehilangan);
{ DESKRIPSI : Memasukkan data di dalam program ke data .csv }
{ PARAMETER : semua tabel data }
{ KAMUS LOKAL }
var
temp : arr_str;
filename : string;
{ ALGORITMA }
begin
write('Masukkan nama File Buku: '); readln(filename);
temp := buku_handler.konversi_csv(data_buku);
simpan_csv(filename, temp);
write('Masukkan nama File User: '); readln(filename);
temp := user_handler.konversi_csv(data_user);
simpan_csv(filename, temp);
write('Masukkan nama File Peminjaman: '); readln(filename);
temp := peminjaman_Handler.konversi_csv(data_peminjaman);
simpan_csv(filename, temp);
write('Masukkan nama File Pengembalian: '); readln(filename);
temp := pengembalian_Handler.konversi_csv(data_pengembalian);
simpan_csv(filename, temp);
write('Masukkan nama File Buku Hilang: '); readln(filename);
temp := kehilangan_handler.konversi_csv(data_kehilangan);
simpan_csv(filename, temp);
WriteLn('Data berhasil disimpan!');
end;
end. |
{ Simple program to insert a Patreon link into modern_pascal_introduction.html .
Inserts a snippet of CSS and HTML code into the given document.
Copyright Michalis Kamburelis 2018-2018.
License: Permissive Apache 2.0 license.
See https://www.apache.org/licenses/LICENSE-2.0 .
Feel free to modify and reuse.
}
{$mode objfpc}{$H+}{$J-}
uses SysUtils, Classes;
{ Read file contents into a String. }
function FileToString(const FileName: String): String;
var
F: TFileStream;
begin
F := TFileStream.Create(FileName, fmOpenRead);
try
// TFileStream on a simple file has always known Size
SetLength(Result, F.Size);
if F.Size <> 0 then
F.ReadBuffer(Result[1], Length(Result));
finally FreeAndNil(F) end;
end;
{ Set file contents from a String. Overrides previous file, if any. }
procedure StringToFile(const FileName, Contents: string);
var
F: TStream;
begin
F := TFileStream.Create(FileName, fmCreate);
try
if Length(Contents) <> 0 then
F.WriteBuffer(Contents[1], Length(Contents));
finally FreeAndNil(F) end;
end;
{ Find the 1st occurence of Search inside the Contents,
and insert Insertion right before it. }
function InsertBefore(const Contents, Search, Insertion: String): String;
var
P: Integer;
begin
P := Pos(Search, Contents);
if P = 0 then
raise Exception.CreateFmt('Substring "%s" not found in "%s"', [Search, Contents]);
Result := Contents;
Insert(Insertion, Result, P);
end;
var
Contents: String;
begin
if ParamCount <> 1 then
raise Exception.Create('Provide exactly 1 parameter, the HTML filename to process');
Contents := FileToString(ParamStr(1));
Contents := InsertBefore(Contents, '</head>',
'<style>' + FileToString('patreon-link.css') + '</style>');
Contents := InsertBefore(Contents, '<div id="toc" class="toc2">',
FileToString('patreon-link.html'));
StringToFile(ParamStr(1), Contents);
end.
|
unit vr_android_utils;
{$mode delphi}{$H+}
{$I vrode.inc}
interface
{$IFDEF ANDROID}
uses
Classes, SysUtils, Laz_And_Controls, AndroidWidget,
vr_utils, vr_intfs, vr_transport, vr_app_utils;
type
{ TAndroidApp }
TAndroidApp = class(jApp)
protected
procedure DoAfterInitialized; override;
public
procedure Finish(); override;
end;
{ TjWebViewTransport }
TjWebViewTransport = class(TCustomTransportClient)
private
FWB: jWebView;
procedure OnWBPostMessage(Sender: TObject; msg: string);
protected
procedure DoSend(const AMsg: string; const AClient: Pointer = nil); override;
public
constructor Create(const ABrowser: jWebView); overload;
end;
{ TAndroidBrowser }
TAndroidBrowser = class(TComponent, IWebBrowser)
private
FWB: jWebView;
FOnBeforeLoad: TOnBeforeLoad;
FOnLoad: TNotifyEvent;
procedure OnWBStatus(Sender: TObject; Status: TWebViewStatus; URL: String;
var CanNavi: Boolean);
private
function GetEnabled: Boolean;
function GetInitialized: Boolean;
function GetOnBeforeLoad: TOnBeforeLoad;
function GetOnFocused: TNotifyEvent;
function GetOnKeyDown: TWBKeyEvent;
function GetOnLoad: TNotifyEvent;
function GetOnShowContextMenu: TOnShowContextMenu;
procedure SetEnabled(AValue: Boolean);
procedure SetOnBeforeLoad(AValue: TOnBeforeLoad);
procedure SetOnFocused(AValue: TNotifyEvent);
procedure SetOnKeyDown(AValue: TWBKeyEvent);
procedure SetOnLoad(AValue: TNotifyEvent);
procedure SetOnShowContextMenu(AValue: TOnShowContextMenu);
protected
{ IWebBrowser }
procedure Navigate(const AUrl: string);
procedure Refresh(const AIgnoreCache: Boolean = False);
function LoadFromString(const S : string): Integer;
function SaveToString: string;
procedure PrintToPDF(const AFileName: string);
function Focused: Boolean;
function ClearSelection: Boolean;
//function SelText: string;
function SelectAll: Boolean;
procedure ExecuteJavaScript(const ACode: string);
property OnKeyDown: TWBKeyEvent read GetOnKeyDown write SetOnKeyDown;//may be not In MainThread (Chromium Embedded)
property OnBeforeLoad: TOnBeforeLoad read GetOnBeforeLoad write SetOnBeforeLoad;
property OnLoad: TNotifyEvent read GetOnLoad write SetOnLoad;
property OnShowContextMenu: TOnShowContextMenu read GetOnShowContextMenu write SetOnShowContextMenu;
property OnFocused: TNotifyEvent read GetOnFocused write SetOnFocused;
property Initialized: Boolean read GetInitialized;
property Enabled: Boolean read GetEnabled write SetEnabled;
function IsEnabled: Boolean;//check Parent
function IsVisible: Boolean;//check Parent
public
constructor Create(AOwner: TComponent; const AWebView: jWebView); overload;
end;
{$IFDEF TEST_MODE}
{ TTestAndroidThread }
TTestAndroidThread = class(TThread)
protected
procedure Execute; override;
public
procedure AfterConstruction; override;
end;
{$ENDIF}
function and_GetAssetsPath: string;
function and_GetInternalAppStoragePath: string;
function and_CopyFromAssetsToInternalAppStorage(const AssetFilename: string;
out AResultFile: string; const ASkipIfExists: Boolean = True): Boolean;
function MainForm: jForm;{$IFNDEF TEST_MODE}inline;{$ENDIF}
function jctrl_IsEnabled(ACtrl: TAndroidWidget): Boolean;//check Parents
function jctrl_IsVisible(ACtrl: TAndroidWidget): Boolean;//check Parents
//var
// MainForm: jForm;
implementation
function and_GetAssetsPath: string;
begin
Result := 'file:///android_asset/';
end;
function and_GetInternalAppStoragePath: string;
begin
if not (gApp.Form is jForm) then
Result := ''
else
Result := IncludeTrailingPathDelimiter(jForm(gApp.Form).GetInternalAppStoragePath);
end;
function and_CopyFromAssetsToInternalAppStorage(const AssetFilename: string;
out AResultFile: string; const ASkipIfExists: Boolean): Boolean;
var
sDestPath, sSrcFile: String;
begin
Result := False;
sDestPath := and_GetInternalAppStoragePath;
if sDestPath = '' then Exit;
if file_Starts(and_GetAssetsPath, AssetFilename) then
sSrcFile := Copy(AssetFilename, Length(and_GetAssetsPath) + 1, MaxInt)
else
sSrcFile := ExcludeLeadingPathDelimiter(AssetFilename);
AResultFile := sDestPath + sSrcFile;
if (ASkipIfExists and file_Exists(AResultFile)) then
Exit(True)
else
AResultFile := '';
if not dir_Force(sDestPath + file_ExtractDir(sSrcFile)) then
Exit;
AResultFile := MainForm.CopyFromAssetsToInternalAppStorage(sSrcFile);
Result := file_Exists(AResultFile);
end;
function MainForm: jForm;
begin
Result := jForm(gApp.Form);
end;
function jctrl_IsEnabled(ACtrl: TAndroidWidget): Boolean;
begin
while ACtrl <> nil do
begin
if ACtrl.Enabled then Exit(True);
ACtrl := ACtrl.Parent;
end;
Result := False;
end;
function jctrl_IsVisible(ACtrl: TAndroidWidget): Boolean;
begin
while ACtrl <> nil do
begin
if ACtrl.Visible then Exit(True);
ACtrl := ACtrl.Parent;
end;
Result := False;
end;
{ TAndroidApp }
procedure TAndroidApp.DoAfterInitialized;
begin
inherited DoAfterInitialized;
//NotifyAppEvent(AET_AppInitialized, Self);
end;
procedure TAndroidApp.Finish();
begin
NotifyAppEvent(AET_AppClose, Self);
inherited Finish();
end;
{ TTestAndroidThread }
procedure TTestAndroidThread.Execute;
begin
end;
procedure TTestAndroidThread.AfterConstruction;
begin
inherited AfterConstruction;
FreeOnTerminate := True;
end;
{ TAndroidBrowser }
function TAndroidBrowser.GetEnabled: Boolean;
begin
Result := FWB.Enabled;
end;
function TAndroidBrowser.GetInitialized: Boolean;
begin
Result := FWB.Initialized;
end;
function TAndroidBrowser.GetOnBeforeLoad: TOnBeforeLoad;
begin
Result := FOnBeforeLoad;
end;
function TAndroidBrowser.GetOnFocused: TNotifyEvent;
begin
Result := nil;
end;
function TAndroidBrowser.GetOnKeyDown: TWBKeyEvent;
begin
Result := nil;
end;
function TAndroidBrowser.GetOnLoad: TNotifyEvent;
begin
Result := FOnLoad;
end;
function TAndroidBrowser.GetOnShowContextMenu: TOnShowContextMenu;
begin
Result := nil
end;
procedure TAndroidBrowser.OnWBStatus(Sender: TObject; Status: TWebViewStatus;
URL: String; var CanNavi: Boolean);
begin
case Status of
wvOnBefore:
if Assigned(FOnBeforeLoad) then
FOnBeforeLoad(FWB, URL{%H-}, CanNavi);
wvOnFinish:
if Assigned(FOnLoad) then
FOnLoad(FWB);
end;
end;
procedure TAndroidBrowser.SetEnabled(AValue: Boolean);
begin
FWB.Enabled := AValue;
end;
procedure TAndroidBrowser.SetOnBeforeLoad(AValue: TOnBeforeLoad);
begin
FOnBeforeLoad := AValue;
end;
procedure TAndroidBrowser.SetOnFocused(AValue: TNotifyEvent);
begin
end;
procedure TAndroidBrowser.SetOnKeyDown(AValue: TWBKeyEvent);
begin
end;
procedure TAndroidBrowser.SetOnLoad(AValue: TNotifyEvent);
begin
FOnLoad := AValue;
end;
procedure TAndroidBrowser.SetOnShowContextMenu(AValue: TOnShowContextMenu);
begin
end;
procedure TAndroidBrowser.Navigate(const AUrl: string);
begin
FWB.Navigate(AUrl);
end;
procedure TAndroidBrowser.Refresh(const AIgnoreCache: Boolean);
begin
FWB.Refresh;
end;
function TAndroidBrowser.LoadFromString(const S: string): Integer;
begin
Result := 0;
FWB.LoadFromHtmlString(S);
end;
function TAndroidBrowser.SaveToString: string;
begin
end;
procedure TAndroidBrowser.PrintToPDF(const AFileName: string);
begin
end;
function TAndroidBrowser.Focused: Boolean;
begin
Result := False;
end;
function TAndroidBrowser.ClearSelection: Boolean;
begin
Result := False;
end;
function TAndroidBrowser.SelectAll: Boolean;
begin
Result := False;
end;
procedure TAndroidBrowser.ExecuteJavaScript(const ACode: string);
begin
FWB.EvaluateJavascript(ACode);
end;
function TAndroidBrowser.IsEnabled: Boolean;
begin
Result := jctrl_IsEnabled(FWB);
end;
function TAndroidBrowser.IsVisible: Boolean;
begin
Result := jctrl_IsVisible(FWB);
end;
constructor TAndroidBrowser.Create(AOwner: TComponent; const AWebView: jWebView);
begin
Create(AOwner);
FWB := AWebView;
FWB.OnStatus := OnWBStatus;
end;
{ TjWebViewTransport }
procedure TjWebViewTransport.OnWBPostMessage(Sender: TObject; msg: string);
begin
DoReceive(msg, nil, nil);
end;
procedure TjWebViewTransport.DoSend(const AMsg: string; const AClient: Pointer);
begin
FWB.EvaluateJavascript('window.__android_receive_msg(`' + AMsg + '`)');
end;
constructor TjWebViewTransport.Create(const ABrowser: jWebView);
begin
Create(False);
FWB := ABrowser;
ABrowser.OnPostMessage := OnWBPostMessage;
end;
function _OnShowConfirm(const S: string; AIsYesNo: Boolean): Boolean;
begin
end;
procedure _OnShowInfo(const S: string);
begin
MainForm.ShowMessage(S);
end;
procedure _OnShowError(const AError: string; ACaption: string = '');
begin
gApp.ShowMessage(ACaption, AError, 'OK');
end;
initialization
OnShowConfirm := _OnShowconfirm;
OnShowInfo := _OnShowInfo;
OnShowError := _OnShowError;
{$ELSE NOT ANDROID}implementation{$ENDIF}
end.
|
unit APermissaoRelatorio;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, formularios,
Menus, StdCtrls, Buttons, ExtCtrls, Componentes1, DB, UnImpressaoRelatorio,
DBClient, Tabela, CBancoDados;
type
TFPermissaoRelatorio = class(TFormularioPermissao)
Menu: TMainMenu;
MRelatorios: TMenuItem;
PanelColor1: TPanelColor;
BGravar: TBitBtn;
BCancelar: TBitBtn;
Cadastro: TRBSQL;
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure BCancelarClick(Sender: TObject);
procedure BGravarClick(Sender: TObject);
private
{ Private declarations }
VprCodFilial,
VprCodGrupo,
VprSeqRelatorio : integer;
FunImpressaoRel: TImpressaoRelatorio;
procedure GravaPermissaoRelatorio;
procedure GravaPermissaoMenu(VpaMenu : TMenuItem);
public
{ Public declarations}
function PermissaoRelatorio(VpaCodFilial, VpaCodGrupo : Integer):boolean;
end;
var
FPermissaoRelatorio: TFPermissaoRelatorio;
implementation
uses APrincipal, funsql, constantes;
{$R *.DFM}
{ **************************************************************************** }
procedure TFPermissaoRelatorio.FormCreate(Sender: TObject);
begin
{ abre tabelas }
{ chamar a rotina de atualização de menus }
FunImpressaoRel := TImpressaoRelatorio.Cria(FPrincipal.BaseDados);
FunImpressaoRel.CarregarMenuRel(mrTodos,MRelatorios);
end;
{******************************************************************************}
procedure TFPermissaoRelatorio.GravaPermissaoMenu(VpaMenu: TMenuItem);
var
Vpflaco : Integer;
VpfMenu : TMenuItem;
begin
for VpfLaco := 0 to VpaMenu.Count - 1 do
begin
VpfMenu := VpaMenu.Items[Vpflaco];
if VpfMenu.Count > 0 then
GravaPermissaoMenu(VpfMenu)
else
begin
if VpfMenu.Checked then
begin
Cadastro.insert;
Cadastro.FieldByName('CODFILIAL').AsInteger := VprCodFilial;
Cadastro.FieldByName('CODGRUPO').AsInteger := VprCodGrupo;
Cadastro.FieldByName('SEQRELATORIO').AsInteger := VprSeqRelatorio;
Cadastro.FieldByName('NOMRELATORIO').AsString := copy(VpfMenu.Hint,length(varia.PathRelatorios)+1,length(VpfMenu.Hint));
if copy(Cadastro.FieldByName('NOMRELATORIO').AsString,1,1) = '\' then
Cadastro.FieldByName('NOMRELATORIO').AsString := copy(Cadastro.FieldByName('NOMRELATORIO').AsString,2,length(Cadastro.FieldByName('NOMRELATORIO').AsString));
inc(VprSeqRelatorio);
Cadastro.Post;
end;
end;
end;
end;
{******************************************************************************}
procedure TFPermissaoRelatorio.GravaPermissaoRelatorio;
var
VpfLaco : Integer;
VpfMenu : TMenuItem;
begin
ExecutaComandoSql(Cadastro,'DELETE FROM GRUPOUSUARIORELATORIO ' +
' Where CODFILIAL = ' +IntToStr(VprCodFilial)+
' AND CODGRUPO = ' +IntToStr(VprCodGrupo));
AdicionaSQLAbreTabela(Cadastro,'Select * from GRUPOUSUARIORELATORIO ' +
' WHERE CODFILIAL = 0 AND CODGRUPO = 0 AND SEQRELATORIO =0 ' );
VprSeqRelatorio := 1;
GravaPermissaoMenu(MRelatorios);
Cadastro.Close;
end;
{******************************************************************************}
function TFPermissaoRelatorio.PermissaoRelatorio(VpaCodFilial,VpaCodGrupo: Integer): boolean;
begin
VprCodFilial := VpaCodFilial;
VprCodGrupo := VpaCodGrupo;
ShowModal;
end;
{ *************************************************************************** }
procedure TFPermissaoRelatorio.BCancelarClick(Sender: TObject);
begin
close;
end;
{******************************************************************************}
procedure TFPermissaoRelatorio.BGravarClick(Sender: TObject);
begin
GravaPermissaoRelatorio;
close;
end;
procedure TFPermissaoRelatorio.FormClose(Sender: TObject; var Action: TCloseAction);
begin
{ fecha tabelas }
{ chamar a rotina de atualização de menus }
FunImpressaoRel.free;
Action := CaFree;
end;
{(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
Ações Diversas
)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))}
Initialization
{ *************** Registra a classe para evitar duplicidade ****************** }
RegisterClasses([TFPermissaoRelatorio]);
end.
|
unit fpeMakerNoteMinolta;
{$IFDEF FPC}
//{$mode objfpc}{$H+}
{$MODE DELPHI}
{$ENDIF}
interface
uses
Classes, SysUtils,
fpeGlobal, fpeTags, fpeExifReadWrite;
type
TMinoltaMakerNoteReader = class(TMakerNoteReader)
protected
function AddTag(AStream: TStream; const AIFDRecord: TIFDRecord;
const AData: TBytes; AParent: TTagID): Integer; override;
procedure GetTagDefs({%H-}AStream: TStream); override;
end;
implementation
uses
fpeStrConsts, fpeUtils, fpeExifData;
resourcestring
// Minolta
rsMinoltaBracketStepLkup = '0:1/3 EV,1:2/3 EV,2:1 EV';
rsMinoltaColorModeLkup = '0:Natural color,1:Black & White,2:Vivid color,'+
'3:Solarization,4:Adobe RGB,5:Sepia,9:Natural,12:Portrait,13:Natural sRGB,'+
'14:Natural+ sRGB,15:Landscape,16:Evening,17:Night Scene,18:Night Portrait,'+
'132:Embed Adobe RGB';
rsMinoltaColorProfileLkup = '0:Not embedded,1:Embedded';
rsMinoltaDataImprintLkup = '0;None,1:YYYY/MM/DD,2:MM/DD/HH:MM,3:Text,4:Text + ID#';
rsMinoltaDECPositionLkup = '0:Exposure,1:Contrast,2:Saturation,3:Filter';
rsMinoltaDigitalZoomLkup = '0:Off,1:Electronic magnification,2:2x';
rsMinoltaDriveModeLkup = '0:Single,1:Continuous,2:Self-timer,4:Bracketing,'+
'5:Interval,6:UHS continuous,7:HS continuous';
rsMinoltaExposureModeLkup = '0:Program,1:Aperture priority,2:Shutter priority,3:Manual';
rsMinoltaFocusAreaLkup = '0:Wide Focus (normal),1:Spot Focus';
rsMinoltaFlashMeteringLkup = '0:ADI (Advanced Distance Integration),1:Pre-flash TTL,2:Manual flash control';
rsMinoltaFlashModeLkup = '0:Fill flash,1:Red-eye reduction,2:Rear flash sync,3:Wireless,4:Off?';
rsMinoltaFocusModeLkup = '0:AF,1:MF';
rsMinoltaFolderNameLkup = '0:Standard Form,1:Data Form';
rsMinoltaImageSizeLkup = '1:1600x1200,2:1280x960,3:640x480,5:2560x1920,6:2272x1704,7:2048x1536';
rsMinoltaImageSizeLkup1 = '0:Full,1:1600x1200,2:1280x960,3:640x480,6:2080x1560,7:2560x1920,8;3264x2176';
rsMinoltaImageStabLkup = '1:Off,5:On';
rsMinoltaInternalFlashLkup = '0:No,1:Fired';
rsMinoltaIntervalModeLkup = '0:Still image,1:Time-lapse movie';
rsMinoltaIsoSettingLkup = '0:100,1:200,2:400,3:800,4:Auto,5:64';
rsMinoltaMeteringModeLkup = '0:Multi-segment,1:Center-weighted average,2:Spot';
rsMinoltaModelIDLkup = '0:DiMAGE 7/X1/X21 or X31,1:DiMAGE 5,2:DiMAGE S304,'+
'3:DiMAGE S404,4:DiMAGE 7i,5:DiMAGE 7Hi,6:DiMAGE A1,7:DiMAGE A2 or S414';
rsMinoltaQualityLkup = '0:Raw,1:Super Fine,2:Fine,3:Standard,4:Economy,5:Extra fine';
rsMinoltaSceneModeLkup = '0:Standard,1:Portrait,2:Text,3:Night Scene,'+
'4:Sunset,5:Sports,6:Landscape,7:Night Portrait,8:Macro,9:Super Macro,'+
'16:Auto,17:Night View/Portrait,18:Sweep Panorama,19:Handheld Night Shot,'+
'20:Anti Motion Blur,21:Cont. Priority AE,22:Auto+,23:3D Sweep Panorama,'+
'24:Superior Auto,25:High Sensitivity,26:Fireworks,27:Food,28:Pet,33:HDR,'+
'65535:n/a';
rsMinoltaSharpnessLkup = '0:Hard,1:Normal,2:Soft';
rsMinoltaSubjectProgramLkup = '0:None,1:Portrait,2:Text,3:Night portrait,4:Sunset,5:Sports action';
rsMinoltaTeleconverterLkup = '$0:None,$4:Minolta/Sony AF 1.4x APO (D) (0x04),'+
'$5:Minolta/Sony AF 2x APO (D) (0x05),$48 = Minolta/Sony AF 2x APO (D),'+
'$50:Minolta AF 2x APO II,$60:Minolta AF 2x APO,$88:Minolta/Sony AF 1.4x APO (D),'+
'$90 = Minolta AF 1.4x APO II,$A0 = Minolta AF 1.4x APO';
rsMinoltaWhiteBalanceLkup = '$00:Auto,$01:Color Temperature/Color Filter,$10:Daylight,'+
'$20:Cloudy,$30:Shade,$40:Tungsten,$50:Flash,$60:Fluorescent,$70:Custom';
rsMinoltaWideFocusZoneLkup = '0:No zone,1:Center zone (horizontal orientation),'+
'2:Center zone (vertical orientation),3:Left zone,4:Right zone';
rsMinoltaZoneMatchingLkup = '0:ISO Setting Used,1:High Key,2:Low Key';
{ The Minolta MakerNote can be quite long, about 12 kB. In the beginning
of this tag there is a normal tag directory in usual format.
References:
- http://www.dalibor.cz/software/minolta-makernote
- https://sno.phy.queensu.ca/~phil/exiftool/TagNames/Minolta.html }
procedure BuildMinoltaTagDefs(AList: TTagDefList);
const
M = DWord(TAGPARENT_MAKERNOTE);
begin
Assert(AList <> nil);
with AList do begin
{ This tag stores the string 'MLT0', not zero-terminated, as an identifier }
AddBinaryTag (M+$0000, 'Version', 4, '', '', '', TVersionTag);
{ Stores all settings which were in effect when taking the picture.
Details depend on camera. }
AddBinaryTag (M+$0001, 'MinoltaCameraSettingsOld'); // Camera D5, D7, S304, S404
AddBinaryTag (M+$0003, 'MinoltaCameraSettings'); // Camera D7u, D7i, D7Hi
// this is the size of the JPEG (compressed) or TIFF or RAW file.
AddULongTag (M+$0040, 'CompressedImageSize');
{ Stores the thumbnail image (640×480). It is in normal JFIF format but the
first byte should be changed to 0xFF. Beware! Sometimes the thumbnail
is not stored in the file and this tag points beyond the end of the file. }
AddBinaryTag (M+$0081, 'ReviewImage');
{ The cameras D7u, D7i and D7Hi no longer store the thumbnail inside the tag.
It has instead two tags describing the position of the thumbnail in the
file and its size }
AddULongTag (M+$0088, 'PreviewImageStart');
AddULongTag (M+$0089, 'PreviewImageLength');
AddULongTag (M+$0100, 'SceneMode', 1, '', rsMinoltaSceneModeLkup);
AddULongTag (M+$0101, 'ColorMode', 1, '', rsMinoltaColorModeLkup);
AddULongtag (M+$0102, 'Quality', 1, '', rsMinoltaQualityLkup);
AddULongTag (M+$0103, 'ImageSize', 1, '', rsMinoltaImageSizeLkup);
AddSRationalTag(M+$0104, 'FlashExposureComp');
AddULongTag (M+$0105, 'TeleConverter', 1, '', rsMinoltaTeleconverterLkup);
AddULongTag (M+$0107, 'ImageStabilization', 1, '', rsMinoltaImageStabLkup);
AddULongTag (M+$0109, 'RawAndJpegRecording', 1, '', rsOffOn);
AddULongTag (M+$010A, 'ZoneMatching', 1, '', rsMinoltaZoneMatchingLkup);
AddULongTag (M+$010B, 'ColorTemperature', 1);
AddULongTag (M+$010C, 'LensType', 1);
AddSLongTag (M+$0111, 'ColorCompensationFilter', 1);
AddULongTag (M+$0112, 'WhiteBalanceFileTune', 1);
AddULongTag (M+$0113, 'ImageStabilization', 1, '', rsOffOn);
AddULongTag (M+$0115, 'WhiteBalance', 1, '', rsMinoltaWhiteBalanceLkup);
AddBinaryTag (M+$0E00, 'PrintPIM');
end;
end;
//==============================================================================
// TMinoltaMakerNoteReader
//==============================================================================
function TMinoltaMakerNoteReader.AddTag(AStream: TStream;
const AIFDRecord: TIFDRecord; const AData: TBytes; AParent: TTagID): Integer;
var
tagDef: TTagDef;
v: array of DWord;
n, i: Integer;
t: TTagID;
d: Integer;
isDiMAGE7Hi: Boolean;
//p: PByte;
begin
Result := -1;
tagDef := FindTagDef(AIFDRecord.TagID or AParent);
if (tagDef = nil) then
exit;
Result := inherited AddTag(AStream, AIFDRecord, AData, AParent);
// This is a special treatment of array tags which will be added as
// separate "MakerNote" tags.
// Ref: https://sno.phy.queensu.ca/~phil/exiftool/TagNames/Minolta.html#CameraSettings
t := AIFDRecord.TagID;
case AIFDRecord.TagID of
$0001,
$0003: // Minolta camera settings tags
// Contains an array of ULong values encoded in big-endian style,
// regardless of the byte order in the picture (i.e., even if the
// JPEG or TIFF itself is little-endian).
begin
// Put binary data into a DWord array and fix endianness
// ASSUMING HERE THAT DATA ARE ULONG HERE!
n := Length(AData) div TagElementSize[ord(ttUInt32)];
SetLength(v, n);
Move(AData[0], v[0], Length(AData));
for i:=0 to n-1 do
v[i] := BEtoN(v[i]);
// Fix problem with DiMAGE7Hi (http://www.dalibor.cz/software/minolta-makernote)
isDiMAGE7Hi := FModel = 'DiMAGE7Hi';
if isDiMAGE7Hi then d := 1 else d := 0;
with FImgInfo.ExifData do begin
AddMakerNoteTag( 1, t, 'Exposure mode', v[1], rsMinoltaExposureModeLkup, '', ttUInt32);
AddMakerNoteTag( 2, t, 'Flash mode', v[2], rsMinoltaFlashModeLkup, '', ttUInt32);
AddMakerNoteTag( 3, t, 'White balance', v[3], '', '', ttUInt32);
AddMakerNoteTag( 4, t, 'Minolta image size', v[4], rsMinoltaImageSizeLkup1, '', ttUInt32);
AddMakerNoteTag( 5, t, 'Minolta quality', v[5], rsMinoltaQualityLkup, '', ttUInt32);
AddMakerNoteTag( 6, t, 'Drive mode', v[6], rsMinoltaDriveModeLkup, '', ttUInt32);
AddMakerNoteTag( 7, t, 'Metering mode', v[7], rsMinoltaMeteringModeLkup, '', ttUInt32);
AddMakerNoteTag( 8, t, 'ISO', v[8], '', '', ttUInt32);
AddMakerNoteTag( 9, t, 'Exposure time', v[9], '', '', ttUInt32);
AddMakerNoteTag(10, t, 'F number', v[10], '', '', ttUInt32);
AddMakerNoteTag(11, t, 'Macro mode', v[11], rsOffOn, '', ttUInt32);
AddMakerNoteTag(12, t, 'Digital zoom', v[12], rsMinoltaDigitalZoomLkup, '', ttUInt32);
AddMakerNoteTag(13, t, 'Exposure compensation', v[13], '', '', ttUInt32);
AddMakerNoteTag(14, t, 'Bracket step', v[14], rsMinoltaBracketStepLkup, '', ttUInt32);
AddMakerNoteTag(16, t, 'Interval length', v[16], '', '', ttUInt32);
AddMakerNoteTag(17, t, 'Interval number', v[17], '', '', ttUInt32);
AddMakerNoteTag(18, t, 'Focal length', v[18], '', '', ttUInt32); // crashes
AddMakerNoteTag(19, t, 'Focus distance', v[19], '', '', ttUInt32);
AddMakerNoteTag(20, t, 'Flash fired', v[20], rsNoYes, '', ttUInt32);
AddMakerNoteTag(21, t, 'Minolta date', v[21], '', '', ttUInt32);
AddMakerNoteTag(22, t, 'Minolta time', v[22], '', '', ttUInt32);
AddMakerNoteTag(23, t, 'Max aperture', v[23], '', '', ttUInt32);
AddMakerNoteTag(26, t, 'File number memory', v[26], rsOffOn, '', ttUInt32);
AddMakerNoteTag(27, t, 'Last file number', v[27], '', '', ttUInt32);
AddMakerNoteTag(28, t, 'Color balance red', v[28], '', '', ttUInt32);
AddMakerNoteTag(29, t, 'Color balance green', v[29], '', '', ttUInt32);
AddMakerNoteTag(30, t, 'Color balance blue', v[30], '', '', ttUInt32);
AddMakerNoteTag(31, t, 'Saturation', v[31], '', '', ttUInt32);
AddMakerNoteTag(32, t, 'Contrast', v[32], '', '', ttUInt32);
AddMakerNoteTag(33, t, 'Sharpness', v[33], rsMinoltaSharpnessLkup, '', ttUInt32);
AddMakerNoteTag(34, t, 'Subject program', v[34], rsMinoltaSubjectProgramLkup, '', ttUInt32);
AddMakerNoteTag(35, t, 'Flash exposure compensation', v[35], '', '', ttUInt32);
AddMakerNoteTag(36, t, 'AE setting', v[36], rsMinoltaIsoSettingLkup, '', ttUInt32);
AddMakerNoteTag(37, t, 'Minolta model ID', v[37], rsMinoltaModelIDLkup, '', ttUInt32);
AddMakerNoteTag(38, t, 'Interval mode', v[38], rsMinoltaIntervalModeLkup, '', ttUInt32);
AddMakerNoteTag(39, t, 'Folder name', v[39], rsMinoltaFolderNameLkup, '', ttUInt32);
AddMakerNoteTag(40, t, 'Color mode', v[40], rsMinoltaColorModeLkup, '', ttUInt32);
AddMakerNoteTag(41, t, 'Color filter', v[41], '', '', ttUInt32);
AddMakerNoteTag(42, t, 'BW filter', v[42], '', '', ttUInt32);
AddMakerNoteTag(43, t, 'Internal flash', v[43], rsMinoltaInternalFlashLkup, '', ttUInt32);
AddMakerNoteTag(44, t, 'Brightness', v[44], '', '', ttUInt32);
AddMakerNoteTag(45, t, 'Spot focus point X', v[45], '', '', ttUInt32);
AddMakerNoteTag(46, t, 'Spot focus point Y', v[46], '', '', ttUInt32);
AddMakerNoteTag(47, t, 'Wide focus zone', v[47], rsMinoltaWideFocusZoneLkup, '', ttUInt32);
AddMakerNoteTag(48, t, 'Focus mode', v[48], rsMinoltaFocusModeLkup, '', ttUInt32);
AddMakerNoteTag(49, t, 'Focus area', v[49], rsMinoltaFocusAreaLkup, '', ttUInt32);
AddMakerNoteTag(40, t, 'DEC position', v[50], rsMinoltaDECPositionLkup, '', ttUInt32);
if isDiMAGE7Hi then
AddMakerNoteTag(51, t, 'Color profile', v[51], rsMinoltaColorProfileLkup, '', ttUInt32);
AddMakerNoteTag(51+d, t, 'Data imprint', v[52], rsMinoltaDataImprintLkup, '', ttUInt32);
AddMakerNoteTag(63+d, t, 'Flash metering', v[63], rsMinoltaFlashMeteringLkup, '', ttUInt32); // or is the index 53?
end;
end;
$0010: // CameraInfoA100
begin
//p := @AData[0];
//... conversion stopped due to unclear documentation on
// https://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Minolta.html#CameraInfoA100
// --- Is there an index 0?
end;
end;
end;
procedure TMinoltaMakerNoteReader.GetTagDefs(AStream: TStream);
begin
BuildMinoltaTagDefs(FTagDefs)
end;
initialization
RegisterMakerNoteReader(TMinoltaMakerNoteReader, 'Minolta', '');
end.
|
{ Chokyi Ozer 16518269 }
unit udatamhs;
{ Unit ini berisi fungsi & prosedur untuk mengelola data mahasiswa }
{ DEKLARASI TYPE FUNGSI DAN PROSEDUR }
interface
const
NMax = 100;
type
dataMhs = record
NIM : String;
KdKul : String;
Nilai : Integer;
end;
tabNilaiMhs = record
TMhs : array [1..NMax] of dataMhs;
Neff : Integer; { 0..100 }
end;
{ DEKLARASI FUNGSI DAN PROSEDUR }
function EOP (rek : dataMhs) : boolean;
{ Menghasilkan true jika rek = mark }
procedure LoadDataNilai (filename : string; var T : tabNilaiMhs);
{ I.S. : filename terdefinisi, T sembarang }
{ F.S. : Tabel T terisi nilai mahasiswa dengan data yang dibaca
dari file dg nama = filename
T.Neff = 0 jika tidak ada file kosong;
T diisi dengan seluruh isi file atau sampai T penuh. }
procedure UrutNIMAsc (var T : tabNilaiMhs);
{ I.S. : T terdefinisi; T mungkin kosong }
{ F.S. : Isi tabel T terurut membesar menurut NIM. T tetap jika T kosong. }
{ Proses : Gunakan salah satu algoritma sorting yang diajarkan di kelas.
Tuliskan nama algoritmanya dalam bentuk komentar. }
procedure HitungRataRata (T : tabNilaiMhs);
{ I.S. : T terdefinisi; T mungkin kosong }
{ F.S. : Menampilkan nilai rata-rata setiap mahasiswa yang ada dalam tabel dengan format:
<NIM>=<rata-rata>
Nilai rata-rata dibulatkan ke integer terdekat. Gunakan fungsi round.
Jika tabel kosong, tuliskan "Data kosong" }
{ Proses : Menggunakan ide algoritma konsolidasi tanpa separator pada file
eksternal, hanya saja diberlakukan pada tabel. }
procedure SaveDataNilai (filename : string; T : tabNilaiMhs);
{ I.S. : T dan filename terdefinisi; T mungkin kosong }
{ F.S. : Isi tabel T dituliskan pada file dg nama = filename }
{ IMPLEMENTASI FUNGSI DAN PROSEDUR }
implementation
function EOP (rek : dataMhs) : Boolean;
begin
EOP := (rek.NIM = '99999999') and
(rek.KdKul = 'XX9999') and
(rek.Nilai = -999);
end;
procedure LoadDataNilai (filename : String; var T : tabNilaiMhs);
var
f : File of dataMhs;
dat : dataMhs;
begin
Assign(f, filename);
Reset(f);
T.Neff := 0;
Read(f, dat);
while (not EOP(dat)) do
begin
T.Neff := T.Neff + 1;
T.TMhs[T.Neff] := dat;
Read(f, dat);
end;
Close(f);
end;
procedure UrutNIMAsc (var T : tabNilaiMhs);
var
temp : dataMhs;
i, j : Integer;
done : Boolean;
begin
if (T.Neff > 0) then
{ Bubble Sort }
i := 0;
done := False;
while (i < T.Neff) and (not done) do
begin
done := True;
for j := T.Neff downto 2 do
if (T.TMhs[j].NIM < T.TMhs[j-1].NIM) then
begin
temp := T.TMhs[j-1];
T.TMhs[j-1] := T.TMhs[j];
T.TMhs[j] := temp;
done := False;
end;
i := i + 1;
end;
end;
procedure HitungRataRata (T : tabNilaiMhs);
var
current : String;
sum, count : Integer;
i : Integer;
begin
if (T.Neff > 0) then
begin
current := T.TMhs[1].NIM;
sum := T.TMhs[1].Nilai; count := 1;
for i := 2 to T.Neff do
begin
if (T.TMhs[i].NIM <> current) then // Section Baru
begin
Write(current);
Write('=');
WriteLn(Round(sum/count));
current := T.TMhs[i].NIM;
sum := T.TMhs[i].Nilai; count := 1;
end
else
begin
sum := sum + T.TMhs[i].Nilai;
count := count + 1;
end;
end;
Write(current);
Write('=');
WriteLn(Round(sum/count));
end
else
WriteLn('Data kosong');
end;
procedure SaveDataNilai (filename : string; T : tabNilaiMhs);
const
mark : dataMhs = (
NIM : '99999999';
KdKul : 'XX9999';
Nilai : -999;
);
var
f : File of dataMhs;
i : Integer;
begin
Assign(f, filename);
Rewrite(f);
if (T.Neff > 0) then
for i := 1 to T.Neff do
begin
Write(f, T.TMhs[i]);
end;
Write(f, mark);
Close(f);
end;
end. |
unit app_main;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, Spin,
ExtCtrls, BCButton;
type
{ TForm1 }
TForm1 = class(TForm)
BtnRun: TBCButton;
LabelFrom: TLabel;
LabelIterations: TLabel;
LabelTo: TLabel;
MemoResult: TMemo;
PanelFromTo: TPanel;
PanelExecute: TPanel;
SpinEditFrom: TSpinEdit;
SpinEditTo: TSpinEdit;
SpinEditIterations: TSpinEdit;
procedure BtnRunClick(Sender: TObject);
private
FStartTime: Int64;
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
function FibonacciI(N: Word): UInt64;
var
Last, New: UInt64;
I: Word;
begin
if N < 2 then
Result := N else
begin
Last := 0;
Result := 1;
for I := 2 to N do
begin
New := Last + Result;
Last := Result;
Result := New;
end;
end;
end;
procedure TForm1.BtnRunClick(Sender: TObject);
var
i, j: Integer;
begin
MemoResult.Clear;
FStartTime:= GetTickCount64;
MemoResult.Append('>> Start');
MemoResult.Lines.BeginUpdate;
for i := 1 to SpinEditIterations.Value do
begin
MemoResult.Append('Run: ' + IntToStr(i));
for j := SpinEditFrom.Value to SpinEditTo.Value
do MemoResult.Append(IntToStr(FibonacciI(j)));
end;
MemoResult.Lines[0] := MemoResult.Lines[0] + ' >> Elapsed: ' + FloatToStrF((GetTickCount64 - FStartTime) / 1000, ffNumber, 8, 4) + ' seconds';
MemoResult.Lines.EndUpdate;
end;
end.
|
//
// This unit is part of the GLScene Project, http://glscene.org
//
{: GLFilePAK<p>
<b>History : </b><font size=-1><ul>
<li>04/06/10 - Yar - Added to GLScene
(Created by Rustam Asmandiarov aka Predator)
</ul><p>
}
unit GLFilePAK;
{$I GLScene.inc}
interface
uses
System.Classes, System.SysUtils,
GLSArchiveManager;
const
SIGN = 'PACK';
Type
TPakHeader = record
Signature: array[0..3] of AnsiChar;
DirOffset: integer;
DirLength: integer;
end;
TFileSection = record
FileName: array[0..119] of AnsiChar;
FilePos: integer;
FileLength: integer;
end;
{ TPAKArchive }
TPAKArchive=class(TBaseArchive)
private
FHeader: TPakHeader;
FStream: TFileStream;
function GetContentCount: integer;
procedure MakeContentList;
protected
Procedure SetCompressionLevel(aValue: TCompressionLevel); override;
public
property ContentCount: integer Read GetContentCount;
procedure LoadFromFile(const FileName: string); override;
procedure Clear; override;
function ContentExists(ContentName: string): boolean; override;
function GetContent(Stream: TStream; index: integer): TStream; override;
function GetContent(index: integer): TStream; override;
function GetContent(ContentName: string): TStream; override;
function GetContentSize(index: integer): integer; override;
function GetContentSize(ContentName: string): integer; override;
procedure AddFromStream(ContentName, Path: string; FS: TStream); override;
procedure AddFromFile(FileName, Path: string); override;
procedure RemoveContent(index: integer); override;
procedure RemoveContent(ContentName: string); override;
procedure Extract(index: integer; NewName: string); override;
procedure Extract(ContentName, NewName: string); override;
end;
//-----------------------------------------------------------
//-----------------------------------------------------------
//-----------------------------------------------------------
implementation
//-----------------------------------------------------------
//-----------------------------------------------------------
//-----------------------------------------------------------
var
Dir: TFileSection;
{ TPAKArchive }
function TPAKArchive.GetContentCount: integer;
begin
Result := FHeader.DirLength div SizeOf(TFileSection);
end;
procedure TPAKArchive.MakeContentList;
var
I: integer;
begin
FStream.Seek(FHeader.DirOffset, soFromBeginning);
FContentList.Clear;
for i := 0 to ContentCount - 1 do
begin
FStream.ReadBuffer(Dir, SizeOf(TFileSection));
FContentList.Add(string(Dir.FileName));
end;
end;
procedure TPAKArchive.SetCompressionLevel(aValue: TCompressionLevel);
begin
aValue := clNone;
inherited SetCompressionLevel(aValue);
end;
procedure TPAKArchive.LoadFromFile(const FileName: string);
begin
FFileName := FileName;
FStream := TFileStream.Create(FileName, fmOpenReadWrite or fmShareDenyWrite);
//?????????? ?????
If (FStream = nil) then exit;
if FStream.Size = 0 then
begin
FHeader.Signature := SIGN;
FHeader.DirOffset := SizeOf(TPakHeader);
FHeader.DirLength := 0;
FStream.WriteBuffer(FHeader, SizeOf(TPakHeader));
FStream.Position := 0;
end;
FStream.ReadBuffer(FHeader, SizeOf(TPakHeader));
if (FHeader.Signature <> SIGN) then
begin
FreeAndNil(FStream); // nil it too to avoid own Clear() giving AV
raise Exception.Create(FileName+' - This is not PAK file');
Exit;
end;
if ContentCount <> 0 then
MakeContentList;
end;
procedure TPAKArchive.Clear;
begin
If FStream <> nil then FStream.Free;
FContentList.Clear;
end;
function TPAKArchive.ContentExists(ContentName: string): boolean;
begin
Result := (FContentList.IndexOf(ContentName) > -1);
end;
function TPAKArchive.GetContent(Stream: TStream; index: integer): TStream;
begin
FStream.Seek(FHeader.DirOffset + SizeOf(TFileSection) * index, soFromBeginning);
FStream.Read(Dir, SizeOf(TFileSection));
FStream.Seek(Dir.FilePos, soFromBeginning);
Result := Stream;
Result.CopyFrom(FStream, Dir.FileLength);
Result.Position := 0;
end;
function TPAKArchive.GetContent(index: integer): TStream;
begin
Result:=GetContent(TMemoryStream.Create, index);
end;
function TPAKArchive.GetContent(ContentName: string): TStream;
begin
Result := nil;
if ContentExists(ContentName) then
Result := GetContent(FContentList.IndexOf(ContentName));
end;
function TPAKArchive.GetContentSize(index: integer): integer;
begin
FStream.Seek(FHeader.DirOffset + SizeOf(TFileSection) * index, soFromBeginning);
FStream.Read(Dir, SizeOf(Dir));
Result := Dir.FileLength;
end;
function TPAKArchive.GetContentSize(ContentName: string): integer;
begin
Result := -1;
if ContentExists(ContentName) then
Result := GetContentSize(FContentList.IndexOf(ContentName));
end;
procedure TPAKArchive.AddFromStream(ContentName, Path: string; FS: TStream);
var
Temp: TMemoryStream;
begin
//?????????? ?????
If (FStream = nil) or ContentExists(ContentName) then exit;
Temp := nil;
FStream.Position := FHeader.DirOffset;
if FHeader.DirLength > 0 then
begin
Temp := TMemoryStream.Create;
Temp.CopyFrom(FStream, FHeader.DirLength);
Temp.Position := 0;
FStream.Position := FHeader.DirOffset;
end;
Dir.FilePos := FHeader.DirOffset;
Dir.FileLength := FS.Size;
FStream.CopyFrom(FS, 0);
FHeader.DirOffset := FStream.Position;
if FHeader.DirLength > 0 then
begin
FStream.CopyFrom(Temp, 0);
Temp.Free;
end;
StrPCopy(Dir.FileName, AnsiString(Path + ExtractFileName(ContentName)));
FStream.WriteBuffer(Dir, SizeOf(TFileSection));
FHeader.DirLength := FHeader.DirLength + SizeOf(TFileSection);
FStream.Position := 0;
FStream.WriteBuffer(FHeader, SizeOf(TPakHeader));
FContentList.Add(string(Dir.FileName));
end;
procedure TPAKArchive.AddFromFile(FileName, Path: string);
var
FS: TFileStream;
begin
if not SysUtils.FileExists(FileName) then
exit;
FS := TFileStream.Create(FileName, fmOpenRead);
try
AddFromStream(FileName, Path, FS);
finally
FS.Free;
end;
end;
procedure TPAKArchive.RemoveContent(index: integer);
var
Temp: TMemoryStream;
i: integer;
f: TFileSection;
begin
Temp := TMemoryStream.Create;
FStream.Seek(FHeader.DirOffset + SizeOf(TFileSection) * index, soFromBeginning);
FStream.ReadBuffer(Dir, SizeOf(TFileSection));
FStream.Seek(Dir.FilePos + Dir.FileLength, soFromBeginning);
Temp.CopyFrom(FStream, FStream.Size - FStream.Position);
FStream.Position := Dir.FilePos;
FStream.CopyFrom(Temp, 0);
FHeader.DirOffset := FHeader.DirOffset - dir.FileLength;
Temp.Clear;
for i := 0 to ContentCount - 1 do
if i > index then
begin
FStream.Seek(FHeader.DirOffset + SizeOf(TFileSection) * i, soFromBeginning);
FStream.ReadBuffer(f, SizeOf(TFileSection));
FStream.Position := FStream.Position - SizeOf(TFileSection);
f.FilePos := f.FilePos - dir.FileLength;
FStream.WriteBuffer(f, SizeOf(TFileSection));
end;
i := FHeader.DirOffset + SizeOf(TFileSection) * index;
FStream.Position := Cardinal(i + SizeOf(TFileSection));
if FStream.Position < FStream.Size then
begin
Temp.CopyFrom(FStream, FStream.Size - FStream.Position);
FStream.Position := i;
FStream.CopyFrom(Temp, 0);
end;
Temp.Free;
FHeader.DirLength := FHeader.DirLength - SizeOf(TFileSection);
FStream.Position := 0;
FStream.WriteBuffer(FHeader, SizeOf(TPakHeader));
FStream.Size := FStream.Size - dir.FileLength - SizeOf(TFileSection);
MakeContentList;
end;
procedure TPAKArchive.RemoveContent(ContentName: string);
begin
if ContentExists(ContentName) then
RemoveContent(FContentList.IndexOf(ContentName));
end;
procedure TPAKArchive.Extract(index: integer; NewName: string);
var
vExtractFileStream: TFileStream;
vTmpStream: Tstream;
begin
if NewName = '' then
Exit;
if (index < 0) or (index >= ContentCount) then
exit;
vExtractFileStream := TFileStream.Create(NewName, fmCreate);
vTmpStream := GetContent(index);
vExtractFileStream.CopyFrom(vTmpStream, 0);
vTmpStream.Free;
vExtractFileStream.Free;
end;
procedure TPAKArchive.Extract(ContentName, NewName: string);
begin
if ContentExists(ContentName) then
Extract(FContentList.IndexOf(ContentName), NewName);
end;
initialization
RegisterArchiveFormat('pak','GLScene PAK File',TPAKArchive);
end.
|
{*******************************************************}
{ }
{ Delphi Visual Component Library }
{ }
{ Copyright(c) 2016 Embarcadero Technologies, Inc. }
{ All rights reserved }
{ }
{*******************************************************}
unit Vcl.Consts;
interface
resourcestring
SOpenFileTitle = 'Abrir';
SCantWriteResourceStreamError = 'Não é possível gravar em uma Stream de recusos somente de leitura';
SDuplicateReference = 'Objeto chamado duas vezes pela mesma instância';
SClassMismatch = 'Recurso %s é de uma classe incorreta';
SInvalidTabIndex = 'Indexador do TAB fora de faixa';
SInvalidTabPosition = 'Posição da aba incompatível com Estilo da aba corrente';
SInvalidTabStyle = 'Estilo da aba incompatível com a posição da aba corrente';
SInvalidBitmap = 'Bitmap inválido';
SInvalidIcon = 'Ícone inválido';
SInvalidMetafile = 'Metafile inválido';
SInvalidPixelFormat = 'Formato de pixel inválido';
SInvalidImage = 'Imagem inválida';
SBitmapEmpty = 'O Bitmap está vazio';
SScanLine = 'Índice da linha de escala está fora da faixa';
SChangeIconSize = 'Não é possível alterar o tamanho do ícone';
SChangeWicSize = 'Cannot change the size of a WIC Image';
SOleGraphic = 'Operação inválida no objeto TOleGraphic';
SUnknownExtension = 'Arquivo de imagem com extenção ".%s" desconhecido';
SUnknownClipboardFormat = 'Formato não suportado';
SOutOfResources = 'Sistema sem recursos ou com baixa memória';
SNoCanvasHandle = 'O canvas não esta conseguindo desenhar';
SInvalidTextFormatFlag = 'Text format flag ''%s'' not supported';
SInvalidImageSize = 'Tamanho de imagem inválido';
STooManyImages = 'Muitas imagens';
SDimsDoNotMatch = 'Dimensões da imagem diferente da lista de dimensões';
SInvalidImageList = 'ImageList inválido';
SReplaceImage = 'Não é possível trocar a imagem';
SInsertImage = 'Não é possível inserir a imagem';
SImageIndexError = 'Indexador do ImageList inválido';
SImageReadFail = 'Falha ao ler os dados do ImageList para a stream';
SImageWriteFail = 'Falha ao gravar dados no ImageList para a stream';
SWindowDCError = 'Erro ao criar a janela de contexto do dispositivo';
SClientNotSet = 'Cliente do TDrag não inicializado';
SWindowClass = 'Erro criando a classe da janela';
SWindowCreate = 'Erro criando a janela';
SCannotFocus = 'Não é possível focalizar uma janela desabilitada ou invisível';
SParentRequired = 'Controle "%s" não tem Janela antecessora';
SParentGivenNotAParent = 'Controle requerido não é um ancestral de "%s"';
SMDIChildNotVisible = 'Não é possível esconder um formulário filho MDI';
SVisibleChanged = 'Não é possível trocar a propriedade "Visible" em OnShow ou OnHide';
SCannotShowModal = 'Não é possível marcar uma janela visível como modal';
SScrollBarRange = 'Propriedade Scrollbar está fora de faixa';
SPropertyOutOfRange = 'A propriedade %s está fora de faixa';
SMenuIndexError = 'Índice do menu fora de faixa';
SMenuReinserted = 'Menu inserido duplicadamente';
SMenuNotFound = 'Este sub-menu não está em um menu';
SNoTimers = 'Não há timers disponíveis';
SNotPrinting = 'A Impressora não está imprimindo agora';
SPrinting = 'Impressão em progresso';
SPrinterIndexError = 'Indice de impressoras fora de faixa';
SInvalidPrinter = 'A impressora selecionada não é válida';
SDeviceOnPort = '"%s" em "%s"';
SGroupIndexTooLow = 'GroupIndex não pode ser menor que o ítem de menu anterior ao GroupIndex';
STwoMDIForms = 'Não é possível ter mais de um formulário MDI por aplicação';
SNoMDIForm = 'Não foi possível criar o formulário. Não há formulários MDI ativos neste momento';
SImageCanvasNeedsBitmap = 'Não é possível modificar um TImage que contém um bitmap';
SControlParentSetToSelf = 'Um controle não pode ter ele mesmo como seu antecessor';
SOKButton = 'OK';
SCancelButton = 'Cancelar';
SYesButton = '&Sim';
SNoButton = '&Não';
SHelpButton = '&Ajuda';
SCloseButton = '&Fechar';
SIgnoreButton = '&Ignorar';
SRetryButton = '&Repetir';
SAbortButton = 'Abortar';
SAllButton = '&Todos';
SCannotDragForm = 'Não é possível arrastar um formulário';
SPutObjectError = 'PutObject não definido para ítem';
SCardDLLNotLoaded = 'Não foi possível carregar a biblioteca "CARDS.DLL"';
SDuplicateCardId = 'Encontrada uma duplicata de CardId';
SDdeErr = 'Um erro retornado pelo DDE ($0%x)';
SDdeConvErr = 'Erro no DDE - conversação não estabelecida ($0%x)';
SDdeMemErr = 'Erro ocorrido quando DDE rodou sem memória ($0%x)';
SDdeNoConnect = 'Incapaz de conectar conversação DDE';
SFB = 'FB';
SFG = 'FG';
SBG = 'BG';
SOldTShape = 'Não é possível carregar uma versão antiga de TShape';
SVMetafiles = 'Metafiles';
SVEnhMetafiles = 'Metafiles realçado';
SVIcons = 'Ícone';
SVBitmaps = 'Bitmaps';
SVTIFFImages = 'TIFF Images';
SVJPGImages = 'JPEG Images';
SVPNGImages = 'PNG Images';
SVGIFImages = 'GIF Images';
SGridTooLarge = 'Grid muito larga para esta operação';
STooManyDeleted = 'Muitas linhas ou colunas deletadas';
SIndexOutOfRange = 'Índice do grid fora de faixa';
SFixedColTooBig = 'Contador de colunas fixas deve ser menor ou igual que o número de colunas';
SFixedRowTooBig = 'Contador de linhas fixas deve ser menor ou igual ao número de linhas';
SInvalidStringGridOp = 'Não é possível inserir ou deletar linhas da grade';
SInvalidEnumValue = 'Valor Numérico inválido';
SInvalidNumber = 'Valor numérico inválido';
SOutlineIndexError = 'Índice de saída inválido';
SOutlineExpandError = 'O antecessor deve ser expandido';
SInvalidCurrentItem = 'Valor inválido para o ítem corrente';
SMaskErr = 'Valor de entrada inválido';
SMaskEditErr = 'Valor de entrada inválido. Use a tecla Esc para abandonar as alterações';
SOutlineError = 'Índice de saída inválido';
SOutlineBadLevel = 'Nível de transferência incorreto';
SOutlineSelection = 'Seleção inválida';
SOutlineFileLoad = 'Erro ao carregar arquivo';
SOutlineLongLine = 'Linha muito longa';
SOutlineMaxLevels = 'Linha de saída excedeu o limíte máximo';
SMsgDlgWarning = 'Aviso';
SMsgDlgError = 'Erro';
SMsgDlgInformation = 'Informação';
SMsgDlgConfirm = 'Confirmação';
SMsgDlgYes = '&Sim';
SMsgDlgNo = '&Não';
SMsgDlgOK = 'OK';
SMsgDlgCancel = 'Cancela';
SMsgDlgHelp = '&Ajuda';
SMsgDlgHelpNone = 'Ajuda não disponível';
SMsgDlgHelpHelp = 'Ajuda';
SMsgDlgAbort = '&Abortar';
SMsgDlgRetry = '&Repetir';
SMsgDlgIgnore = '&Ignorar';
SMsgDlgAll = '&Todos';
SMsgDlgNoToAll = 'N&ão para todos';
SMsgDlgYesToAll = 'S&im para todos';
SMsgDlgClose = '&Fechar';
SmkcBkSp = 'BkSp';
SmkcTab = 'Tab';
SmkcEsc = 'Esc';
SmkcEnter = 'Enter';
SmkcSpace = 'Space';
SmkcPgUp = 'PgUp';
SmkcPgDn = 'PgDn';
SmkcEnd = 'End';
SmkcHome = 'Home';
SmkcLeft = 'Left';
SmkcUp = 'Up';
SmkcRight = 'Right';
SmkcDown = 'Down';
SmkcIns = 'Ins';
SmkcDel = 'Del';
SmkcShift = 'Shift+';
SmkcCtrl = 'Ctrl+';
SmkcAlt = 'Alt+';
srUnknown = '(Ignorado)';
srNone = '(Nenhum)';
SOutOfRange = 'Valor deve estar entre %d e %d';
SDateEncodeError = 'Arqumento inválido para decodificar data';
SDefaultFilter = 'Todos os arquivos (*.*)|*.*';
sAllFilter = 'Todos';
SNoVolumeLabel = ': [ - sem rótulo - ]';
SInsertLineError = 'Não é possível inserir linhas';
SConfirmCreateDir = 'O diretório especificado não existe. Criá-lo?';
SSelectDirCap = 'Selecione o diretório';
SDirNameCap = 'Diretório &Nome:';
SDrivesCap = 'D&rives:';
SDirsCap = '&Diretorios:';
SFilesCap = '&Arquivos: (*.*)';
SNetworkCap = 'R&ede...';
SColorPrefix = 'Cor' deprecated; //!! obsolete - delete in 5.0
SColorTags = 'ABCDEFGHIJKLMNOP' deprecated; //!! obsolete - delete in 5.0
SInvalidClipFmt = 'Formato na área de transferência inválido';
SIconToClipboard = 'Área de transferência não suporta ícones';
SCannotOpenClipboard = 'Não posso abrir a área de transferência: %s';
SDefault = 'Padrão';
SInvalidMemoSize = 'Texto excedeu a capacidade de 32K';
SCustomColors = 'Personalizar Cores';
SInvalidPrinterOp = 'Operação não suportada ao selecionar impressora';
SNoDefaultPrinter = 'Esta impressora selecionada não é a default';
SIniFileWriteError = 'Incapaz de gravar para "%s"';
SBitsIndexError = 'Índice de Bits fora de faixa';
SUntitled = '(Sem Título)';
SInvalidRegType = 'Tipo de dado inválido para "%s"';
SUnknownConversion = 'Incapaz de converter arquivo de extenção (.%s) para RichEdit';
SDuplicateMenus = 'Menu "%s" já está inicializado e usado por outro formulário';
SPictureLabel = 'Imagem:';
SPictureDesc = ' (%dx%d)';
SPreviewLabel = 'Visualizar';
SCannotOpenAVI = 'Não é possível abrir arquivo AVI';
SNotOpenErr = 'Dispositivo MCI não aberto';
SMPOpenFilter = 'Todos arquivos (*.*)|*.*|Arquivos wave (*.wav)|*.wav|Arquivos Midi (*.mid)|*.mid|Vídeo para Windows (*.avi)|*.avi';
SMCINil = '';
SMCIAVIVideo = 'AVIVídeo';
SMCICDAudio = 'CDAudio';
SMCIDAT = 'DAT';
SMCIDigitalVideo = 'Vídeo Digital';
SMCIMMMovie = 'MMMovie';
SMCIOther = 'Outro';
SMCIOverlay = 'Sobreposto';
SMCIScanner = 'Scanner';
SMCISequencer = 'Seqüência';
SMCIVCR = 'VCR';
SMCIVideodisc = 'Vídeo disco';
SMCIWaveAudio = 'Áudio Wave';
SMCIUnknownError = 'Código de erro desconhecido';
SBoldItalicFont = 'Negrito Itálico';
SBoldFont = 'Negrito';
SItalicFont = 'Itálico';
SRegularFont = 'Normal';
SPropertiesVerb = 'Propriedades';
SServiceFailed = 'Falha de serviço em %s: %s';
SExecute = 'Executar';
SStart = 'Iniciar';
SStop = 'Parar';
SPause = 'pausa';
SContinue = 'continuar';
SInterrogate = 'interrogar';
SShutdown = 'Reiniciar';
SCustomError = 'Falha de serviço sob a mensagem (%d): %s';
SServiceInstallOK = 'Serviço instalado com sucesso';
SServiceInstallFailed = 'Serviço "%s" falhou ou foi instalado com erro: "%s"';
SServiceUninstallOK = 'Serviço desinstalado com successo';
SServiceUninstallFailed = 'Serviço "%s" falhou ou foi desinstalado com erro: "%s"';
SDockedCtlNeedsName = 'O controle acoplado deve ter um conhecido';
SDockTreeRemoveError = 'Erro removendo controle da árvore';
SDockZoneNotFound = ' - Zona da doca não encontrada';
SDockZoneHasNoCtl = ' - Zona da doca não tem controle';
SDockZoneVersionConflict = 'Erro ao carregar fluxo da zona da doca. ' +
'Esperando Versão %d, mas achou %d.';
SAllCommands = 'Todos Comandos';
SDuplicateItem = 'Lista não permite duplicados ($0%x)';
STextNotFound = 'Texto não encontrado: "%s"';
SBrowserExecError = 'Nenhum navegador padrão é especificado';
SColorBoxCustomCaption = 'Customizar...';
SMultiSelectRequired = 'Mode multiseleção deve be on for this feature';
SPromptArrayTooShort = 'Length of value array must be >= length of prompt array';
SPromptArrayEmpty = 'Prompt array must not be empty';
SUsername = '&Username';
SPassword = '&Password';
SDomain = '&Domain';
SLogin = 'Login';
SKeyCaption = 'Chave';
SValueCaption = 'Valor';
SKeyConflict = 'Uma chave com o nome de "%s" já existe';
SKeyNotFound = 'Chave "%s" não encontrada';
SNoColumnMoving = 'goColMoving não é uma opção suportada';
SNoEqualsInKey = 'Chave não pode conter sinal igual a ("=")';
SSendError = 'Erro enviando email';
SAssignSubItemError = 'Não é possível associar um subítem de uma actionbar quanto um de seus antecessores estiver associado ao actionbar';
SDeleteItemWithSubItems = 'O item "%s" possui subitens, apagar mesmo assim?';
SDeleteNotAllowed = 'Não é permitido apagar este item';
SMoveNotAllowed = 'Item "%s" não tem permissão de ser movido';
SMoreButtons = 'Mais Botões';
SErrorDownloadingURL = 'Erro carregando URL: "%s"';
SUrlMonDllMissing = 'Impossível carregar "%s"';
SAllActions = '(Todas as Ações)';
SNoCategory = '(Sem Categoria)';
SExpand = 'Expandir';
SErrorSettingPath = 'Erro ajustando path: "%s"';
SLBPutError = 'Erro tentando inserir ítens em um listbox de estilo virtual';
SErrorLoadingFile = 'Erro carregando arquivo de ajustes salvos anteriormente: "%s"'#13'Você gostaria de apagá-lo?';
SResetUsageData = 'Restaurar todos os dados usados?';
SFileRunDialogTitle = 'Executar';
SNoName = '(Sem Nome Name)';
SErrorActionManagerNotAssigned = 'ActionManager deve primeiro ser atribuído';
SAddRemoveButtons = '&Adiciona ou Remove Botões';
SResetActionToolBar = 'Restaurar Toolbar';
SCustomize = '&Customizar';
SSeparator = 'Separador';
SCircularReferencesNotAllowed = 'Referências circulares não são permitidas';
SCannotHideActionBand = '"%s" não pode ser ocultada';
SErrorSettingCount = 'Erro ajustando %s.Count';
SListBoxMustBeVirtual = 'O Estilo do Listbox (%s) deve ser virtual na ordem para ajustar o Countador';
SUnableToSaveSettings = 'Não foi possível salvar as alterações';
SRestoreDefaultSchedule = 'Você gostaria de restaurar para a Programação Prioritária padrão?';
SNoGetItemEventHandler = 'Nemhum manipulador de evento OnGetItem atribuído';
SInvalidColorMap = 'ActionBand com mapa de cores inválido. Ele requer mapa de cores do tipo TCustomActionBarColorMapEx';
SDuplicateActionBarStyleName = 'Um estilo chamado "%s" já foi registrado';
SMissingActionBarStyleName = 'A style named %s has not been registered';
SStandardStyleActionBars = 'Estilo Standard';
SXPStyleActionBars = 'Estilo XP';
SActionBarStyleMissing = 'Unit sem nenhum estilo ActionBand presente na cláusula uses.'#13 +
'Sua aplicação deve incluir qualquer XPStyleActnCtrls, StdStyleActnCtrls ou ' +
'um componente ActionBand de terceiros presente na cláusula uses.';
sParameterCannotBeNil = '%s parâmetro em chamada %s não pode ser nulo';
SInvalidColorString = 'Cor Inválida da string';
SActionManagerNotAssigned = '%s ActionManager property has not been assigned';
SInvalidPath = '"%s" é um caminho inválido';
SInvalidPathCaption = 'Caminho inválido';
SANSIEncoding = 'ANSI';
SASCIIEncoding = 'ASCII';
SUnicodeEncoding = 'Unicode';
SBigEndianEncoding = 'Big Endian Unicode';
SUTF8Encoding = 'UTF-8';
SUTF7Encoding = 'UTF-7';
SEncodingLabel = 'Codificando:';
sCannotAddFixedSize = 'Não pode adicionar colunas ou linhas enquanto estilo expandido é tamanho fixo';
sInvalidSpan = '''%d'' não é um span valido';
sInvalidRowIndex = 'Indice da Linha, %d, fora da faixa';
sInvalidColumnIndex = 'Indice da Coluna, %d, fora da faixa';
sInvalidControlItem = 'ControlItem.Control não pode ser fixado possuindo GridPanel';
sCannotDeleteColumn = 'Não pode ser excluida uma coluna que contem controles';
sCannotDeleteRow = 'Não pode ser excluída uma linha que contem controles';
sCellMember = 'Member';
sCellSizeType = 'Tipo do Tamanho';
sCellValue = 'Valor';
sCellAutoSize = 'Auto';
sCellPercentSize = 'Por centos';
sCellAbsoluteSize = 'Absoluto';
sCellColumn = 'Coluna%d';
sCellRow = 'Linha%d';
STrayIconRemoveError = 'Não pode remover ícone de notificação';
STrayIconCreateError = 'Não pode criar ícone de notificação';
SPageControlNotSet = 'PageControl deve ser primeiramente designado';
SWindowsVistaRequired = '%s requires Windows Vista or later';
SXPThemesRequired = '%s requires themes to be enabled';
STaskDlgButtonCaption = 'Button%d';
STaskDlgRadioButtonCaption = 'RadioButton%d';
SInvalidTaskDlgButtonCaption = 'Caption cannot be empty';
SInvalidCategoryPanelParent = 'CategoryPanel must have a CategoryPanelGroup as its parent';
SInvalidCategoryPanelGroupChild = 'Only CategoryPanels can be inserted into a CategoryPanelGroup';
SInvalidCanvasOperation = 'Invalid canvas operation';
SNoOwner = '%s has no owner';
SRequireSameOwner = 'Source and destination require the same owner';
SDirect2DInvalidOwner = '%s cannot be owned by a different canvas';
SDirect2DInvalidSolidBrush = 'Not a solid color brush';
SDirect2DInvalidBrushStyle = 'Invalid brush style';
SKeyboardLocaleInfo = 'Error retrieving locale information';
SKeyboardLangChange = 'Failed to change input language';
SOnlyWinControls = 'You can only tab dock TWinControl based Controls';
SNoKeyword = 'No help keyword specified.';
SStyleLoadError = 'Unable to load style ''%s''';
SStyleLoadErrors = 'Unable to load styles: %s';
SStyleRegisterError = 'Style ''%s'' already registered';
SStyleClassRegisterError = 'Style class ''%s'' already registered';
SStyleNotFound = 'Style ''%s'' not found';
SStyleClassNotFound = 'Style class ''%s'' not found';
SStyleInvalidHandle = 'Invalid style handle';
SStyleFormatError = 'Invalid style format';
SStyleFileDescription = 'VCL Style File';
SStyleHookClassRegistered = 'Class ''%s'' is already registered for ''%s''';
SStyleHookClassNotRegistered = 'Class ''%s'' is not registered for ''%s''';
SStyleInvalidParameter = '%s parameter cannot be nil';
SStyleHookClassNotFound = 'A StyleHook class has not been registered for %s';
SStyleFeatureNotSupported = 'Feature not supported by this style';
SStyleNotRegistered = 'Style ''%s'' is not registered';
SStyleUnregisterError = 'Cannot unregister the system style';
SStyleNotRegisteredNoName = 'Style not registered';
// ColorToPrettyName strings
SNameBlack = 'Black';
SNameMaroon = 'Maroon';
SNameGreen = 'Green';
SNameOlive = 'Olive';
SNameNavy = 'Navy';
SNamePurple = 'Purple';
SNameTeal = 'Teal';
SNameGray = 'Gray';
SNameSilver = 'Silver';
SNameRed = 'Red';
SNameLime = 'Lime';
SNameYellow = 'Yellow';
SNameBlue = 'Blue';
SNameFuchsia = 'Fuchsia';
SNameAqua = 'Aqua';
SNameWhite = 'White';
SNameMoneyGreen = 'Money Green';
SNameSkyBlue = 'Sky Blue';
SNameCream = 'Cream';
SNameMedGray = 'Medium Gray';
SNameActiveBorder = 'Active Border';
SNameActiveCaption = 'Active Caption';
SNameAppWorkSpace = 'Application Workspace';
SNameBackground = 'Background';
SNameBtnFace = 'Button Face';
SNameBtnHighlight = 'Button Highlight';
SNameBtnShadow = 'Button Shadow';
SNameBtnText = 'Button Text';
SNameCaptionText = 'Caption Text';
SNameDefault = 'Default';
SNameGradientActiveCaption = 'Gradient Active Caption';
SNameGradientInactiveCaption = 'Gradient Inactive Caption';
SNameGrayText = 'Gray Text';
SNameHighlight = 'Highlight Background';
SNameHighlightText = 'Highlight Text';
SNameHotLight = 'Hot Light';
SNameInactiveBorder = 'Inactive Border';
SNameInactiveCaption = 'Inactive Caption';
SNameInactiveCaptionText = 'Inactive Caption Text';
SNameInfoBk = 'Info Background';
SNameInfoText = 'Info Text';
SNameMenu = 'Menu Background';
SNameMenuBar = 'Menu Bar';
SNameMenuHighlight = 'Menu Highlight';
SNameMenuText = 'Menu Text';
SNameNone = 'None';
SNameScrollBar = 'Scroll Bar';
SName3DDkShadow = '3D Dark Shadow';
SName3DLight = '3D Light';
SNameWindow = 'Window Background';
SNameWindowFrame = 'Window Frame';
SNameWindowText = 'Window Text';
SInvalidBitmapPixelFormat = 'Invalid bitmap pixel format, should be a 32 bit image';
SJumplistsItemErrorGetpsi = 'Querying the IPropertyStore interface';
SJumplistsItemErrorInitializepropvar = 'Initializing a variant property';
SJumplistsItemErrorSetps = 'Setting the value of a property store';
SJumplistsItemErrorCommitps = 'Committing a property store';
SJumplistsItemErrorSettingarguments = 'Setting the arguments of a jump list item';
SJumplistsItemErrorSettingpath = 'Setting the path of a jump list item';
SJumplistsItemErrorSettingicon = 'Setting the icon location of a jump list item';
SJumplistsItemErrorAddingtobjarr = 'Adding an item to an object array';
SJumplistsItemErrorGettingobjarr = 'Querying the IObjectArray interface';
SJumplistsItemErrorNofriendlyname = 'The FriendlyName property of an item must not be empty';
SJumplistsItemException = 'JumpListItem exception: Error %d: %s';
SJumplistException = 'JumpList exception: Error %d: %s';
SJumplistErrorBeginlist = 'Initiating a building session for a new jump list';
SJumplistErrorAppendrc = 'Appending an item to the recent files category of a new jump list';
SJumplistErrorAppendfc = 'Appending an item to the frequent files category of a new jump list';
SJumplistErrorAddusertasks = 'Adding your tasks to a new jump list';
SJumplistErrorAddcategory = 'Adding a custom category (''%s'') and its child items to a new jump list';
SJumplistErrorCommitlist = 'Committing a new jump list';
SJumplistExceptionInvalidOS = 'The current operating system does not support jump lists';
SJumplistExceptionAppID = 'The current process already has an application ID: %s';
{ BeginInvoke }
sBeginInvokeNoHandle = 'Cannot call BeginInvoke on a control with no parent or window handle';
SToggleSwitchCaptionOn = 'On';
SToggleSwitchCaptionOff = 'Off';
SInvalidRelativePanelControlItem = 'ControlItem.Control cannot be set to owning RelativePanel';
SInvalidRelativePanelSibling = 'Control is not a sibling within RelativePanel';
SInvalidRelativePanelSiblingSelf = 'Control cannot be positioned relative to itself';
implementation
end. |
unit WiseErr;
interface
uses
Dialogs,
WiseConst, main;
function ErrorDeamon(ErrorNumber:integer; ErrorString: string):integer;
procedure StatusMesage(msg: string);
implementation
Type
ErrorEvent = record
N :integer;
Msg: string;
Deg: integer;
Ret: integer;
end;
Const
ErrType: array[0..2] of string =( 'Warning','Error', 'Fatal' );
var
ErrorVec: array[1..10] of ErrorEvent =(
(N: 000; Msg: 'Unknown Error in: '; Deg: 2; Ret: IO_Cmd_Failed)
,(N: 001; Msg: 'Setting command directory not found: '; Deg: 2; Ret: CommStatusError)
,(N: 002; Msg: 'Setting status file not found: '; Deg: 2; Ret: CommStatusError)
,(N: 003; Msg: 'Filter command directory not found: '; Deg: 2; Ret: ConnectFailled)
,(N: 004; Msg: 'Filter status file not found: '; Deg: 2; Ret: ConnectFailled)
,(N: 005; Msg: 'CCD command directory not found: '; Deg: 2; Ret: 0)
,(N: 010; Msg: 'Value out of range for '; Deg: 2; Ret: IO_Cmd_Failed)
,(N: 100; Msg: 'Device is Busy: '; Deg: 1; Ret: IO_Cmd_Failed)
,(N: 200; Msg: 'Wrong time format: '; Deg: 1; Ret: -1) //return value?
,(N: 200; Msg: 'Wrong coordinate format: '; Deg: 1; Ret: -1) //return value?
);
function ErrorDeamon(ErrorNumber:integer; ErrorString: string):integer;
var
i : integer;
j : integer;
begin
//find error
j:=0;
for i:=2 to High(ErrorVec) do
if ErrorVec[i].N = ErrorNumber then
j:=i;
if j=0 then
j:=1;
ShowMessage(ErrType[ErrorVec[j].Deg]+': '+ErrorVec[j].Msg+ErrorString);
Result := ErrorVec[j].Ret;
end;
procedure StatusMesage(msg: string);
begin
ROForm.StatusBar1.Panels[0].Text:=msg;
end;
end.
|
unit urs.DataSetHelper;
interface
uses
System.Rtti, System.Generics.Collections,
Data.DB;
type
TDBFieldsMapping = (mapAuto, mapManual);
var
DefaultDBFieldsMapping: TDBFieldsMapping = mapAuto;
type
DBFieldsAttribute = class(TCustomAttribute)
strict protected
FMode: TDBFieldsMapping;
public
constructor Create(AMode: TDBFieldsMapping);
property Mode: TDBFieldsMapping read FMode;
end;
DBFieldAttribute = class(TCustomAttribute)
strict protected
FIsStored: Boolean;
FFieldName: String;
public
constructor Create; overload;
constructor Create(const AIsStored: Boolean); overload;
constructor Create(const AFieldName: string); overload;
property IsStored: Boolean read FIsStored;
property FieldName: String read FFieldName;
end;
TDataSetHelper = class helper for TDataSet
private type
TDataSetRecord<T> = class
private type
TMapping = class
private
FField: TField;
FIsInstanceType: Boolean;
protected
function GetPointer(var Target: T): Pointer;
property IsInstanceType: Boolean read FIsInstanceType;
public
constructor Create(AField: TField; AIsInstanceType: Boolean);
procedure LoadFromField(var Target: T); virtual; abstract;
procedure StoreToField(var Source: T); virtual; abstract;
end;
TFieldMapping = class(TMapping)
private
FRTTIField: TRTTIField;
public
constructor Create(AField: TField; ARTTIField: TRTTIField; AIsInstanceType: Boolean);
procedure StoreToField(var Source: T); override;
procedure LoadFromField(var Target: T); override;
end;
TPropMapping = class(TMapping)
private
FRTTIProp: TRttiProperty;
public
constructor Create(AField: TField; ARTTIProp: TRttiProperty; AIsInstanceType: Boolean);
procedure StoreToField(var Source: T); override;
procedure LoadFromField(var Target: T); override;
end;
private
FDataSet: TDataSet;
FInstance: T;
FMapMode: TDBFieldsMapping;
FMappings: TObjectList<TMapping>;
FRTTIContext: TRTTIContext;
function CheckAttributes(obj: TRttiNamedObject): string;
function GetCurrent: T;
function GetMapMode(obj: TRttiNamedObject): TDBFieldsMapping;
procedure LoadMappings;
protected
procedure Initialize; virtual;
property Instance: T read FInstance;
public
constructor Create(ADataSet: TDataSet); overload;
constructor Create(ADataSet: TDataSet; const AInstance: T); overload;
destructor Destroy; override;
procedure LoadFromCurrent(var Target: T);
procedure StoreToCurrent(var Source: T);
property Current: T read GetCurrent;
end;
TDataSetEnumerator<T> = class(TDataSetRecord<T>)
private
FBookmark: TBookmark;
FMoveToFirst: Boolean;
FWasActive: Boolean;
protected
procedure Initialize; override;
public
destructor Destroy; override;
function MoveNext: Boolean;
end;
IRecords<T> = interface
function GetEnumerator: TDataSetEnumerator<T>;
end;
TRecords<T> = class(TInterfacedObject, IRecords<T>)
private
FDataSet: TDataSet;
public
constructor Create(ADataSet: TDataSet);
function GetEnumerator: TDataSetEnumerator<T>; virtual;
end;
TRecordsInstance<T: class> = class(TRecords<T>)
private
FInstance: T;
public
constructor Create(ADataSet: TDataSet; AInstance: T);
function GetEnumerator: TDataSetEnumerator<T>; override;
end;
public
function GetCurrentRec<T: record>: T;
procedure SetCurrentRec<T: record>(AInstance: T);
procedure LoadInstanceFromCurrent<T: class>(AInstance: T);
procedure StoreInstanceToCurrent<T: class>(AInstance: T);
function Records<T: class>(AInstance: T): IRecords<T>; overload;
function Records<T: record>: IRecords<T>; overload;
end;
implementation
uses
System.Sysutils;
constructor DBFieldsAttribute.Create(AMode: TDBFieldsMapping);
begin
inherited Create;
FMode := AMode;
end;
constructor DBFieldAttribute.Create;
begin
inherited Create;
FIsStored := true;
FFieldName := '';
end;
constructor DBFieldAttribute.Create(const AIsStored: Boolean);
begin
inherited Create;
FIsStored := AIsStored;
FFieldName := '';
end;
constructor DBFieldAttribute.Create(const AFieldName: string);
begin
inherited Create;
FIsStored := true;
FFieldName := AFieldName;
end;
procedure TDataSetHelper.LoadInstanceFromCurrent<T>(AInstance: T);
var
tmp: TDataSetRecord<T>;
begin
tmp := TDataSetRecord<T>.Create(Self, AInstance);
try
tmp.LoadFromCurrent(AInstance);
finally
tmp.Free;
end;
end;
function TDataSetHelper.GetCurrentRec<T>: T;
var
tmp: TDataSetRecord<T>;
begin
tmp := TDataSetRecord<T>.Create(Self);
try
result := tmp.Current;
finally
tmp.Free;
end;
end;
procedure TDataSetHelper.StoreInstanceToCurrent<T>(AInstance: T);
var
tmp: TDataSetRecord<T>;
begin
tmp := TDataSetRecord<T>.Create(Self, AInstance);
try
tmp.StoreToCurrent(AInstance);
finally
tmp.Free;
end;
end;
function TDataSetHelper.Records<T>(AInstance: T): IRecords<T>;
begin
Result := TRecordsInstance<T>.Create(Self, AInstance);
end;
function TDataSetHelper.Records<T>: IRecords<T>;
begin
Result := TRecords<T>.Create(Self);
end;
procedure TDataSetHelper.SetCurrentRec<T>(AInstance: T);
var
tmp: TDataSetRecord<T>;
begin
tmp := TDataSetRecord<T>.Create(Self, AInstance);
try
tmp.StoreToCurrent(AInstance);
finally
tmp.Free;
end;
end;
destructor TDataSetHelper.TDataSetEnumerator<T>.Destroy;
{ Restore the DataSet to its previous state. }
begin
if FWasActive then begin
{ if we have a valid bookmark, use it }
if FDataSet.BookmarkValid(FBookmark) then
FDataSet.GotoBookmark(FBookmark);
{ I'm not sure, if FreeBokmark can handle nil pointers - so to be safe }
if FBookmark <> nil then
FDataSet.FreeBookmark(FBookmark);
end
else
FDataSet.Active := false;
{ don't forget this one! }
FDataSet.EnableControls;
inherited;
end;
constructor TDataSetHelper.TDataSetRecord<T>.Create(ADataSet: TDataSet);
begin
Create(ADataSet, Default(T));
end;
constructor TDataSetHelper.TDataSetRecord<T>.Create(ADataSet: TDataSet; const AInstance: T);
begin
inherited Create;
FDataSet := ADataSet;
FInstance := AInstance;
Initialize;
end;
destructor TDataSetHelper.TDataSetRecord<T>.Destroy;
begin
FMappings.Free;
inherited;
end;
function TDataSetHelper.TDataSetRecord<T>.CheckAttributes(obj: TRttiNamedObject): string;
var
attr: TCustomAttribute;
storedAttr: DBFieldAttribute;
begin
case FMapMode of
mapAuto: result := obj.Name;
mapManual: result := '';
end;
for attr in obj.GetAttributes do begin
if attr is DBFieldAttribute then begin
storedAttr := attr as DBFieldAttribute;
if storedAttr.IsStored then begin
if storedAttr.FieldName > '' then begin
Result := storedAttr.FieldName;
end;
end
else begin
Result := '';
end;
Break;
end;
end;
end;
function TDataSetHelper.TDataSetRecord<T>.GetCurrent: T;
begin
Result := Instance;
LoadFromCurrent(Result);
end;
function TDataSetHelper.TDataSetRecord<T>.GetMapMode(obj: TRttiNamedObject): TDBFieldsMapping;
var
attr: TCustomAttribute;
begin
result := DefaultDBFieldsMapping;
for attr in obj.GetAttributes do begin
if attr is DBFieldsAttribute then begin
Exit((attr as DBFieldsAttribute).Mode);
end;
end;
end;
procedure TDataSetHelper.TDataSetRecord<T>.Initialize;
begin
LoadMappings;
end;
procedure TDataSetHelper.TDataSetRecord<T>.LoadFromCurrent(var Target: T);
var
mapping: TMapping;
begin
for mapping in FMappings do begin
mapping.LoadFromField(Target);
end;
end;
procedure TDataSetHelper.TDataSetRecord<T>.LoadMappings;
var
field: TRttiField;
fld: TField;
prop: TRttiProperty;
rttyType: TRTTIType;
begin
FMappings := TObjectList<TMapping>.Create;
FRTTIContext := TRTTIContext.Create;
rttyType := FRTTIContext.GetType(TypeInfo(T));
if rttyType.IsRecord then begin
FInstance := Default(T);
end
else if rttyType.IsInstance then begin
if TValue.From<T>(Instance).AsObject = nil then begin
raise Exception.Create('No instance provided');
end;
end
else begin
raise Exception.Create('Only records and classes allowed');
end;
FMapMode := GetMapMode(rttyType);
for field in rttyType.GetFields do begin
fld := FDataSet.FindField(CheckAttributes(field));
if fld = nil then Continue;
FMappings.Add(TFieldMapping.Create(fld, field, rttyType.IsInstance));
end;
for prop in rttyType.GetProperties do begin
fld := FDataSet.FindField(CheckAttributes(prop));
if fld = nil then Continue;
FMappings.Add(TPropMapping.Create(fld, prop, rttyType.IsInstance));
end;
end;
procedure TDataSetHelper.TDataSetRecord<T>.StoreToCurrent(var Source: T);
var
mapping: TMapping;
begin
for mapping in FMappings do begin
mapping.StoreToField(Source);
end;
end;
procedure TDataSetHelper.TDataSetEnumerator<T>.Initialize;
{ The enumerator is automatically created and destroyed in the for-in loop.
So we remember the active state and set a flag that the first MoveNext will
not move to the next record, but stays on the first one instead. }
begin
{ save the Active state }
FWasActive := FDataSet.Active;
{ avoid flickering }
FDataSet.DisableControls;
if FWasActive then begin
{ get a bookmark of the Current position - even if it is invalid }
FBookmark := FDataSet.GetBookmark;
FDataSet.First;
end
else begin
{ FBookmark is initialized to nil anyway, so no need to set it here }
FDataSet.Active := true;
end;
FMoveToFirst := true;
inherited;
end;
function TDataSetHelper.TDataSetEnumerator<T>.MoveNext: Boolean;
begin
{ Check if we have to move to the first record, which has been done already
during Create. }
if FMoveToFirst then
FMoveToFirst := false
else
FDataSet.Next;
Result := not FDataSet.EoF;
end;
constructor TDataSetHelper.TRecords<T>.Create(ADataSet: TDataSet);
begin
inherited Create;
FDataSet := ADataSet;
end;
function TDataSetHelper.TRecords<T>.GetEnumerator: TDataSetEnumerator<T>;
begin
Result := TDataSetEnumerator<T>.Create(FDataSet);
end;
constructor TDataSetHelper.TDataSetRecord<T>.TMapping.Create(AField: TField; AIsInstanceType: Boolean);
begin
inherited Create;
FField := AField;
FIsInstanceType := AIsInstanceType;
end;
function TDataSetHelper.TDataSetRecord<T>.TMapping.GetPointer(var Target: T): Pointer;
begin
if IsInstanceType then begin
result := TValue.From<T>(Target).AsObject;
end
else begin
result := @Target;
end;
end;
constructor TDataSetHelper.TDataSetRecord<T>.TFieldMapping.Create(AField: TField; ARTTIField: TRTTIField;
AIsInstanceType: Boolean);
begin
inherited Create(AField, AIsInstanceType);
FRTTIField := ARTTIField;
end;
procedure TDataSetHelper.TDataSetRecord<T>.TFieldMapping.LoadFromField(var Target: T);
var
val: TValue;
begin
if FField.IsNull then
val := TValue.Empty
else
val := TValue.FromVariant(FField.Value);
FRTTIField.SetValue(GetPointer(Target), val);
end;
procedure TDataSetHelper.TDataSetRecord<T>.TFieldMapping.StoreToField(var Source: T);
begin
FField.Value := FRTTIField.GetValue(GetPointer(Source)).AsVariant;
end;
constructor TDataSetHelper.TDataSetRecord<T>.TPropMapping.Create(AField: TField; ARTTIProp: TRttiProperty;
AIsInstanceType: Boolean);
begin
inherited Create(AField, AIsInstanceType);
FRTTIProp := ARTTIProp;
end;
procedure TDataSetHelper.TDataSetRecord<T>.TPropMapping.StoreToField(var Source: T);
begin
FField.Value := FRTTIProp.GetValue(GetPointer(Source)).AsVariant;
end;
procedure TDataSetHelper.TDataSetRecord<T>.TPropMapping.LoadFromField(var Target: T);
var
val: TValue;
begin
if FField.IsNull then
val := TValue.Empty
else
val := TValue.FromVariant(FField.Value);
FRTTIProp.SetValue(GetPointer(Target), val);
end;
constructor TDataSetHelper.TRecordsInstance<T>.Create(ADataSet: TDataSet; AInstance: T);
begin
inherited Create(ADataSet);
FInstance := AInstance;
end;
function TDataSetHelper.TRecordsInstance<T>.GetEnumerator: TDataSetEnumerator<T>;
begin
Result := TDataSetEnumerator<T>.Create(FDataSet, FInstance);
end;
end.
|
unit ProgressU;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, AviThread, ExtCtrls;
type
TAviFinishEvent = procedure(Sender: TObject; const filename: string; Success: boolean) of object;
TProgressForm = class(TForm)
Label1: TLabel;
Label2: TLabel;
ProgressBar1: TProgressBar;
Button1: TButton;
Image1: TImage;
Image2: TImage;
Image3: TImage;
Image4: TImage;
Image5: TImage;
Image6: TImage;
Image7: TImage;
Image8: TImage;
procedure FormShow(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
AviAbort: boolean;
function AbortAviQuery: boolean;
{ Private declarations }
public
OnAviFinish: TAviFinishEvent;
AviThread: TAviThread;
//This variable is supposed to keep track of the thread
//which was created together with the TProgressForm.
//But there's always a share violation or something
//when I try to spawn a second thread.
MovieFrames: integer;
procedure AviProgress(Sender: TObject; FrameCount: integer; var abort: boolean);
procedure AviTerminate(Sender: TObject);
procedure BitmapsDone(sender: TObject; BitmapList: TList; BitmapCount: integer);
procedure BadBitmap(Sender: TObject; Bmp: TBitmap; InfoHeaderSize, BitsSize: integer);
{ Public declarations }
end;
implementation
{$R *.dfm}
uses BadBitmapU;
{ TProgressForm }
function TProgressForm.AbortAviQuery: boolean;
begin
Result := MessageDlg('Abort Avi writing?', mtConfirmation, [mbYes, mbNo], 0) = mrYes;
end;
procedure TProgressForm.AviProgress(Sender: TObject; FrameCount: integer;
var abort: boolean);
begin
ProgressBar1.position := FrameCount;
if AviThread.WritingTemporary then
Label2.Caption := '... adding video frames'
else
Label2.Caption := '... writing final file';
abort := AviAbort;
end;
procedure TProgressForm.AviTerminate(Sender: TObject);
var e: Exception;
begin
e := Exception(AviThread.fatalexception);
show;
if e <> nil then
ShowMessage('Avi file writing failed. Err: ' + e.Message)
else
if AviThread.Cancelled then
ShowMessage('Avi file writing aborted')
else
ShowMessage('Avi file writing finished');
if Assigned(OnAviFinish) then
OnAviFinish(Self, AviThread.Avifile, (e = nil) and (not AviThread.Cancelled));
Close;
end;
procedure TProgressForm.FormShow(Sender: TObject);
begin
//assume the fields have been assigned by then
ProgressBar1.max := MovieFrames;
Label1.Caption := 'Avi file: ' + AviThread.Avifile;
Label2.Caption := '... Loading images';
AviThread.OnUpdate := AviProgress;
AviThread.OnTerminate := AviTerminate;
AviThread.OnBitmapsDone:=BitmapsDone;
AviThread.OnBadBitmap:=BadBitmap;
end;
procedure TProgressForm.Button1Click(Sender: TObject);
begin
AviAbort := AbortAviQuery;
end;
procedure TProgressForm.FormCreate(Sender: TObject);
begin
SetBounds(screen.Width - Width, 0, Width, Height);
AviAbort := false;
end;
procedure TProgressForm.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
Action := caFree;
end;
procedure TProgressForm.BitmapsDone(sender: TObject; BitmapList: TList;
BitmapCount: integer);
var i: integer;
im: TImage;
begin
for i:=0 to BitmapCount-1 do
begin
im:=TImage(FindComponent('Image'+inttostr(i+1)));
im.picture.bitmap:=TBitmap(Bitmaplist.items[i]);
end;
end;
procedure TProgressForm.BadBitmap(Sender: TObject; Bmp: TBitmap;
InfoHeaderSize, BitsSize: integer);
begin
with TBadBitmapForm.Create(nil) do
try
Image1.Picture.Bitmap:=Bmp;
Label1.Caption:=InttoStr(InfoHeaderSize);
Label2.Caption:=InttoStr(BitsSize);
ShowModal;
finally
free;
end;
end;
end.
|
{$i deltics.interfacedobjects.inc}
unit Deltics.InterfacedObjects.InterfacedPersistent;
interface
uses
Classes,
Deltics.Multicast;
type
TInterfacedPersistent = class(TPersistent, IUnknown,
IOn_Destroy)
private
fOn_Destroy: IOn_Destroy;
// IUnknown
protected
function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall;
function _AddRef: Integer; stdcall;
function _Release: Integer; stdcall;
// IOn_Destroy
protected
function get_On_Destroy: IOn_Destroy;
public
property On_Destroy: IOn_Destroy read get_On_Destroy implements IOn_Destroy;
end;
implementation
{ TInterfacedPersistent -------------------------------------------------------------------------- }
{ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
function TInterfacedPersistent.QueryInterface(const IID: TGUID;
out Obj): HResult;
begin
if GetInterface(IID, Obj) then
Result := 0
else
Result := E_NOINTERFACE;
end;
{ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
function TInterfacedPersistent._AddRef: Integer;
begin
result := 1; { NO-OP }
end;
{ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
function TInterfacedPersistent._Release: Integer;
begin
result := 1; { NO-OP }
end;
{ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
function TInterfacedPersistent.get_On_Destroy: IOn_Destroy;
// Create the multi-cast event on demand, since we cannot
// guarantee any particular constructor call order and there
// may be dependencies created during construction (e.g. if
// multi-cast event handlers are added before/after any call
// to a particular inherited constructor etc etc)
begin
if NOT Assigned(fOn_Destroy) then
fOn_Destroy := TOnDestroy.Create(self);
result := fOn_Destroy;
end;
end.
|
unit Initializer.TotalWrite;
interface
uses
SysUtils,
Global.LanguageString, Device.PhysicalDrive, Support,
AverageLogger.Write, AverageLogger, OS.EnvironmentVariable, MeasureUnit.DataSize;
type
TMainformTotalWriteApplier = class
private
procedure AppendWriteToWriteLabel;
procedure ApplyTodayUsageByLog(WriteLog: TAverageWriteLogger);
procedure ApplyTotalWriteAsCount;
procedure ApplyTotalWriteAsValue;
procedure ApplyTotalWriteByWriteType;
procedure ApplyTotalWriteConvertedToMiB;
procedure ApplyTotalWriteInCount;
procedure SetUsageLabelByLogAndAvailableType(WriteLog: TAverageWriteLogger);
function IsTotalWriteNotSupported: Boolean;
function KiBtoMiB(SizeInKiB: UInt64): Double;
procedure RefreshWriteLogAndApplyUsageByLog;
procedure RestoreComponentsFromCountIfSet;
procedure SetComponentsForCount;
procedure SetWriteLabelByHostNANDInformation;
procedure ApplyUsageByLog(WriteLog: TAverageWriteLogger);
public
procedure ApplyMainformTotalWrite;
end;
implementation
uses Form.Main;
function TMainformTotalWriteApplier.IsTotalWriteNotSupported: Boolean;
begin
result := fMain.SelectedDrive.SupportStatus.TotalWriteType =
TTotalWriteType.WriteNotSupported;
end;
procedure TMainformTotalWriteApplier.RestoreComponentsFromCountIfSet;
begin
if not fMain.l1Month.Visible then
begin
fMain.l1Month.Visible := false;
fMain.lHost.Top := fMain.lHost.Top + 25;
fMain.lTodayUsage.Top := fMain.lTodayUsage.Top + 15;
fMain.lOntime.Top := fMain.lOntime.Top + 10;
end;
end;
procedure TMainformTotalWriteApplier.SetComponentsForCount;
begin
fMain.l1Month.Visible := false;
fMain.lHost.Top := fMain.lHost.Top + 25;
fMain.lTodayUsage.Top := fMain.lTodayUsage.Top + 15;
fMain.lOntime.Top := fMain.lOntime.Top + 10;
end;
procedure TMainformTotalWriteApplier.SetWriteLabelByHostNANDInformation;
begin
if fMain.SelectedDrive.SMARTInterpreted.
TotalWrite.InValue.TrueHostWriteFalseNANDWrite then
fMain.lHost.Caption := CapHostWrite[CurrLang]
else
fMain.lHost.Caption := CapNandWrite[CurrLang];
end;
procedure TMainformTotalWriteApplier.AppendWriteToWriteLabel;
var
BinaryPointOne: TFormatSizeSetting;
begin
BinaryPointOne.FNumeralSystem := Binary;
BinaryPointOne.FPrecision := 1;
fMain.lHost.Caption :=
fMain.lHost.Caption +
FormatSizeInMB(
fMain.SelectedDrive.SMARTInterpreted.TotalWrite.InValue.ValueInMiB,
BinaryPointOne);
end;
procedure TMainformTotalWriteApplier.SetUsageLabelByLogAndAvailableType(
WriteLog: TAverageWriteLogger);
var
MaxPeriodAverage: TPeriodAverage;
begin
MaxPeriodAverage := WriteLog.GetMaxPeriodFormattedAverage;
fMain.l1Month.Caption :=
CapAvg[Integer(MaxPeriodAverage.Period)][CurrLang] +
MaxPeriodAverage.FormattedAverageValue + 'GB/' +
CapDay[CurrLang];
end;
procedure TMainformTotalWriteApplier.ApplyTodayUsageByLog(
WriteLog: TAverageWriteLogger);
begin
fMain.lTodayUsage.Caption := CapToday[CurrLang] +
WriteLog.GetFormattedTodayDelta + 'GB';
end;
procedure TMainformTotalWriteApplier.ApplyUsageByLog(
WriteLog: TAverageWriteLogger);
begin
SetUsageLabelByLogAndAvailableType(WriteLog);
ApplyTodayUsageByLog(WriteLog);
end;
procedure TMainformTotalWriteApplier.RefreshWriteLogAndApplyUsageByLog;
var
WriteLog: TAverageWriteLogger;
begin
WriteLog :=
TAverageWriteLogger.Create(
TAverageWriteLogger.BuildFileName(
EnvironmentVariable.AppPath,
fMain.SelectedDrive.IdentifyDeviceResult.Serial));
WriteLog.ReadAndRefresh(
UIntToStr(MBToLiteONUnit(
fMain.SelectedDrive.SMARTInterpreted.TotalWrite.InValue.ValueInMiB)));
ApplyUsageByLog(WriteLog);
FreeAndNil(WriteLog);
end;
procedure TMainformTotalWriteApplier.ApplyTotalWriteAsValue;
begin
SetWriteLabelByHostNANDInformation;
AppendWriteToWriteLabel;
RefreshWriteLogAndApplyUsageByLog;
end;
function TMainformTotalWriteApplier.KiBtoMiB(SizeInKiB: UInt64): Double;
var
BinaryKiBtoMiB: TDatasizeUnitChangeSetting;
begin
BinaryKiBtoMiB.FNumeralSystem := Binary;
BinaryKiBtoMiB.FFromUnit := KiloUnit;
BinaryKiBtoMiB.FToUnit := MegaUnit;
result :=
ChangeDatasizeUnit(SizeInKiB, BinaryKiBtoMiB);
end;
procedure TMainformTotalWriteApplier.ApplyTotalWriteConvertedToMiB;
var
HostWriteInMiB: UInt64;
begin
HostWriteInMiB :=
fMain.SelectedDrive.SMARTInterpreted.TotalWrite.InCount.ValueInCount *
round(KiBtoMiB(fMain.SelectedDrive.IdentifyDeviceResult.UserSizeInKB));
fMain.lHost.Caption := CapNandWrite[CurrLang] + UIntToStr(HostWriteInMiB);
end;
procedure TMainformTotalWriteApplier.ApplyTotalWriteInCount;
begin
fMain.lTodayUsage.Caption :=
CapWearLevel[CurrLang] +
UIntToStr(fMain.SelectedDrive.SMARTInterpreted.
TotalWrite.InCount.ValueInCount);
end;
procedure TMainformTotalWriteApplier.ApplyTotalWriteAsCount;
begin
SetComponentsForCount;
ApplyTotalWriteConvertedToMiB;
ApplyTotalWriteInCount;
end;
procedure TMainformTotalWriteApplier.ApplyTotalWriteByWriteType;
begin
case fMain.SelectedDrive.SupportStatus.TotalWriteType of
TTotalWriteType.WriteSupportedAsValue:
ApplyTotalWriteAsValue;
TTotalWriteType.WriteSupportedAsCount:
ApplyTotalWriteAsCount;
end;
end;
procedure TMainformTotalWriteApplier.ApplyMainformTotalWrite;
begin
if IsTotalWriteNotSupported then
exit;
RestoreComponentsFromCountIfSet;
ApplyTotalWriteByWriteType;
end;
end. |
UNIT main;
INTERFACE
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls, Grids, Menus, CLipBrd;
type
TMainWin = class(TForm)
PicturePanel: TPanel;
PaintPanel: TPanel;
PaintBox: TPaintBox;
PictureName: TComboBox;
Popup: TPopupMenu;
CopyItem: TMenuItem;
SaveItem: TMenuItem;
SaveDialog: TSaveDialog;
procedure FormCreate(Sender: TObject);
procedure PaintBoxPaint(Sender: TObject);
procedure PictureNameChange(Sender: TObject);
procedure FormResize(Sender: TObject);
procedure CopyItemClick(Sender: TObject);
procedure SaveItemClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure drawPaintBox;
end;
var
MainWin: TMainWin;
function minabs(a,b:extended):extended;
function maxabs(a,b:extended):extended;
function tan(x:extended):extended;
function ctan(x:extended):extended;
function sign(x:extended):extended;
function pow(x,p:extended):extended;
IMPLEMENTATION
type
TSymmetry=(symNone,symVertical,symHorizontal,symZero);
TBorderAction=(baFrac,baCut);
TCalculateProc=procedure(x,y,a,d:extended; var r,g,b:extended);
const
M=1e-4;
{$I func.inc}
{$I list.inc}
function minabs(a,b:extended):extended;
begin if(abs(a)<abs(b))then result:=a else result:=b end;
function maxabs(a,b:extended):extended;
begin if(abs(a)>abs(b))then result:=a else result:=b end;
function tan(x:extended):extended;
begin result:=sin(x)/cos(x) end;
function ctan(x:extended):extended;
begin result:=cos(x)/sin(x) end;
function sign(x:extended):extended;
begin if(x<>0)then result:=x/abs(x) else result:=0 end;
function pow(x,p:extended):extended;
begin result:=exp(p*ln(x)) end;
{$R *.DFM}
procedure TMainWin.drawPaintBox;
var sym:TSymmetry;
ba:TBorderAction;
cx,cy,sx,sy,x,y,i:integer;
xc,yc,rc,gc,bc:extended;
tc:TColor;
begin
i:=PictureName.itemIndex+1;
if(i=0)then exit;
caption:=PicturesName[i]+' - Художник';
cx:=PaintBox.width div 2;
cy:=PaintBox.height div 2;
sym:=PicturesSymmetry[i]; ba:=PicturesBorder[i];
sx:=0; sy:=0;
case(sym)of
symHorizontal:sy:=cy;
symVertical:sx:=cx;
symZero:begin
sx:=cx;
sy:=cy;
end;
end;
for x:=sx to PaintBox.width-1 do
for y:=sy to PaintBox.height-1 do
begin
xc:=maxabs((x-cx)/cx,M); yc:=maxabs((y-cy)/cy,M);
rc:=0; gc:=0; bc:=0;
if(@PicturesCalculate[i]<>nil)then PicturesCalculate[i](xc,yc,maxabs(arctan(yc/xc),M),sqrt((sqr(xc)+sqr(yc))/2) , rc,gc,bc);
case(ba)of
baFrac:begin
rc:=abs(frac(rc));
gc:=abs(frac(gc));
bc:=abs(frac(bc));
end;
baCut:begin
if(rc>1)then rc:=1;
if(rc<0)then rc:=0;
if(gc>1)then gc:=1;
if(gc<0)then gc:=0;
if(bc>1)then bc:=1;
if(bc<0)then bc:=0;
end;
end;
tc:=rgb(trunc(rc*$ff),trunc(gc*$ff),trunc(bc*$ff));
PaintBox.canvas.pixels[x,y]:=tc;
case(sym)of
symHorizontal :PaintBox.canvas.pixels[ x,2*cy-y]:=tc;
symVertical :PaintBox.canvas.pixels[2*cx-x, y]:=tc;
symZero :begin
PaintBox.canvas.pixels[ x,2*cy-y]:=tc;
PaintBox.canvas.pixels[2*cx-x, y]:=tc;
PaintBox.canvas.pixels[2*cx-x,2*cy-y]:=tc;
end;
end;
end;
end;
procedure TMainWin.FormCreate(Sender: TObject);
var i:integer;
begin
for i:=1 to PicturesCount do
PictureName.items.add(PicturesName[i]);
PictureName.itemIndex:=PicturesDefault-1;
end;
procedure TMainWin.PaintBoxPaint(Sender: TObject);
begin
drawPaintBox;
end;
procedure TMainWin.PictureNameChange(Sender: TObject);
begin
PaintBox.invalidate;
end;
procedure TMainWin.FormResize(Sender: TObject);
begin
PictureName.width:=PicturePanel.width-10-PictureName.left;
end;
procedure TMainWin.CopyItemClick(Sender: TObject);
var b:TBitmap;
r:TRect;
begin
b:=TBitmap.create;
b.width:=PaintBox.width;
b.height:=PaintBox.height;
r.left:=0;
r.top:=0;
r.right:=PaintBox.width;
r.bottom:=PaintBox.height;
b.canvas.copyrect(r,PaintBox.canvas,r);
clipboard.assign(b);
b.free;
end;
procedure TMainWin.SaveItemClick(Sender: TObject);
var b:TBitmap;
r:TRect;
begin
if(SaveDialog.execute)then
begin
b:=TBitmap.create;
b.width:=PaintBox.width;
b.height:=PaintBox.height;
r.left:=0;
r.top:=0;
r.right:=PaintBox.width;
r.bottom:=PaintBox.height;
b.canvas.copyrect(r,PaintBox.canvas,r);
b.savetofile(SaveDialog.filename);
b.free;
end;
end;
end.
|
{
Ultibo Crypto API Test unit.
Copyright (C) 2020 - SoftOz Pty Ltd.
Arch
====
<All>
Boards
======
<All>
Licence
=======
LGPLv2.1 with static linking exception (See COPYING.modifiedLGPL.txt)
Credits
=======
Information for this unit was obtained from:
References
==========
Crypto API
==========
This unit uses the WebStatus framework to display test result for crypto API functions
To use this unit include and register WebStatus and then register this unit by doing:
HTTPListener.RegisterDocument('',TWebStatusAPICrypto.Create);
Where HTTPListener is the nname of the THTTPListener instance you created for WebStatus.
}
{$mode delphi} {Default to Delphi compatible syntax}
{$H+} {Default to AnsiString}
{$inline on} {Allow use of Inline procedures}
unit APICrypto;
interface
uses GlobalConfig,GlobalConst,GlobalTypes,Platform,Threads,HTTP,WebStatus,Crypto,SysUtils;
{==============================================================================}
{Global definitions}
{--$INCLUDE ..\core\GlobalDefines.inc}
{==============================================================================}
{const}
{API Crypto specific constants}
{==============================================================================}
{type}
{API Crypto specific types}
{==============================================================================}
type
{API Crypto specific clases}
TWebStatusAPICrypto = class(TWebStatusCustom)
public
{}
constructor Create;
protected
{Internal Methods}
function DoContent(AHost:THTTPHost;ARequest:THTTPServerRequest;AResponse:THTTPServerResponse):Boolean; override;
end;
{==============================================================================}
{var}
{API Crypto specific variables}
{==============================================================================}
{Initialization Functions}
{==============================================================================}
{API Crypto Functions}
{==============================================================================}
{API Crypto Helper Functions}
function BytesToString(Data:PByte;Size:LongWord):String;
function StringToBytes(const Value:String;Data:PByte;Size:LongWord):Boolean;
function BuildBytes(Data:PByte;Size:LongWord):Boolean;
function StringTrim(const Value:String;Size:LongWord):String;
{==============================================================================}
{==============================================================================}
implementation
{==============================================================================}
{==============================================================================}
{var}
{API Crypto specific variables}
{==============================================================================}
{==============================================================================}
{TWebStatusAPICrypto}
constructor TWebStatusAPICrypto.Create;
begin
{}
inherited Create('Crypto API','/cryptoapi',2)
end;
{==============================================================================}
function TWebStatusAPICrypto.DoContent(AHost:THTTPHost;ARequest:THTTPServerRequest;AResponse:THTTPServerResponse):Boolean;
const
AESGCMTestVectors:array[1..32,1..2] of String = (
('3A', '03C32E0E9D7E07A410B9BEE40A8F0D26'),
('26AE', '3A635BBDC1A17CA40B58CEEA78105CDC'),
('142FAC', '7E8922E8FA6F1E41E4339F0B52176DE4'),
('20C1863F', 'A1D12620C22EA7A0AA0E74667A20B8E1'),
('B3B796AA54', '53F0F9F03791BBD76BC99D1B5639F3C0'),
('FDCFF8EA82D8', 'B56076B42E3EEAC73DD42FC83B9220F9'),
('4695E719E67849', 'B4A1A2E29AAD713D5677CF425E65A400'),
('EE5BA3309D417697', '146EA95CED151F8C40DF98C1CC54930B'),
('13FF05ABB084FA608F', '55550AADC3461CC190CA22F29C6246CD'),
('008B0102208A22D3A562', '7178534BC7145754BAE525CC06E14A6B'),
('3536DBBB07B026E78E94C8', 'AB27183AEA2240B0166D702EEB2A7BFA'),
('00739D5A27AE82AC7D6A40EC', '4354578C3D241074D3C1F6496420F239'),
('DA41A5F458400C94B84026C052', 'DC6CB036FCAE9765A69F5B8C38B0B767'),
('4C99797C7EDCEA9D5425565522E2', '3FFEEC557F0D5FA73472D2A3F8E71389'),
('D381E7AD2E5BE2C97FB4BD958BC2EB', '6BF713D4E7DA7C4290967A1D23F97EDD'),
('5016C127F16A4787734AF3A3E6F6F0F7', '8CD8458531E94BC8160E2176F63F8D0B'),
('BDF3D0F24D9415AB5CF9B87BB45B4A8AE4', 'D81A3D56451313742ACE53D41223F6AF'),
('68C1FCBE22FBDB296C246F2E34D871A6902E', '7AFD64D4EB0DE7E2A842B518AC6D483F'),
('7D8D3C31E643611B0B557F29B437F635FE3FD0', '8501B61DBF4A4DD19B87E95055B95962'),
('4185EEB0B9B480F69B3EC7A162810073A36AD95A', 'B9BCA6D9CA0AC2B4B35D7BFF4DB27D25'),
('F991F4A481E322FEEC6FE9302D010AC4C811B23B4A', '54FA4DDA92E57509F4D48D206A03624F'),
('B288424FF96596B2A30A1EB9480F5EADC2F6D8551B9A', '2C998C8DFDC7663C8DE677B2F1CBCB57'),
('1066FE3DCB9F8AE0DC0693F7179F111E0A7A1FFE944FF4', '65402D1F8AFBDC819D6D1ADB5375AFD0'),
('0A8772CCDE122EFF01D7C187C77F07BDA50997B4320CD0D8', 'F55823AFC3D9FE6E749E70E82C823925'),
('E6E2FBB3E2238BC8CB396F463C2F488B4B4933087728D39815', 'F06DA35A9AEE65F9AD0DAD5B99AB4DF6'),
('569BD39CB1693CB89B88923ABE0D8CFA0B4F22A48A15E2EACD4A', '661AF51FF0E0E363406AB278BFC9176D'),
('199EED81C2428170EB089060FF9676596EADD2270895A0C8650903', '90AA9C634469D45E7BDD9AB955B90130'),
('B5200497A0654009B9F5B0D45FFDCF192F3042D6B05C6D6A8191A7EA', '71F6C4982AA50705D5FFC60512FC674C'),
('E39DA262C0E851B5CB5BD55A8B19D0AC0ABDC6FF3F32DF3B1896242D9E', 'B58AA05F594FC9779E185353CC52B8FB'),
('AF349B91BAD4BE2F2D5E4DDE28A1AA74115A9059A5EBBF9E38F341DC368B', '966B04FE43A2A9D94004E756F7DBFEFA'),
('8C87861DFFDE72FA64E926BF741330F64E2B30837650F309A3F979AE43BA2E', 'A5C825AE1B844D6A8D531077C881BD36'),
('924E178A17FA1CA0E7486F0404123B91DBF797BB9DBDE9B1D48D5C7F53165912', '10F972B6F9E0A3C1CF9CCF56543DCA79'));
var
Count:Integer;
Actual:String;
Expected:String;
ActualTag:String;
ExpectedTag:String;
MD5Digest:TMD5Digest;
SHA1Digest:TSHA1Digest;
SHA256Block:TSHA256Block;
SHA256Digest:TSHA256Digest;
SHA384Block:TSHA384Block;
SHA384Digest:TSHA384Digest;
SHA512Block:TSHA512Block;
SHA512Digest:TSHA512Digest;
RC4Key:PByte;
RC4Data:Pointer;
Hash:PHashContext;
Cipher:PCipherContext;
DESECBKey:Pointer;
DESECBData:Pointer;
DESECBEncryptKey:TDESKey;
DESECBDecryptKey:TDESKey;
DESCBCKey:String;
DESCBCData:String;
DESCBCCrypt:String;
DESCBCVector:String;
DES3CBCKey:String;
DES3CBCData:String;
DES3CBCCrypt:String;
DES3CBCVector:String;
AESECBKey:PByte;
AESECBData:PByte;
AESECBAESKey:TAESKey;
AESCBCKey:PByte;
AESCBCData:PByte;
AESCBCVector:PByte;
AESCTRKey:PByte;
AESCTRData:PByte;
AESCTRNonce:PByte;
AESGCMKey:PByte;
AESGCMIV:PByte;
AESGCMAAD:PByte;
AESGCMData:PByte;
AESGCMTag:PByte;
begin
{}
Result:=False;
{Check Host}
if AHost = nil then Exit;
{Check Request}
if ARequest = nil then Exit;
{Check Response}
if AResponse = nil then Exit;
{MD5 Digest Tests}
AddBold(AResponse,'MD5 Digest Tests','');
AddBlank(AResponse);
AddItemEx(AResponse,'Test:','MD5DigestString',3);
AddItemEx(AResponse,'Value:','abc',3);
if MD5DigestString('abc',@MD5Digest) then
begin
Actual:=MD5DigestToString(@MD5Digest);
Expected:=Lowercase('900150983CD24FB0D6963F7D28E17F72'); {Source: http://www.nsrl.nist.gov/testdata/}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
AddBlank(AResponse);
AddItemEx(AResponse,'Test:','MD5DigestString',3);
AddItemEx(AResponse,'Value:','abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq',3);
if MD5DigestString('abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq',@MD5Digest) then
begin
Actual:=MD5DigestToString(@MD5Digest);
Expected:=Lowercase('8215EF0796A20BCAAAE116D3876C664A'); {Source: http://www.nsrl.nist.gov/testdata/}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
AddBlank(AResponse);
AddItemEx(AResponse,'Test:','MD5DigestString',3);
AddItemEx(AResponse,'Value:','(A million repetitions of "a")',3);
if MD5DigestString(StringOfChar('a',1000000),@MD5Digest) then
begin
Actual:=MD5DigestToString(@MD5Digest);
Expected:=Lowercase('7707D6AE4E027C70EEA2A935C2296F21'); {Source: http://www.nsrl.nist.gov/testdata/}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
AddBlank(AResponse);
AddItemEx(AResponse,'Test:','MD5DigestString',3);
AddItemEx(AResponse,'Value:','The quick brown fox jumps over the lazy dog',3);
if MD5DigestString('The quick brown fox jumps over the lazy dog',@MD5Digest) then
begin
Actual:=MD5DigestToString(@MD5Digest);
Expected:=Lowercase('9e107d9d372bb6826bd81d3542a419d6'); {Source: https://en.wikipedia.org/wiki/MD5}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
AddBlank(AResponse);
AddItemEx(AResponse,'Test:','MD5DigestString',3);
AddItemEx(AResponse,'Value:','(An empty string)',3);
if MD5DigestString('',@MD5Digest) then
begin
Actual:=MD5DigestToString(@MD5Digest);
Expected:=Lowercase('d41d8cd98f00b204e9800998ecf8427e'); {Source: https://en.wikipedia.org/wiki/MD5}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
AddBlank(AResponse);
{HMAC-MD5 Digest Tests}
AddBold(AResponse,'HMAC-MD5 Digest Tests','');
AddBlank(AResponse);
AddItemEx(AResponse,'Test:','HMACMD5DigestString',3);
AddItemEx(AResponse,'Key:','key',3);
AddItemEx(AResponse,'Value:','The quick brown fox jumps over the lazy dog',3);
if HMACMD5DigestString('key','The quick brown fox jumps over the lazy dog',@MD5Digest) then
begin
Actual:=MD5DigestToString(@MD5Digest);
Expected:=Lowercase('80070713463e7749b90c2dc24911e275'); {Source: https://en.wikipedia.org/wiki/Hash-based_message_authentication_code}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
AddBlank(AResponse);
AddItemEx(AResponse,'Test:','HMACMD5DigestString',3);
AddItemEx(AResponse,'Key:','(An empty string)',3);
AddItemEx(AResponse,'Value:','(An empty string)',3);
if HMACMD5DigestString('','',@MD5Digest) then
begin
Actual:=MD5DigestToString(@MD5Digest);
Expected:=Lowercase('74e6f7298a9c2d168935f58c001bad88'); {Source: https://en.wikipedia.org/wiki/Hash-based_message_authentication_code}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
AddBlank(AResponse);
AddItemEx(AResponse,'Test:','HMACMD5DigestString',3);
AddItemEx(AResponse,'Key:','(80 repetitions of 0xaa)',3);
AddItemEx(AResponse,'Value:','Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data',3);
if HMACMD5DigestString(StringOfChar(#$aa, 80),'Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data',@MD5Digest) then
begin
Actual:=MD5DigestToString(@MD5Digest);
Expected:=Lowercase('6f630fad67cda0ee1fb1f562db3aa53e'); {Source: FPC RTL \packages\hash\tests}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
AddBlank(AResponse);
{SHA1 Tests}
AddBold(AResponse,'SHA1 Digest Tests','');
AddBlank(AResponse);
AddItemEx(AResponse,'Test:','SHA1DigestString',3);
AddItemEx(AResponse,'Value:','abc',3);
if SHA1DigestString('abc',@SHA1Digest) then
begin
Actual:=SHA1DigestToString(@SHA1Digest);
Expected:=Lowercase('A9993E364706816ABA3E25717850C26C9CD0D89D'); {Source: http://www.nsrl.nist.gov/testdata/}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
AddBlank(AResponse);
AddItemEx(AResponse,'Test:','SHA1DigestString',3);
AddItemEx(AResponse,'Value:','abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq',3);
if SHA1DigestString('abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq',@SHA1Digest) then
begin
Actual:=SHA1DigestToString(@SHA1Digest);
Expected:=Lowercase('84983E441C3BD26EBAAE4AA1F95129E5E54670F1'); {Source: http://www.nsrl.nist.gov/testdata/}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
AddBlank(AResponse);
AddItemEx(AResponse,'Test:','SHA1DigestString',3);
AddItemEx(AResponse,'Value:','(A million repetitions of "a")',3);
if SHA1DigestString(StringOfChar('a',1000000),@SHA1Digest) then
begin
Actual:=SHA1DigestToString(@SHA1Digest);
Expected:=Lowercase('34AA973CD4C4DAA4F61EEB2BDBAD27316534016F'); {Source: http://www.nsrl.nist.gov/testdata/}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
AddBlank(AResponse);
AddItemEx(AResponse,'Test:','SHA1DigestString',3);
AddItemEx(AResponse,'Value:','The quick brown fox jumps over the lazy dog',3);
if SHA1DigestString('The quick brown fox jumps over the lazy dog',@SHA1Digest) then
begin
Actual:=SHA1DigestToString(@SHA1Digest);
Expected:=Lowercase('2fd4e1c67a2d28fced849ee1bb76e7391b93eb12'); {Source: https://en.wikipedia.org/wiki/SHA-1}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
AddBlank(AResponse);
AddItemEx(AResponse,'Test:','SHA1DigestString',3);
AddItemEx(AResponse,'Value:','(An empty string)',3);
if SHA1DigestString('',@SHA1Digest) then
begin
Actual:=SHA1DigestToString(@SHA1Digest);
Expected:=Lowercase('da39a3ee5e6b4b0d3255bfef95601890afd80709'); {Source: https://en.wikipedia.org/wiki/SHA-1}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
AddBlank(AResponse);
{HMAC-SHA1 Tests}
AddBold(AResponse,'HMAC-SHA1 Digest Tests','');
AddBlank(AResponse);
AddItemEx(AResponse,'Test:','HMACSHA1DigestString',3);
AddItemEx(AResponse,'Key:','key',3);
AddItemEx(AResponse,'Value:','The quick brown fox jumps over the lazy dog',3);
if HMACSHA1DigestString('key','The quick brown fox jumps over the lazy dog',@SHA1Digest) then
begin
Actual:=SHA1DigestToString(@SHA1Digest);
Expected:=Lowercase('de7c9b85b8b78aa6bc8a7a36f70a90701c9db4d9'); {Source: https://en.wikipedia.org/wiki/Hash-based_message_authentication_code}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
AddBlank(AResponse);
AddItemEx(AResponse,'Test:','HMACSHA1DigestString',3);
AddItemEx(AResponse,'Key:','(An empty string)',3);
AddItemEx(AResponse,'Value:','(An empty string)',3);
if HMACSHA1DigestString('','',@SHA1Digest) then
begin
Actual:=SHA1DigestToString(@SHA1Digest);
Expected:=Lowercase('fbdb1d1b18aa6c08324b7d64b71fb76370690e1d'); {Source: https://en.wikipedia.org/wiki/Hash-based_message_authentication_code}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
AddBlank(AResponse);
AddItemEx(AResponse,'Test:','HMACSHA1DigestString',3);
AddItemEx(AResponse,'Key:','(80 repetitions of 0xaa)',3);
AddItemEx(AResponse,'Value:','Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data',3);
if HMACSHA1DigestString(StringOfChar(#$aa, 80),'Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data',@SHA1Digest) then
begin
Actual:=SHA1DigestToString(@SHA1Digest);
Expected:=Lowercase('e8e99d0f45237d786d6bbaa7965c7808bbff1a91'); {Source: FPC RTL \packages\hash\tests}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
AddBlank(AResponse);
{SHA256 Tests}
AddBold(AResponse,'SHA256 Digest Tests','');
AddBlank(AResponse);
AddItemEx(AResponse,'Test:','SHA256DigestString',3);
AddItemEx(AResponse,'Value:','abc',3);
if SHA256DigestString('abc',@SHA256Digest) then
begin
Actual:=SHA256DigestToString(@SHA256Digest);
Expected:=Lowercase('BA7816BF8F01CFEA414140DE5DAE2223B00361A396177A9CB410FF61F20015AD'); {Source: http://www.nsrl.nist.gov/testdata/}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
AddBlank(AResponse);
AddItemEx(AResponse,'Test:','SHA256DigestString',3);
AddItemEx(AResponse,'Value:','abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq',3);
if SHA256DigestString('abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq',@SHA256Digest) then
begin
Actual:=SHA256DigestToString(@SHA256Digest);
Expected:=Lowercase('248D6A61D20638B8E5C026930C3E6039A33CE45964FF2167F6ECEDD419DB06C1'); {Source: http://www.nsrl.nist.gov/testdata/}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
AddBlank(AResponse);
AddItemEx(AResponse,'Test:','SHA256DigestString',3);
AddItemEx(AResponse,'Value:','(A million repetitions of "a")',3);
if SHA256DigestString(StringOfChar('a',1000000),@SHA256Digest) then
begin
Actual:=SHA256DigestToString(@SHA256Digest);
Expected:=Lowercase('CDC76E5C9914FB9281A1C7E284D73E67F1809A48A497200E046D39CCC7112CD0'); {Source: http://www.nsrl.nist.gov/testdata/}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
AddBlank(AResponse);
AddItemEx(AResponse,'Test:','SHA256DigestString',3);
AddItemEx(AResponse,'Value:','(An empty string)',3);
if SHA256DigestString('',@SHA256Digest) then
begin
Actual:=SHA256DigestToString(@SHA256Digest);
Expected:=Lowercase('e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'); {Source: https://en.wikipedia.org/wiki/SHA-2}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
AddBlank(AResponse);
AddItemEx(AResponse,'Test:','SHA256DigestData',3);
AddItemEx(AResponse,'Value:','Bytes 0x00..0x7F',3);
SHA256Block.Size:=128;
SHA256Block.Data:=AllocMem(SHA256Block.Size);
SHA256Block.Next:=nil;
BuildBytes(PByte(SHA256Block.Data),SHA256Block.Size);
if SHA256DigestData(@SHA256Block,@SHA256Digest) then
begin
Actual:=SHA256DigestToString(@SHA256Digest);
Expected:=Lowercase('471FB943AA23C511F6F72F8D1652D9C880CFA392AD80503120547703E56A2BE5'); {Source: https://github.com/libtom/libtomcrypt/blob/develop/notes/hash_tv.txt}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
AddBlank(AResponse);
FreeMem(SHA256Block.Data);
{HMAC-SHA256 Tests}
AddBold(AResponse,'HMAC-SHA256 Digest Tests','');
AddBlank(AResponse);
AddItemEx(AResponse,'Test:','HMACSHA256DigestString',3);
AddItemEx(AResponse,'Key:','key',3);
AddItemEx(AResponse,'Value:','The quick brown fox jumps over the lazy dog',3);
if HMACSHA256DigestString('key','The quick brown fox jumps over the lazy dog',@SHA256Digest) then
begin
Actual:=SHA256DigestToString(@SHA256Digest);
Expected:=Lowercase('f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8'); {Source: https://en.wikipedia.org/wiki/Hash-based_message_authentication_code}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
AddBlank(AResponse);
AddItemEx(AResponse,'Test:','HMACSHA256DigestString',3);
AddItemEx(AResponse,'Key:','(An empty string)',3);
AddItemEx(AResponse,'Value:','(An empty string)',3);
if HMACSHA256DigestString('','',@SHA256Digest) then
begin
Actual:=SHA256DigestToString(@SHA256Digest);
Expected:=Lowercase('b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad'); {Source: https://en.wikipedia.org/wiki/Hash-based_message_authentication_code}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
AddBlank(AResponse);
{SHA384 Tests}
AddBold(AResponse,'SHA384 Digest Tests','');
AddBlank(AResponse);
AddItemEx(AResponse,'Test:','SHA384DigestData',3);
AddItemEx(AResponse,'Value:','Bytes 0x00..0x7F',3);
SHA384Block.Size:=128;
SHA384Block.Data:=AllocMem(SHA384Block.Size);
SHA384Block.Next:=nil;
BuildBytes(PByte(SHA384Block.Data),SHA384Block.Size);
if SHA384DigestData(@SHA384Block,@SHA384Digest) then
begin
Actual:=SHA384DigestToString(@SHA384Digest);
Expected:=Lowercase('CA2385773319124534111A36D0581FC3F00815E907034B90CFF9C3A861E126A741D5DFCFF65A417B6D7296863AC0EC17'); {Source: https://github.com/libtom/libtomcrypt/blob/develop/notes/hash_tv.txt}
AddItemEx(AResponse,'Expected:',StringTrim(Expected,64),3);
AddItemEx(AResponse,'Actual:',StringTrim(Actual,64),3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
AddBlank(AResponse);
FreeMem(SHA384Block.Data);
AddItemEx(AResponse,'Test:','SHA384DigestData',3);
AddItemEx(AResponse,'Value:','Bytes 0x00..0xFF',3);
SHA384Block.Size:=256;
SHA384Block.Data:=AllocMem(SHA384Block.Size);
SHA384Block.Next:=nil;
BuildBytes(PByte(SHA384Block.Data),SHA384Block.Size);
if SHA384DigestData(@SHA384Block,@SHA384Digest) then
begin
Actual:=SHA384DigestToString(@SHA384Digest);
Expected:=Lowercase('FFDAEBFF65ED05CF400F0221C4CCFB4B2104FB6A51F87E40BE6C4309386BFDEC2892E9179B34632331A59592737DB5C5'); {Source: https://github.com/libtom/libtomcrypt/blob/develop/notes/hash_tv.txt}
AddItemEx(AResponse,'Expected:',StringTrim(Expected,64),3);
AddItemEx(AResponse,'Actual:',StringTrim(Actual,64),3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
AddBlank(AResponse);
FreeMem(SHA384Block.Data);
{HMAC-SHA384 Tests}
AddBold(AResponse,'HMAC-SHA384 Digest Tests','');
AddBlank(AResponse);
//To Do
{SHA512 Tests}
AddBold(AResponse,'SHA512 Digest Tests','');
AddBlank(AResponse);
AddItemEx(AResponse,'Test:','SHA512DigestData',3);
AddItemEx(AResponse,'Value:','Bytes 0x00..0x7F',3);
SHA512Block.Size:=128;
SHA512Block.Data:=AllocMem(SHA512Block.Size);
SHA512Block.Next:=nil;
BuildBytes(PByte(SHA512Block.Data),SHA512Block.Size);
if SHA512DigestData(@SHA512Block,@SHA512Digest) then
begin
Actual:=SHA512DigestToString(@SHA512Digest);
Expected:=Lowercase('1DFFD5E3ADB71D45D2245939665521AE001A317A03720A45732BA1900CA3B8351FC5C9B4CA513EBA6F80BC7B1D1FDAD4ABD13491CB824D61B08D8C0E1561B3F7'); {Source: https://github.com/libtom/libtomcrypt/blob/develop/notes/hash_tv.txt}
AddItemEx(AResponse,'Expected:',StringTrim(Expected,64),3);
AddItemEx(AResponse,'Actual:',StringTrim(Actual,64),3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
AddBlank(AResponse);
FreeMem(SHA512Block.Data);
AddItemEx(AResponse,'Test:','SHA512DigestData',3);
AddItemEx(AResponse,'Value:','Bytes 0x00..0xFF',3);
SHA512Block.Size:=256;
SHA512Block.Data:=AllocMem(SHA512Block.Size);
SHA512Block.Next:=nil;
BuildBytes(PByte(SHA512Block.Data),SHA512Block.Size);
if SHA512DigestData(@SHA512Block,@SHA512Digest) then
begin
Actual:=SHA512DigestToString(@SHA512Digest);
Expected:=Lowercase('1E7B80BC8EDC552C8FEEB2780E111477E5BC70465FAC1A77B29B35980C3F0CE4A036A6C9462036824BD56801E62AF7E9FEBA5C22ED8A5AF877BF7DE117DCAC6D'); {Source: https://github.com/libtom/libtomcrypt/blob/develop/notes/hash_tv.txt}
AddItemEx(AResponse,'Expected:',StringTrim(Expected,64),3);
AddItemEx(AResponse,'Actual:',StringTrim(Actual,64),3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
AddBlank(AResponse);
FreeMem(SHA512Block.Data);
{HMAC-SHA512 Tests}
AddBold(AResponse,'HMAC-SHA512 Digest Tests','');
AddBlank(AResponse);
//To Do
{RC4 Tests}
AddBold(AResponse,'RC4 Cipher Tests','');
AddBlank(AResponse);
{RC4 RC4EncryptData}
AddItemEx(AResponse,'Test:','RC4EncryptData',3);
AddItemEx(AResponse,'Key:','0x0102030405 (40 bits)',3);
AddItemEx(AResponse,'Data:','32 bytes of 0x00 (Offset 0)',3);
RC4Key:=AllocMem(32);
StringToBytes('0102030405',PByte(RC4Key),5);
RC4Data:=AllocMem(32);
if RC4EncryptData(RC4Key,5,RC4Data,RC4Data,32,0) then
begin
Actual:=BytesToString(RC4Data,32);
Expected:='b2396305f03dc027ccc3524a0a1118a86982944f18fc82d589c403a47a0d0919'; {Source: https://tools.ietf.org/html/rfc6229}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
FreeMem(RC4Key);
FreeMem(RC4Data);
AddBlank(AResponse);
{RC4 RC4EncryptData}
AddItemEx(AResponse,'Test:','RC4EncryptData',3);
AddItemEx(AResponse,'Key:','0x0102030405 (40 bits)',3);
AddItemEx(AResponse,'Data:','32 bytes of 0x00 (Offset 1520)',3);
RC4Key:=AllocMem(32);
StringToBytes('0102030405',PByte(RC4Key),5);
RC4Data:=AllocMem(32);
if RC4EncryptData(RC4Key,5,RC4Data,RC4Data,32,1520) then
begin
Actual:=BytesToString(RC4Data,32);
Expected:='3294f744d8f9790507e70f62e5bbceead8729db41882259bee4f825325f5a130'; {Source: https://tools.ietf.org/html/rfc6229}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
FreeMem(RC4Key);
FreeMem(RC4Data);
AddBlank(AResponse);
{RC4 RC4EncryptData}
AddItemEx(AResponse,'Test:','RC4EncryptData',3);
AddItemEx(AResponse,'Key:','0x0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20 (256 bits)',3);
AddItemEx(AResponse,'Data:','32 bytes of 0x00 (Offset 0)',3);
RC4Key:=AllocMem(32);
StringToBytes('0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20',PByte(RC4Key),32);
RC4Data:=AllocMem(32);
if RC4EncryptData(RC4Key,32,RC4Data,RC4Data,32,0) then
begin
Actual:=BytesToString(RC4Data,32);
Expected:='eaa6bd25880bf93d3f5d1e4ca2611d91cfa45c9f7e714b54bdfa80027cb14380'; {Source: https://tools.ietf.org/html/rfc6229}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
FreeMem(RC4Key);
FreeMem(RC4Data);
AddBlank(AResponse);
{DES Tests}
AddBold(AResponse,'DES Cipher Tests','');
AddBlank(AResponse);
{DES CipherEncrypt}
AddItemEx(AResponse,'Test:','CipherEncrypt(CRYPTO_CIPHER_ALG_DES)',3);
AddItemEx(AResponse,'Key:','12345678',3);
AddItemEx(AResponse,'Data:','This is the message to encrypt!!',3);
AddItemEx(AResponse,'Vector:','abcdefgh',3);
AddItemEx(AResponse,'Mode:','Cipher Block Chaining (CBC)',3);
DESCBCKey:='12345678';
DESCBCVector:='abcdefgh';
DESCBCData:='This is the message to encrypt!!';
SetLength(DESCBCCrypt,32);
Cipher:=CipherCreate(CRYPTO_CIPHER_ALG_DES,PChar(DESCBCVector),PChar(DESCBCKey),DES_KEY_SIZE);
if Cipher <> nil then
begin
if CipherEncrypt(Cipher,PChar(DESCBCData),PChar(DESCBCCrypt),32) then
begin
Actual:=BytesToString(PByte(DESCBCCrypt),32);
Expected:='6ca9470c849d1cc1a59ffc148f1cb5e9cf1f5c0328a7e8756387ff4d0fe46050'; {Source: http://www.tero.co.uk/des/test.php}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
CipherDestroy(Cipher);
end
else
begin
AddItemEx(AResponse,'Result:','CipherCreate Failed',3);
end;
AddBlank(AResponse);
{DES CipherDecrypt}
AddItemEx(AResponse,'Test:','CipherDecrypt(CRYPTO_CIPHER_ALG_DES)',3);
AddItemEx(AResponse,'Key:','12345678',3);
AddItemEx(AResponse,'Data:','6ca9470c849d1cc1a59ffc148f1cb5e9cf1f5c0328a7e8756387ff4d0fe46050',3);
AddItemEx(AResponse,'Vector:','abcdefgh',3);
AddItemEx(AResponse,'Mode:','Cipher Block Chaining (CBC)',3);
DESCBCKey:='12345678';
DESCBCVector:='abcdefgh';
DESCBCData:=StringOfChar(' ',32);
{SetLength(DESCBCCrypt,32);} {Reuse DESCBCCrypt from above result}
Cipher:=CipherCreate(CRYPTO_CIPHER_ALG_DES,PChar(DESCBCVector),PChar(DESCBCKey),DES_KEY_SIZE);
if Cipher <> nil then
begin
if CipherDecrypt(Cipher,PChar(DESCBCCrypt),PChar(DESCBCData),32) then
begin
Actual:=DESCBCData;
Expected:='This is the message to encrypt!!'; {Source: http://www.tero.co.uk/des/test.php}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
CipherDestroy(Cipher);
end
else
begin
AddItemEx(AResponse,'Result:','CipherCreate Failed',3);
end;
AddBlank(AResponse);
{DES DESEncryptBlock}
AddItemEx(AResponse,'Test:','DESEncryptBlock',3);
AddItemEx(AResponse,'Key:','0x0000000000000000',3);
AddItemEx(AResponse,'Data:','0x0000000000000000',3);
AddItemEx(AResponse,'Vector:','(None)',3);
AddItemEx(AResponse,'Mode:','Electronic Codebook (ECB)',3);
DESECBKey:=AllocMem(DES_KEY_SIZE);
DESECBData:=AllocMem(DES_BLOCK_SIZE);
DESKeySetup(DESECBKey,DES_KEY_SIZE,@DESECBEncryptKey,@DESECBDecryptKey);
DESEncryptBlock(DESECBData,DESECBData,@DESECBEncryptKey);
Actual:=BytesToString(PByte(DESECBData),DES_BLOCK_SIZE);
Expected:=Lowercase('8CA64DE9C1B123A7'); {Source: http://www.ecs.soton.ac.uk/~prw99r/ez438/vectors.txt}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
FreeMem(DESECBKey);
FreeMem(DESECBData);
AddBlank(AResponse);
{DES DESEncryptBlock}
AddItemEx(AResponse,'Test:','DESEncryptBlock',3);
AddItemEx(AResponse,'Key:','0xFFFFFFFFFFFFFFFF',3);
AddItemEx(AResponse,'Data:','0xFFFFFFFFFFFFFFFF',3);
AddItemEx(AResponse,'Vector:','(None)',3);
AddItemEx(AResponse,'Mode:','Electronic Codebook (ECB)',3);
DESECBKey:=AllocMem(DES_KEY_SIZE);
DESECBData:=AllocMem(DES_BLOCK_SIZE);
FillChar(DESECBKey^,DES_KEY_SIZE,$FF);
FillChar(DESECBData^,DES_BLOCK_SIZE,$FF);
DESKeySetup(DESECBKey,DES_KEY_SIZE,@DESECBEncryptKey,@DESECBDecryptKey);
DESEncryptBlock(DESECBData,DESECBData,@DESECBEncryptKey);
Actual:=BytesToString(PByte(DESECBData),DES_BLOCK_SIZE);
Expected:=Lowercase('7359B2163E4EDC58'); {Source: http://www.ecs.soton.ac.uk/~prw99r/ez438/vectors.txt}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
FreeMem(DESECBKey);
FreeMem(DESECBData);
AddBlank(AResponse);
{3DES Tests}
AddBold(AResponse,'3DES Cipher Tests','');
AddBlank(AResponse);
{3DES CipherEncrypt}
AddItemEx(AResponse,'Test:','CipherEncrypt(CRYPTO_CIPHER_ALG_3DES)',3);
AddItemEx(AResponse,'Key:','12345678abcdefghstuvwxyz',3);
AddItemEx(AResponse,'Data:','This is the message to encrypt!!',3);
AddItemEx(AResponse,'Vector:','abcdefgh',3);
AddItemEx(AResponse,'Mode:','Cipher Block Chaining (CBC)',3);
DES3CBCKey:='12345678abcdefghstuvwxyz';
DES3CBCVector:='abcdefgh';
DES3CBCData:='This is the message to encrypt!!';
SetLength(DES3CBCCrypt,32);
Cipher:=CipherCreate(CRYPTO_CIPHER_ALG_3DES,PChar(DES3CBCVector),PChar(DES3CBCKey),DES3_KEY_SIZE);
if Cipher <> nil then
begin
if CipherEncrypt(Cipher,PChar(DES3CBCData),PChar(DES3CBCCrypt),32) then
begin
Actual:=BytesToString(PByte(DES3CBCCrypt),32);
Expected:='61b0cefb60b56d1885fcf647d7ebf44c9031b2f2c2c06018f5871bd6278919f7'; {Source: http://www.tero.co.uk/des/test.php}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
CipherDestroy(Cipher);
end
else
begin
AddItemEx(AResponse,'Result:','CipherCreate Failed',3);
end;
AddBlank(AResponse);
{3DES CipherDecrypt}
AddItemEx(AResponse,'Test:','CipherDecrypt(CRYPTO_CIPHER_ALG_3DES)',3);
AddItemEx(AResponse,'Key:','12345678abcdefghstuvwxyz',3);
AddItemEx(AResponse,'Data:','61b0cefb60b56d1885fcf647d7ebf44c9031b2f2c2c06018f5871bd6278919f7',3);
AddItemEx(AResponse,'Vector:','abcdefgh',3);
AddItemEx(AResponse,'Mode:','Cipher Block Chaining (CBC)',3);
DES3CBCKey:='12345678abcdefghstuvwxyz';
DES3CBCVector:='abcdefgh';
DES3CBCData:=StringOfChar(' ',32);
{SetLength(DES3CBCCrypt,32);} {Reuse DES3CBCCrypt from above result}
Cipher:=CipherCreate(CRYPTO_CIPHER_ALG_3DES,PChar(DES3CBCVector),PChar(DES3CBCKey),DES3_KEY_SIZE);
if Cipher <> nil then
begin
if CipherDecrypt(Cipher,PChar(DES3CBCCrypt),PChar(DES3CBCData),32) then
begin
Actual:=DES3CBCData;
Expected:='This is the message to encrypt!!'; {Source: http://www.tero.co.uk/des/test.php}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
CipherDestroy(Cipher);
end
else
begin
AddItemEx(AResponse,'Result:','CipherCreate Failed',3);
end;
AddBlank(AResponse);
{AES Tests}
AddBold(AResponse,'AES Cipher Tests','');
AddBlank(AResponse);
{AES AESEncryptBlock}
AddItemEx(AResponse,'Test:','AESEncryptBlock (128bit)',3);
AddItemEx(AResponse,'Key:','0x2b7e151628aed2a6abf7158809cf4f3c',3);
AddItemEx(AResponse,'Data:','0x6bc1bee22e409f96e93d7e117393172a',3);
AddItemEx(AResponse,'Vector:','(None)',3);
AddItemEx(AResponse,'Mode:','Electronic Codebook (ECB)',3);
AESECBKey:=AllocMem(AES_KEY_SIZE128);
StringToBytes('2b7e151628aed2a6abf7158809cf4f3c',PByte(AESECBKey),AES_KEY_SIZE128);
AESECBData:=AllocMem(AES_BLOCK_SIZE);
StringToBytes('6bc1bee22e409f96e93d7e117393172a',PByte(AESECBData),AES_BLOCK_SIZE);
AESKeySetup(AESECBKey,AES_KEY_SIZE128,@AESECBAESKey);
AESEncryptBlock(AESECBData,AESECBData,@AESECBAESKey);
Actual:=BytesToString(PByte(AESECBData),AES_BLOCK_SIZE);
Expected:=Lowercase('3ad77bb40d7a3660a89ecaf32466ef97'); {Source: http://www.inconteam.com/software-development/41-encryption/55-aes-test-vectors}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
FreeMem(AESECBKey);
FreeMem(AESECBData);
AddBlank(AResponse);
{AES AESEncryptBlock}
AddItemEx(AResponse,'Test:','AESEncryptBlock (192bit)',3);
AddItemEx(AResponse,'Key:','0x8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b',3);
AddItemEx(AResponse,'Data:','0x6bc1bee22e409f96e93d7e117393172a',3);
AddItemEx(AResponse,'Vector:','(None)',3);
AddItemEx(AResponse,'Mode:','Electronic Codebook (ECB)',3);
AESECBKey:=AllocMem(AES_KEY_SIZE192);
StringToBytes('8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b',PByte(AESECBKey),AES_KEY_SIZE192);
AESECBData:=AllocMem(AES_BLOCK_SIZE);
StringToBytes('6bc1bee22e409f96e93d7e117393172a',PByte(AESECBData),AES_BLOCK_SIZE);
AESKeySetup(AESECBKey,AES_KEY_SIZE192,@AESECBAESKey);
AESEncryptBlock(AESECBData,AESECBData,@AESECBAESKey);
Actual:=BytesToString(PByte(AESECBData),AES_BLOCK_SIZE);
Expected:=Lowercase('bd334f1d6e45f25ff712a214571fa5cc'); {Source: http://www.inconteam.com/software-development/41-encryption/55-aes-test-vectors}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
FreeMem(AESECBKey);
FreeMem(AESECBData);
AddBlank(AResponse);
{AES AESEncryptBlock}
AddItemEx(AResponse,'Test:','AESEncryptBlock (256bit)',3);
AddItemEx(AResponse,'Key:','0x603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4',3);
AddItemEx(AResponse,'Data:','0x6bc1bee22e409f96e93d7e117393172a',3);
AddItemEx(AResponse,'Vector:','(None)',3);
AddItemEx(AResponse,'Mode:','Electronic Codebook (ECB)',3);
AESECBKey:=AllocMem(AES_KEY_SIZE256);
StringToBytes('603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4',PByte(AESECBKey),AES_KEY_SIZE256);
AESECBData:=AllocMem(AES_BLOCK_SIZE);
StringToBytes('6bc1bee22e409f96e93d7e117393172a',PByte(AESECBData),AES_BLOCK_SIZE);
AESKeySetup(AESECBKey,AES_KEY_SIZE256,@AESECBAESKey);
AESEncryptBlock(AESECBData,AESECBData,@AESECBAESKey);
Actual:=BytesToString(PByte(AESECBData),AES_BLOCK_SIZE);
Expected:=Lowercase('f3eed1bdb5d2a03c064b5a7e3db181f8'); {Source: http://www.inconteam.com/software-development/41-encryption/55-aes-test-vectors}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
FreeMem(AESECBKey);
FreeMem(AESECBData);
AddBlank(AResponse);
{AES AESDecryptBlock}
AddItemEx(AResponse,'Test:','AESDecryptBlock (128bit)',3);
AddItemEx(AResponse,'Key:','0x2b7e151628aed2a6abf7158809cf4f3c',3);
AddItemEx(AResponse,'Data:','0x3ad77bb40d7a3660a89ecaf32466ef97',3);
AddItemEx(AResponse,'Vector:','(None)',3);
AddItemEx(AResponse,'Mode:','Electronic Codebook (ECB)',3);
AESECBKey:=AllocMem(AES_KEY_SIZE128);
StringToBytes('2b7e151628aed2a6abf7158809cf4f3c',PByte(AESECBKey),AES_KEY_SIZE128);
AESECBData:=AllocMem(AES_BLOCK_SIZE);
StringToBytes('3ad77bb40d7a3660a89ecaf32466ef97',PByte(AESECBData),AES_BLOCK_SIZE);
AESKeySetup(AESECBKey,AES_KEY_SIZE128,@AESECBAESKey);
AESDecryptBlock(AESECBData,AESECBData,@AESECBAESKey);
Actual:=BytesToString(PByte(AESECBData),AES_BLOCK_SIZE);
Expected:=Lowercase('6bc1bee22e409f96e93d7e117393172a'); {Source: http://www.inconteam.com/software-development/41-encryption/55-aes-test-vectors}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
FreeMem(AESECBKey);
FreeMem(AESECBData);
AddBlank(AResponse);
{AES AESDecryptBlock}
AddItemEx(AResponse,'Test:','AESDecryptBlock (192bit)',3);
AddItemEx(AResponse,'Key:','0x8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b',3);
AddItemEx(AResponse,'Data:','0xbd334f1d6e45f25ff712a214571fa5cc',3);
AddItemEx(AResponse,'Vector:','(None)',3);
AddItemEx(AResponse,'Mode:','Electronic Codebook (ECB)',3);
AESECBKey:=AllocMem(AES_KEY_SIZE192);
StringToBytes('8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b',PByte(AESECBKey),AES_KEY_SIZE192);
AESECBData:=AllocMem(AES_BLOCK_SIZE);
StringToBytes('bd334f1d6e45f25ff712a214571fa5cc',PByte(AESECBData),AES_BLOCK_SIZE);
AESKeySetup(AESECBKey,AES_KEY_SIZE192,@AESECBAESKey);
AESDecryptBlock(AESECBData,AESECBData,@AESECBAESKey);
Actual:=BytesToString(PByte(AESECBData),AES_BLOCK_SIZE);
Expected:=Lowercase('6bc1bee22e409f96e93d7e117393172a'); {Source: http://www.inconteam.com/software-development/41-encryption/55-aes-test-vectors}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
FreeMem(AESECBKey);
FreeMem(AESECBData);
AddBlank(AResponse);
{AES AESDecryptBlock}
AddItemEx(AResponse,'Test:','AESDecryptBlock (256bit)',3);
AddItemEx(AResponse,'Key:','0x603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4',3);
AddItemEx(AResponse,'Data:','0xf3eed1bdb5d2a03c064b5a7e3db181f8',3);
AddItemEx(AResponse,'Vector:','(None)',3);
AddItemEx(AResponse,'Mode:','Electronic Codebook (ECB)',3);
AESECBKey:=AllocMem(AES_KEY_SIZE256);
StringToBytes('603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4',PByte(AESECBKey),AES_KEY_SIZE256);
AESECBData:=AllocMem(AES_BLOCK_SIZE);
StringToBytes('f3eed1bdb5d2a03c064b5a7e3db181f8',PByte(AESECBData),AES_BLOCK_SIZE);
AESKeySetup(AESECBKey,AES_KEY_SIZE256,@AESECBAESKey);
AESDecryptBlock(AESECBData,AESECBData,@AESECBAESKey);
Actual:=BytesToString(PByte(AESECBData),AES_BLOCK_SIZE);
Expected:=Lowercase('6bc1bee22e409f96e93d7e117393172a'); {Source: http://www.inconteam.com/software-development/41-encryption/55-aes-test-vectors}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
FreeMem(AESECBKey);
FreeMem(AESECBData);
AddBlank(AResponse);
{AES CipherEncrypt}
AddItemEx(AResponse,'Test:','CipherEncrypt(CRYPTO_CIPHER_ALG_AES)',3);
AddItemEx(AResponse,'Key:','0x2b7e151628aed2a6abf7158809cf4f3c',3);
AddItemEx(AResponse,'Data:','0x6bc1bee22e409f96e93d7e117393172a',3);
AddItemEx(AResponse,'Vector:','0x000102030405060708090A0B0C0D0E0F',3);
AddItemEx(AResponse,'Mode:','Cipher Block Chaining (CBC)',3);
AESCBCKey:=AllocMem(AES_KEY_SIZE128);
StringToBytes('2b7e151628aed2a6abf7158809cf4f3c',PByte(AESCBCKey),AES_KEY_SIZE128);
AESCBCVector:=AllocMem(AES_BLOCK_SIZE);
StringToBytes('000102030405060708090A0B0C0D0E0F',PByte(AESCBCVector),AES_BLOCK_SIZE);
AESCBCData:=AllocMem(AES_BLOCK_SIZE);
StringToBytes('6bc1bee22e409f96e93d7e117393172a',PByte(AESCBCData),AES_BLOCK_SIZE);
Cipher:=CipherCreate(CRYPTO_CIPHER_ALG_AES,PChar(AESCBCVector),PChar(AESCBCKey),AES_KEY_SIZE128);
if Cipher <> nil then
begin
if CipherEncrypt(Cipher,AESCBCData,AESCBCData,AES_BLOCK_SIZE) then
begin
Actual:=BytesToString(AESCBCData,AES_BLOCK_SIZE);
Expected:='7649abac8119b246cee98e9b12e9197d'; {Source: http://www.inconteam.com/software-development/41-encryption/55-aes-test-vectors}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
CipherDestroy(Cipher);
end
else
begin
AddItemEx(AResponse,'Result:','CipherCreate Failed',3);
end;
AddBlank(AResponse);
{AES CipherDecrypt}
AddItemEx(AResponse,'Test:','CipherDecrypt(CRYPTO_CIPHER_ALG_AES)',3);
AddItemEx(AResponse,'Key:','0x2b7e151628aed2a6abf7158809cf4f3c',3);
AddItemEx(AResponse,'Data:','0x7649abac8119b246cee98e9b12e9197d',3);
AddItemEx(AResponse,'Vector:','0x000102030405060708090A0B0C0D0E0F',3);
AddItemEx(AResponse,'Mode:','Cipher Block Chaining (CBC)',3);
AESCBCKey:=AllocMem(AES_KEY_SIZE128);
StringToBytes('2b7e151628aed2a6abf7158809cf4f3c',PByte(AESCBCKey),AES_KEY_SIZE128);
AESCBCVector:=AllocMem(AES_BLOCK_SIZE);
StringToBytes('000102030405060708090A0B0C0D0E0F',PByte(AESCBCVector),AES_BLOCK_SIZE);
AESCBCData:=AllocMem(AES_BLOCK_SIZE);
StringToBytes('7649abac8119b246cee98e9b12e9197d',PByte(AESCBCData),AES_BLOCK_SIZE);
Cipher:=CipherCreate(CRYPTO_CIPHER_ALG_AES,PChar(AESCBCVector),PChar(AESCBCKey),AES_KEY_SIZE128);
if Cipher <> nil then
begin
if CipherDecrypt(Cipher,AESCBCData,AESCBCData,AES_BLOCK_SIZE) then
begin
Actual:=BytesToString(AESCBCData,AES_BLOCK_SIZE);
Expected:='6bc1bee22e409f96e93d7e117393172a'; {Source: http://www.inconteam.com/software-development/41-encryption/55-aes-test-vectors}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
CipherDestroy(Cipher);
end
else
begin
AddItemEx(AResponse,'Result:','CipherCreate Failed',3);
end;
AddBlank(AResponse);
{AES AESCTREncryptData}
AddItemEx(AResponse,'Test:','AESCTREncryptData (128bit)',3);
AddItemEx(AResponse,'Key:','2b7e151628aed2a6abf7158809cf4f3c',3);
AddItemEx(AResponse,'Nonce:','f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff',3);
AddItemEx(AResponse,'Data:','6bc1bee22e409f96e93d7e117393172a',3);
AddItemEx(AResponse,'Mode:','Counter Mode (CTR)',3);
AESCTRKey:=AllocMem(AES_KEY_SIZE128);
StringToBytes('2b7e151628aed2a6abf7158809cf4f3c',PByte(AESCTRKey),AES_KEY_SIZE128);
AESCTRData:=AllocMem(AES_BLOCK_SIZE);
StringToBytes('6bc1bee22e409f96e93d7e117393172a',PByte(AESCTRData),AES_BLOCK_SIZE);
AESCTRNonce:=AllocMem(AES_BLOCK_SIZE);
StringToBytes('f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff',PByte(AESCTRNonce),AES_BLOCK_SIZE);
if AESCTREncryptData(AESCTRKey,AES_KEY_SIZE128,AESCTRNonce,AESCTRData,AESCTRData,AES_BLOCK_SIZE) then
begin
Actual:=BytesToString(AESCTRData,AES_BLOCK_SIZE);
Expected:=Lowercase('874d6191b620e3261bef6864990db6ce'); {Source: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38a.pdf}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
AddBlank(AResponse);
FreeMem(AESCTRKey);
FreeMem(AESCTRData);
FreeMem(AESCTRNonce);
{AES AESCTRDecryptData}
AddItemEx(AResponse,'Test:','AESCTRDecryptData (128bit)',3);
AddItemEx(AResponse,'Key:','2b7e151628aed2a6abf7158809cf4f3c',3);
AddItemEx(AResponse,'Nonce:','f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff',3);
AddItemEx(AResponse,'Data:','874d6191b620e3261bef6864990db6ce',3);
AddItemEx(AResponse,'Mode:','Counter Mode (CTR)',3);
AESCTRKey:=AllocMem(AES_KEY_SIZE128);
StringToBytes('2b7e151628aed2a6abf7158809cf4f3c',PByte(AESCTRKey),AES_KEY_SIZE128);
AESCTRData:=AllocMem(AES_BLOCK_SIZE);
StringToBytes('874d6191b620e3261bef6864990db6ce',PByte(AESCTRData),AES_BLOCK_SIZE);
AESCTRNonce:=AllocMem(AES_BLOCK_SIZE);
StringToBytes('f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff',PByte(AESCTRNonce),AES_BLOCK_SIZE);
if AESCTRDecryptData(AESCTRKey,AES_KEY_SIZE128,AESCTRNonce,AESCTRData,AESCTRData,AES_BLOCK_SIZE) then
begin
Actual:=BytesToString(AESCTRData,AES_BLOCK_SIZE);
Expected:=Lowercase('6bc1bee22e409f96e93d7e117393172a'); {Source: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38a.pdf}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
end;
AddBlank(AResponse);
FreeMem(AESCTRKey);
FreeMem(AESCTRData);
FreeMem(AESCTRNonce);
{AES AESGCMEncryptData}
AESGCMKey:=AllocMem(AES_KEY_SIZE128);
StringToBytes('000102030405060708090a0b0c0d0e0f',PByte(AESGCMKey),AES_KEY_SIZE128);
AESGCMTag:=AllocMem(AES_BLOCK_SIZE);
for Count:=1 to 32 do
begin
AESGCMIV:=AllocMem(Count);
StringToBytes('000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f',PByte(AESGCMIV),Count);
AESGCMAAD:=AllocMem(Count);
StringToBytes('000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f',PByte(AESGCMAAD),Count);
AESGCMData:=AllocMem(Count);
StringToBytes('000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f',PByte(AESGCMData),Count);
AddItemEx(AResponse,'Test:','AESGCMEncryptData (128bit)',3);
AddItemEx(AResponse,'Key:',BytesToString(AESGCMKey,AES_KEY_SIZE128),3);
AddItemEx(AResponse,'IV:',BytesToString(AESGCMIV,Count),3);
AddItemEx(AResponse,'AAD:',BytesToString(AESGCMAAD,Count),3);
AddItemEx(AResponse,'Data:',BytesToString(AESGCMData,Count),3);
AddItemEx(AResponse,'Mode:','Galois/Counter Mode (GCM)',3);
if AESGCMEncryptData(AESGCMKey,AES_KEY_SIZE128,AESGCMIV,AESGCMAAD,AESGCMData,AESGCMData,Count,Count,Count,AESGCMTag) then
begin
Actual:=BytesToString(AESGCMData,Count);
Expected:=Lowercase(AESGCMTestVectors[Count,1]); {Source: https://github.com/libtom/libtomcrypt/blob/develop/notes/gcm_tv.txt}
ActualTag:=BytesToString(AESGCMTag,AES_BLOCK_SIZE);
ExpectedTag:=Lowercase(AESGCMTestVectors[Count,2]);
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
AddItemEx(AResponse,'ExpectedTag:',ExpectedTag,3);
AddItemEx(AResponse,'ActualTag:',ActualTag,3);
if (Uppercase(Actual) = Uppercase(Expected)) and (Uppercase(ActualTag) = Uppercase(ExpectedTag)) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
AddBlank(AResponse);
System.Move(AESGCMTag^,AESGCMKey^,AES_BLOCK_SIZE);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
Break;
end;
end
else
begin
AddItemEx(AResponse,'Result:','Failed',3);
Break;
end;
FreeMem(AESGCMIV);
FreeMem(AESGCMAAD);
FreeMem(AESGCMData);
end;
AddBlank(AResponse);
FreeMem(AESGCMKey);
FreeMem(AESGCMTag);
{Hash Tests}
AddBold(AResponse,'Hash Tests','');
AddBlank(AResponse);
AddItemEx(AResponse,'Test:','HashCreate(CRYPTO_HASH_ALG_HMAC_MD5)',3);
AddItemEx(AResponse,'Key:','key',3);
AddItemEx(AResponse,'Value:','The quick brown fox jumps over the lazy dog',3);
Hash:=HashCreate(CRYPTO_HASH_ALG_HMAC_MD5,PChar('key'),3);
if Hash <> nil then
begin
HashUpdate(Hash,PChar('The quick brown fox jumps over the lazy dog'),43);
HashFinish(Hash,@MD5Digest,SizeOf(TMD5Digest));
Actual:=MD5DigestToString(@MD5Digest);
Expected:=Lowercase('80070713463e7749b90c2dc24911e275'); {Source: https://en.wikipedia.org/wiki/Hash-based_message_authentication_code}
AddItemEx(AResponse,'Expected:',Expected,3);
AddItemEx(AResponse,'Actual:',Actual,3);
if Uppercase(Actual) = Uppercase(Expected) then
begin
AddItemEx(AResponse,'Result:','Correct',3);
end
else
begin
AddItemEx(AResponse,'Result:','Incorrect',3);
end;
HashDestroy(Hash);
end
else
begin
AddItemEx(AResponse,'Result:','HashCreate Failed',3);
end;
AddBlank(AResponse);
{Return Result}
Result:=True;
end;
{==============================================================================}
{==============================================================================}
{Initialization Functions}
{==============================================================================}
{==============================================================================}
{API Crypto Functions}
{==============================================================================}
{==============================================================================}
{API Crypto Helper Functions}
function BytesToString(Data:PByte;Size:LongWord):String;
var
Count:LongWord;
begin
{}
Result:='';
if Data = nil then Exit;
if Size = 0 then Exit;
for Count:=0 to Size - 1 do
begin
Result:=Result + HexStr(Data[Count],2);
end;
Result:=Lowercase(Result);
end;
{==============================================================================}
function StringToBytes(const Value:String;Data:PByte;Size:LongWord):Boolean;
var
Count:LongWord;
Offset:LongWord;
begin
{}
Result:=False;
try
if Data = nil then Exit;
if Size = 0 then Exit;
if Length(Value) = 0 then Exit;
{Check Size}
if Length(Value) < (Size * 2) then Exit;
Offset:=0;
for Count:=0 to Size - 1 do
begin
Data[Count]:=StrToInt('$' + Copy(Value,Offset + 1,2));
Inc(Offset,2);
end;
Result:=True;
except
{}
end;
end;
{==============================================================================}
function BuildBytes(Data:PByte;Size:LongWord):Boolean;
var
Count:LongWord;
begin
{}
Result:=False;
try
if Data = nil then Exit;
if Size = 0 then Exit;
for Count:=0 to Size - 1 do
begin
Data[Count]:=Count;
end;
Result:=True;
except
{}
end;
end;
{==============================================================================}
function StringTrim(const Value:String;Size:LongWord):String;
begin
{}
Result:=Value;
if Length(Result) > Size then
begin
Result:=Copy(Result,1,Size) + '...';
end;
end;
{==============================================================================}
{==============================================================================}
end.
|
unit Main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus, ComCtrls, ToolWin, ExtCtrls, FR_Class, FR_Desgn, DateUtils,
XPMan, IniFiles;
type
TMainForm = class(TForm)
StatusBar: TStatusBar;
MainMenu: TMainMenu;
MenuFile: TMenuItem;
MenuConnect: TMenuItem;
MenuSetarator1: TMenuItem;
MenuPrintSetup: TMenuItem;
MenuPrintDlg: TMenuItem;
MenuSeparator2: TMenuItem;
MenuExit: TMenuItem;
MenuDirectory: TMenuItem;
MenuCustomer: TMenuItem;
MenuCategory: TMenuItem;
MenuProduct: TMenuItem;
MenuDocument: TMenuItem;
MenuReceiptOrder: TMenuItem;
MenuExpenseOrder: TMenuItem;
MenuPayment: TMenuItem;
MenuSeparator4: TMenuItem;
MenuStore: TMenuItem;
MenuReports: TMenuItem;
MenuPriceList: TMenuItem;
MenuService: TMenuItem;
MenuOptions: TMenuItem;
MenuWindow: TMenuItem;
MenuCascade: TMenuItem;
MenuTileHorizontal: TMenuItem;
MenuTileVertical: TMenuItem;
MenuSeparator8: TMenuItem;
MenuClose: TMenuItem;
MenuHelp: TMenuItem;
MenuAbout: TMenuItem;
MenuSeparator5: TMenuItem;
MenuConvert: TMenuItem;
PrinterSetupDialog: TPrinterSetupDialog;
MenuBank: TMenuItem;
MenuSeparator3: TMenuItem;
MenuFirm: TMenuItem;
MenuPaymentCash: TMenuItem;
MenuPaymentBank: TMenuItem;
Timer1: TTimer;
MenuTools: TMenuItem;
MenuFastRerort: TMenuItem;
frReport1: TfrReport;
MenuCalc: TMenuItem;
MenuPrice: TMenuItem;
MenuSeparator9: TMenuItem;
MenuRegistration: TMenuItem;
MenuSeparator6: TMenuItem;
MenuDebtor: TMenuItem;
MenuSeparator7: TMenuItem;
MenuCashBook: TMenuItem;
MenuRemain: TMenuItem;
MenuRemainCredit: TMenuItem;
MenuRemainGoods: TMenuItem;
MenuCirculate: TMenuItem;
MenuRemains: TMenuItem;
MenuCommodityMoney: TMenuItem;
MenuRevise: TMenuItem;
MenuInterval: TMenuItem;
frDesigner1: TfrDesigner;
MItdesigner: TMenuItem;
N1: TMenuItem;
ODlg1: TOpenDialog;
frReport2: TfrReport;
XPManifest1: TXPManifest;
N2: TMenuItem;
MenuSQLMonitor: TMenuItem;
procedure EnabledMenuItems;
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure FormResize(Sender: TObject);
procedure FormPaint(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure MenuExitClick(Sender: TObject);
procedure MenuPrintSetupClick(Sender: TObject);
procedure MenuAboutClick(Sender: TObject);
procedure MenuOptionsClick(Sender: TObject);
procedure MenuConnectClick(Sender: TObject);
procedure MenuCascadeClick(Sender: TObject);
procedure MenuTileHorizontalClick(Sender: TObject);
procedure MenuTileVerticalClick(Sender: TObject);
procedure MenuCloseClick(Sender: TObject);
procedure MenuCustomerClick(Sender: TObject);
procedure MenuCategoryClick(Sender: TObject);
procedure MenuProductClick(Sender: TObject);
procedure MenuReceiptOrderClick(Sender: TObject);
procedure MenuExpenseOrderClick(Sender: TObject);
procedure MenuPaymentCashClick(Sender: TObject);
procedure MenuPaymentBankClick(Sender: TObject);
procedure MenuConvertClick(Sender: TObject);
procedure MenuStoreClick(Sender: TObject);
procedure MenuBankClick(Sender: TObject);
procedure MenuFirmClick(Sender: TObject);
procedure MenuFastRerortClick(Sender: TObject);
procedure MenuCalcClick(Sender: TObject);
procedure MenuPriceListClick(Sender: TObject);
procedure MenuPriceClick(Sender: TObject);
procedure MenuRegistrationClick(Sender: TObject);
procedure MenuDebtorClick(Sender: TObject);
procedure MenuCashBookClick(Sender: TObject);
procedure MenuRemainCreditClick(Sender: TObject);
procedure MenuRemainGoodsClick(Sender: TObject);
procedure MenuCirculateClick(Sender: TObject);
procedure MenuRemainsClick(Sender: TObject);
procedure MenuCommodityMoneyClick(Sender: TObject);
procedure MenuReviseClick(Sender: TObject);
procedure MenuIntervalClick(Sender: TObject);
procedure MItdesignerClick(Sender: TObject);
procedure MenuSQLMonitorClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
MainForm: TMainForm;
KeyName: String;
Key: String;
NonReg: String = '';
implementation
uses Registry, StoreDM, About, Registration, Options, IntervalSelect, Login, FirstAid,
Firm, Customer, Bank, Product, Category, BuyOrder, Store, SaleOrder,
PaymentCash, PaymentBank, HomeOrder, InitialBalance, InitialRemains,
ReportPriceList, ReportPrice, ReportDebtor, ReportDebtorSelect,
ReportRemains, ReportCirculate, ReportCirculateSelect, ReportCashBook,
ReportCommodityMoney, ReportRevise, Coding, SQLMonitorForm;
{$R *.dfm}
procedure TMainForm.EnabledMenuItems;
begin
if (MainFirm = 0) or (MainDivision = 0) then
begin
MenuDocument.Enabled := False;
MenuReports.Enabled := False;
end
else
begin
MenuDocument.Enabled := True;
MenuReports.Enabled := True;
end;
end;
procedure TMainForm.FormCreate(Sender: TObject);
begin
Caption := '...';
// IniFile:=TIniFile.Create('store.cfg');
//Присваиваем Переменным дат текущие значения
TopDate := DateToStr(StartOfAMonth(YearOf(Now), MonthOf(Now)));
BottomDate := DateToStr(EndOfAMonth(YearOf(Now), MonthOf(Now)));
{Временно отключено....
При обратном включении надо будет
отключить в IBDataBase ВСЁ.... }
with TLoginForm.Create(nil) do
try
ShowModal;
if ModalResult <> mrOk then
Application.Terminate;
finally
Free;
end;
{}
{
Если включен предыдущий кусок, то этот надо отключить...
}
{ with StoreDataModule do
begin
FirmSelectQuery.Open;
FirmSelectQuery.Locate('CustomerID', MainFirm, []);
if (FirmName <> FirmSelectQuery['CustomerName']) or (Key <> Code(FirmSelectQuery.FieldByName('INN').AsString)) then
begin
NonReg := ' - не зарегистрировано';
Application.MessageBox('Пожалуйста, зарегистрируйтесь.',
'Предупреждение', mb_IconWarning);
end;
if (MainFirm <> FirmSelectQuery['CustomerID']) and (FirmName <> FirmSelectQuery['CustomerName']) then
begin
MainFirm := 0;
FirmName := '';
MainDivision := 0;
MainPrice := 0;
RetailCustomerID := 0;
end;
FirmSelectQuery.Close;
end;
Caption := 'Склад - ' + FirmName +
// ' (' + StoreDataModule.DataBase.Params.Values['user_name'] + ')' +
NonReg;
//Влкючаем\Отключаем "Меню" Докуметнтов и Отчетов
EnabledMenuItems; }
{}
end;
// Прекращение работы приложения
procedure TMainForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
if StoreDataModule.Database.Connected then
StoreDataModule.Database.Close;
Application.Terminate;
end;
// Подтверждение завершения работы с программой
procedure TMainForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
{
Временно отключено....
Application.Restore;
if Application.MessageBox('Вы действительно хотите завершить работу с программой?',
'Завершение работы',
mb_YesNo + mb_IconQuestion + mb_DefButton2) = idYes then
CanClose := True
else
CanClose := False;
{}
end;
//
procedure TMainForm.FormResize(Sender: TObject);
begin
StatusBar.Panels[0].Width := MainForm.ClientWidth -
StatusBar.Panels[1].Width - StatusBar.Panels[2].Width;
end;
//Если таблица "Фирмы" пустая, вызываем форму "Первой Помощи"
procedure TMainForm.FormPaint(Sender: TObject);
begin
if FirmIsEmpty = 1 then
begin
FirmIsEmpty := 0;
with TFirstAidForm.Create(nil) do
try
ShowModal;
finally
Free;
end;
end;
end;
procedure TMainForm.Timer1Timer(Sender: TObject);
begin
StatusBar.Panels[1].Text := FormatDateTime('dddd', Now) + ' - ' + FormatDateTime('ddddd', Now);
StatusBar.Panels[2].Text := FormatDateTime('tt', Now);
end;
// Выход из программы...
procedure TMainForm.MenuExitClick(Sender: TObject);
begin
Close;
end;
// Настройка принтера
procedure TMainForm.MenuPrintSetupClick(Sender: TObject);
begin
PrinterSetupDialog.Execute;
end;
// Создание экземпляра формы "О программе..."
procedure TMainForm.MenuAboutClick(Sender: TObject);
begin
with TAboutBox.Create(nil) do
try
ShowModal;
finally
Free;
end;
end;
// Создание экземпляра формы "Настройки"
procedure TMainForm.MenuOptionsClick(Sender: TObject);
begin
with TOptionsForm.Create(nil) do
try
ShowModal;
finally
Free;
end;
end;
// Создание экземпляра формы "Подключение"
procedure TMainForm.MenuConnectClick(Sender: TObject);
begin
with TLoginForm.Create(nil) do
try
ShowModal;
finally
Free;
end;
end;
// Упорядочивание дочених окон каскадом
procedure TMainForm.MenuCascadeClick(Sender: TObject);
begin
Cascade;
end;
// Упорядочивание дочених окон по горизонтали
procedure TMainForm.MenuTileHorizontalClick(Sender: TObject);
begin
TileMode := tbHorizontal;
Tile;
end;
// Упорядочивание дочених окон по верикали
procedure TMainForm.MenuTileVerticalClick(Sender: TObject);
begin
TileMode := tbVertical;
Tile;
end;
// Закрытие всех дочерних окон
procedure TMainForm.MenuCloseClick(Sender: TObject);
var
n: Integer;
begin
for n := 0 to MDIChildCount - 1 do
MDIChildren[n].Close;
end;
// Создание экземпляра формы "Фирмы"
procedure TMainForm.MenuFirmClick(Sender: TObject);
begin
if FirmForm = nil then
FirmForm := TFirmForm.Create(Self)
else FirmForm.Show;
end;
// Создание экземпляра формы "Клиенты"
procedure TMainForm.MenuCustomerClick(Sender: TObject);
begin
if CustomerForm = nil then
CustomerForm := TCustomerForm.Create(Self)
else CustomerForm.Show;
end;
// Создание экземпляра формы "Банки"
procedure TMainForm.MenuBankClick(Sender: TObject);
begin
if BankForm = nil then
BankForm := TBankForm.Create(Self)
else BankForm.Show;
end;
// Создание экземпляра формы "Группы Товара"
procedure TMainForm.MenuCategoryClick(Sender: TObject);
begin
if CategoryForm = nil then
CategoryForm := TCategoryForm.Create(Self)
else CategoryForm.Show;
end;
// Создание экземпляра формы "Товар"
procedure TMainForm.MenuProductClick(Sender: TObject);
begin
if ProductForm = nil then
ProductForm := TProductForm.Create(Self)
else ProductForm.Show;
end;
// Создание экземпляра формы "Приход"
procedure TMainForm.MenuReceiptOrderClick(Sender: TObject);
var
Test: Integer;
begin
StoreDataModule.TestDaysQuery.Open;
Test := StoreDataModule.TestDaysQuery.FieldByName('Test').AsInteger;
StoreDataModule.TestDaysQuery.Close;
if (NonReg <> '') and (Test > 90) then
begin
Application.MessageBox('Для продолжения работы,' + #10#13 + 'пожалуйста, зарегистрируйтесь.',
'Предупреждение', mb_IconWarning);
end
else
begin
if BuyOrderForm = nil then
BuyOrderForm := TBuyOrderForm.Create(Self)
else BuyOrderForm.Show;
end;
end;
// Создание экземпляра формы "Расход"
procedure TMainForm.MenuExpenseOrderClick(Sender: TObject);
var
Test: Integer;
begin
StoreDataModule.TestDaysQuery.Open;
Test := StoreDataModule.TestDaysQuery.FieldByName('Test').AsInteger;
StoreDataModule.TestDaysQuery.Close;
if (NonReg <> '') and (Test > 90) then
begin
Application.MessageBox('Для продолжения работы,' + #10#13 + 'пожалуйста, зарегистрируйтесь.',
'Предупреждение', mb_IconWarning);
end
else
begin
if SaleOrderForm = nil then
SaleOrderForm := TSaleOrderForm.Create(Self)
else SaleOrderForm.Show;
end;
end;
// Создание экземпляра формы "Оплата Наличными"
procedure TMainForm.MenuPaymentCashClick(Sender: TObject);
begin
if PaymentCashForm = nil then
PaymentCashForm := TPaymentCashForm.Create(Self)
else PaymentCashForm.Show;
end;
// Создание экземпляра формы "Оплата через Банк"
procedure TMainForm.MenuPaymentBankClick(Sender: TObject);
begin
if PaymentBankForm = nil then
PaymentBankForm := TPaymentBankForm.Create(Self)
else PaymentBankForm.Show;
end;
// Создание экземпляра формы "Сборка"
procedure TMainForm.MenuConvertClick(Sender: TObject);
var
Test: Integer;
begin
StoreDataModule.TestDaysQuery.Open;
Test := StoreDataModule.TestDaysQuery.FieldByName('Test').AsInteger;
StoreDataModule.TestDaysQuery.Close;
if (NonReg <> '') and (Test > 90) then
begin
Application.MessageBox('Для продолжения работы,' + #10#13 + 'пожалуйста, зарегистрируйтесь.',
'Предупреждение', mb_IconWarning);
end
else
begin
if HomeOrderForm = nil then
HomeOrderForm := THomeOrderForm.Create(Self)
else HomeOrderForm.Show;
end;
end;
// Создание экземпляра формы "Склад"
procedure TMainForm.MenuStoreClick(Sender: TObject);
begin
if StoreForm = nil then
StoreForm := TStoreForm.Create(Self)
else StoreForm.Show;
end;
procedure TMainForm.MenuFastRerortClick(Sender: TObject);
begin
frReport1.Clear;
// frReport1.LoadFromFile('Reports\Empty.frf');
frReport1.DesignReport;
frReport1.Clear;
end;
procedure TMainForm.MenuCalcClick(Sender: TObject);
begin
WinExec(PChar('calc.exe'), SW_ShowNormal);
end;
procedure TMainForm.MenuPriceListClick(Sender: TObject);
begin
with TReportPriceListForm.Create(nil) do
try
ShowModal;
finally
Free;
end;
end;
procedure TMainForm.MenuPriceClick(Sender: TObject);
begin
with TReportPriceForm.Create(nil) do
try
ShowModal;
finally
Free;
end;
end;
procedure TMainForm.MenuRegistrationClick(Sender: TObject);
begin
with TRegistrationForm.Create(nil) do
try
ShowModal;
finally
Free;
end;
end;
procedure TMainForm.MenuDebtorClick(Sender: TObject);
begin
ReportDebtorSelectForm := TReportDebtorSelectForm.Create(Self);
ReportDebtorSelectForm.ShowModal;
if ReportDebtorSelectForm.ModalResult = mrOK then
with TReportDebtorForm.Create(nil) do
try
ShowModal;
finally
Free;
end;
end;
procedure TMainForm.MenuCashBookClick(Sender: TObject);
begin
with TReportCashBookForm.Create(nil) do
try
ShowModal;
finally
Free;
end;
end;
procedure TMainForm.MenuRemainCreditClick(Sender: TObject);
begin
with TInitialBalanceForm.Create(nil) do
try
ShowModal;
finally
Free;
end;
end;
procedure TMainForm.MenuRemainGoodsClick(Sender: TObject);
begin
with TInitialRemainsForm.Create(nil) do
try
ShowModal;
finally
Free;
end;
end;
procedure TMainForm.MenuCirculateClick(Sender: TObject);
begin
ReportCirculateSelectForm := TReportCirculateSelectForm.Create(Self);
ReportCirculateSelectForm.ShowModal;
if ReportCirculateSelectForm.ModalResult = mrOK then
with TReportCirculateForm.Create(nil) do
try
ShowModal;
finally
Free;
end;
end;
procedure TMainForm.MenuRemainsClick(Sender: TObject);
begin
with TReportRemainsForm.Create(nil) do
try
ShowModal;
finally
Free;
end;
end;
procedure TMainForm.MenuCommodityMoneyClick(Sender: TObject);
begin
with TReportCommodityMoneyForm.Create(nil) do
try
ShowModal;
finally
Free;
end;
end;
procedure TMainForm.MenuReviseClick(Sender: TObject);
begin
with TReportReviseForm.Create(nil) do
try
ShowModal;
finally
Free;
end;
end;
//Выбираем Интервал рабочих дат
procedure TMainForm.MenuIntervalClick(Sender: TObject);
begin
with TIntervalSelectForm.Create(nil) do
try
ShowModal;
finally
Free;
end;
end;
procedure TMainForm.MItdesignerClick(Sender: TObject);
begin
ODlg1.Filter:='Файлы отчетов FastReport (*.frf)|*.frf';
odlg1.InitialDir:=extractfilepath(application.ExeName)+'Reports';
if odlg1.Execute and fileexists(odlg1.FileName) then
begin
frreport2.Clear;
frreport2.LoadFromFile(odlg1.FileName);
frreport2.DesignReport;
frreport2.Clear;
end;
end;
procedure TMainForm.MenuSQLMonitorClick(Sender: TObject);
begin
if SQLMonitor = nil then
SQLMonitor := TSQLMonitor.Create(Self)
else SQLMonitor.Show;
end;
end.
|
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Measures defined : We define some Objects and Strcuture to
// manage and store Sizes and Dates
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
unit Measures;
interface
uses Classes;
type
cMeasuresItem = (miCreated, miModified, miAccessed);
cMeasuresItemSlice = (misMin, misMax);
TMeasures = class
private
fSizes : Array[cMeasuresItemSlice] of uInt64;
fDates : Array[cMeasuresItemSlice,cMeasuresItem] of TDateTime;
fCount : uInt64;
public
end;
Implementation
end; |
program Sample;
var
H : String;
begin
H := 'Hello World';
WriteLn('H: ''', H, '''');
end.
|
//
// Generated by JavaToPas v1.4 20140526 - 132955
////////////////////////////////////////////////////////////////////////////////
unit android.view.WindowId;
interface
uses
AndroidAPI.JNIBridge,
Androidapi.JNI.JavaTypes,
Androidapi.JNI.os,
android.view.WindowId_FocusObserver;
type
JWindowId = interface;
JWindowIdClass = interface(JObjectClass)
['{BBC0F127-CFE6-4E08-99D7-8AED645474BB}']
function _GetCREATOR : JParcelable_Creator; cdecl; // A: $19
function describeContents : Integer; cdecl; // ()I A: $1
function equals(otherObj : JObject) : boolean; cdecl; // (Ljava/lang/Object;)Z A: $1
function hashCode : Integer; cdecl; // ()I A: $1
function isFocused : boolean; cdecl; // ()Z A: $1
function toString : JString; cdecl; // ()Ljava/lang/String; A: $1
procedure registerFocusObserver(observer : JWindowId_FocusObserver) ; cdecl;// (Landroid/view/WindowId$FocusObserver;)V A: $1
procedure unregisterFocusObserver(observer : JWindowId_FocusObserver) ; cdecl;// (Landroid/view/WindowId$FocusObserver;)V A: $1
procedure writeToParcel(&out : JParcel; flags : Integer) ; cdecl; // (Landroid/os/Parcel;I)V A: $1
property CREATOR : JParcelable_Creator read _GetCREATOR; // Landroid/os/Parcelable$Creator; A: $19
end;
[JavaSignature('android/view/WindowId$FocusObserver')]
JWindowId = interface(JObject)
['{AE20B66C-0923-465C-8F93-90660BEF30FC}']
function describeContents : Integer; cdecl; // ()I A: $1
function equals(otherObj : JObject) : boolean; cdecl; // (Ljava/lang/Object;)Z A: $1
function hashCode : Integer; cdecl; // ()I A: $1
function isFocused : boolean; cdecl; // ()Z A: $1
function toString : JString; cdecl; // ()Ljava/lang/String; A: $1
procedure registerFocusObserver(observer : JWindowId_FocusObserver) ; cdecl;// (Landroid/view/WindowId$FocusObserver;)V A: $1
procedure unregisterFocusObserver(observer : JWindowId_FocusObserver) ; cdecl;// (Landroid/view/WindowId$FocusObserver;)V A: $1
procedure writeToParcel(&out : JParcel; flags : Integer) ; cdecl; // (Landroid/os/Parcel;I)V A: $1
end;
TJWindowId = class(TJavaGenericImport<JWindowIdClass, JWindowId>)
end;
implementation
end.
|
unit Role;
interface
uses
Right;
type
TRole = class
private
FName: string;
FCode: string;
FDescription: string;
FRights: array of TRight;
FAssignedNewValue: boolean;
FAssignedOldValue: boolean;
function GetHasCode: boolean;
function GetHasName: boolean;
function GetRight(const i: integer): TRight;
procedure SetRight(const i: integer; const Value: TRight);
function GetRightsCount: integer;
function GetModified: boolean;
public
property Code: string read FCode write FCode;
property Name: string read FName write FName;
property Description: string read FDescription write FDescription;
property HasCode: boolean read GetHasCode;
property HasName: boolean read GetHasName;
property Rights[const i: integer]: TRight read GetRight write SetRight;
property RightsCount: integer read GetRightsCount;
property AssignedOldValue: boolean read FAssignedOldValue write FAssignedOldValue;
property AssignedNewValue: boolean read FAssignedNewValue write FAssignedNewValue;
property Modified: boolean read GetModified;
end;
implementation
{ TRole }
function TRole.GetHasCode: boolean;
begin
Result := FCode <> '';
end;
function TRole.GetHasName: boolean;
begin
Result := FName <> '';
end;
function TRole.GetModified: boolean;
begin
Result := FAssignedOldValue <> FAssignedNewValue;
end;
function TRole.GetRight(const i: integer): TRight;
begin
Result := FRights[i];
end;
function TRole.GetRightsCount: integer;
begin
Result := Length(FRights);
end;
procedure TRole.SetRight(const i: integer; const Value: TRight);
begin
if i = Length(FRights) then SetLength(FRights,Length(FRights)+1);
FRights[i] := Value;
end;
end.
|
unit SortThds;
interface
uses
Classes, Graphics, ExtCtrls,windows,Sysutils;
type
{ TSortThread }
PSortArray = ^TSortArray;
TSortArray = array[0..MaxInt div SizeOf(Integer) - 1] of Integer;
TSortThread = class(TThread)
private
FBox: TPaintBox;
FSortArray: PSortArray;
FSize: Integer;
FA, FB, FI, FJ: Integer;
procedure DoVisualSwap;
function GetTick:int64;
procedure DoShowResult;
protected
procedure Execute; override;
procedure VisualSwap(A, B, I, J: Integer);
procedure Erease(i,len:integer);
procedure Paint(i,len:integer);
procedure Sort(var A: array of Integer); virtual; abstract;
public
s:string;
constructor Create(Box: TPaintBox; var SortArray: array of Integer);
end;
{ TBubbleSort }
TBubbleSort = class(TSortThread)
protected
procedure Sort(var A: array of Integer); override;
end;
{ TSelectionSort }
TSelectionSort = class(TSortThread)
protected
procedure Sort(var A: array of Integer); override;
end;
{ TQuickSort }
TQuickSort = class(TSortThread)
protected
procedure Sort(var A: array of Integer); override;
end;
TInsertSort = class(TSortThread)
protected
procedure Sort(var A: array of Integer); override;
end;
TMergeSort = class(TSortThread)
protected
procedure Sort(var A: array of Integer); override;
end;
THeapSort = class(TSortThread)
private
heapSize:integer;
function LeftChild(parent:integer):Integer;
function RightChild(parent:integer):Integer;
procedure CreateMaxHeap(var A:array of Integer);
procedure MaxHeapify(var A:array of Integer;i:integer);
procedure Swap(var A:array of Integer;item1,item2:Integer);
protected
procedure Sort(var A: array of Integer); override;
end;
TCountingSort = class(TSortThread)
protected
procedure Sort(var A: array of Integer); override;
end;
procedure PaintLine(Canvas: TCanvas; I, Len: Integer);
implementation
procedure PaintLine(Canvas: TCanvas; I, Len: Integer);
begin
Canvas.PolyLine([Point(0, I * 2 + 1), Point(Len, I * 2 + 1)]); //缝隙
end;
{ TSortThread }
constructor TSortThread.Create(Box: TPaintBox; var SortArray: array of Integer);
begin
FBox := Box;
FSortArray := @SortArray;
FSize := High(SortArray) - Low(SortArray) + 1;
FreeOnTerminate := True;
inherited Create(False);
end;
{ Since DoVisualSwap uses a VCL component (i.e., the TPaintBox) it should never
be called directly by this thread. DoVisualSwap should be called by passing
it to the Synchronize method which causes DoVisualSwap to be executed by the
main VCL thread, avoiding multi-thread conflicts. See VisualSwap for an
example of calling Synchronize. }
procedure TSortThread.DoVisualSwap;
begin
with FBox do
begin
Canvas.Pen.Color := clBtnFace;
PaintLine(Canvas, FI, FA);
PaintLine(Canvas, FJ, FB);
Canvas.Pen.Color := clRed;
PaintLine(Canvas, FI, FB);
PaintLine(Canvas, FJ, FA);
end;
end;
{ VisusalSwap is a wrapper on DoVisualSwap making it easier to use. The
parameters are copied to instance variables so they are accessable
by the main VCL thread when it executes DoVisualSwap }
procedure TSortThread.VisualSwap(A, B, I, J: Integer);
begin
FA := A;
FB := B;
FI := I;
FJ := J;
Synchronize(DoVisualSwap);
end;
{ The Execute method is called when the thread starts }
procedure TSortThread.Execute;
var
// sbegin,send:integer;
sbegin,send:int64;
begin
sbegin:=GetTick;
Sort(Slice(FSortArray^, FSize));
send:=GetTick;
// sbegin:=GetTickCount;
// Sort(Slice(FSortArray^, FSize));
// send:=GetTickCount;
s:=IntToStr(send-sbegin) + ' 个CPU周期';
Synchronize(DoShowResult);
end;
procedure TSortThread.DoShowResult;
begin
FBox.Canvas.TextOut(55,5,s);
end;
function TSortThread.GetTick: int64;
asm
RDTSC;
end;
procedure TSortThread.Erease(i, len: integer);
begin
with FBox do
begin
FBox.Canvas.Lock;
Canvas.Pen.Color := clBtnFace;
PaintLine(Canvas, i, len);
FBox.Canvas.UnLock;
end;
end;
procedure TSortThread.Paint(i, len: integer);
begin
with FBox do
begin
FBox.Canvas.Lock;
Canvas.Pen.Color := clRed;
PaintLine(Canvas, i, len);
FBox.Canvas.UnLock;
end;
end;
{ TBubbleSort }
//中心思想:两两比较,只要是大的往后移,小的就往前移 --- 交换
procedure TBubbleSort.Sort(var A: array of Integer);
var
I, J, T: Integer;
begin
//从最后一个到第一个
for I := High(A) downto Low(A) do
//第一个到最后一个 ,一次循环过后,最大的那个数,就沉入底部
for J := Low(A) to High(A) - 1 do
//第一个大于第二个,交换顺寻
if A[J] > A[J + 1] then
begin
VisualSwap(A[J], A[J + 1], J, J + 1);
T := A[J];
A[J] := A[J + 1];
A[J + 1] := T;
if Terminated then Exit;
end;
end;
{ TSelectionSort }
//中心思想:选择最小的放在第一个,次小的放在第二个……
procedure TSelectionSort.Sort(var A: array of Integer);
var
I, J, T: Integer;
begin
//从最小到最大
for I := Low(A) to High(A) - 1 do
//内循环:从最大到最小
for J := High(A) downto I + 1 do
//选择一个最小的元素放在第一个位置
if A[I] > A[J] then
begin
VisualSwap(A[I], A[J], I, J);
T := A[I];
A[I] := A[J];
A[J] := T;
if Terminated then Exit;
end;
end;
{ TQuickSort }
//中心思想:选定一个枢纽元素,让枢纽左边的元素都要小于枢纽元素,右边的都要大于枢纽元素
//再使用递归的思想,将左(右)边的再次快速排序
procedure TQuickSort.Sort(var A: array of Integer);
procedure QuickSort(var A: array of Integer; iLo, iHi: Integer);
var
Lo, Hi, Mid, T: Integer;
begin
Lo := iLo;
Hi := iHi;
Mid := A[(Lo + Hi) div 2]; //中央枢纽元素
repeat
while A[Lo] < Mid do Inc(Lo);
while A[Hi] > Mid do Dec(Hi);
//对左右进行一次交换
if Lo <= Hi then
begin
VisualSwap(A[Lo], A[Hi], Lo, Hi);
T := A[Lo];
A[Lo] := A[Hi];
A[Hi] := T;
Inc(Lo);
Dec(Hi);
end;
until Lo > Hi;
//如果运行到这里就表示左边已经全部都小于右边了
//在将被分割的数组左边再次进行排序
if Hi > iLo then QuickSort(A, iLo, Hi);
//在将被分割的数组右边再次进行排序
if Lo < iHi then QuickSort(A, Lo, iHi);
if Terminated then Exit;
end;
begin
QuickSort(A, Low(A), High(A));
end;
{ TInsertSort }
//中心思想:将数组抽象为两个部分:第一个部分为已经排序的数组,第二个部分为未排序数组。然后依次从未排序数组中选择一个数据插入到已经排序的数组
procedure TInsertSort.Sort(var A: array of Integer);
var
i,j,t:Integer;
begin
inherited;
for i := 1 to Length(A)-1 do
begin
//A[0]当做已经初排序只有1个元素的数组
t:=A[i];
//选择并插入 ,插入就会有移位操作
j:=i-1;
while ((j>=0) and (a[j]>t)) do
begin
Erease(j+1,a[j+1]);
paint(j+1,a[j]); //这里需要同步
a[j+1]:=a[j];
Dec(j);
end;
Erease(j+1,a[j+1]);
paint(j+1,t);
A[j+1]:=t;
end;
end;
{ TMergeSort }
procedure TMergeSort.Sort(var A: array of Integer);
const
VeryBig=999999999;
procedure Merge(var A:array of Integer;Left,Mid,Right:integer);
var
tempArray1,tempArray2:Array of Integer;
count1,count2,i,j,k:integer;
begin
count1:=Mid-Left+1;
count2:=Right-Mid; //数组2是从Mid+1开始的
SetLength(tempArray1,count1+1);
SetLength(tempArray2,count2+1);
for i := 0 to count1-1 do
begin
tempArray1[i]:=A[Left+i];
end;
for i := 0 to count2-1 do
begin
tempArray2[i]:=A[Mid+1+i];
end;
tempArray1[count1]:=VeryBig;
tempArray2[count2]:=VeryBig;
i:=0;
j:=0;
for k := Left to Right do
begin
if tempArray1[i]<=tempArray2[j] then
begin
Erease(k,a[k]);
paint(k,tempArray1[i]);
A[k]:= tempArray1[i];
i:=i+1;
end
else
begin
Erease(k,a[k]);
paint(k,tempArray2[j]);
A[k]:= tempArray2[j];
j:=j+1;
end;
end;
end;
procedure MergeSort(var A:array of Integer;left,right:integer);
var
Mid:integer;
begin
if left<right then
begin
Mid:=(left+right) div 2;
MergeSort(A,left,Mid);
MergeSort(A,Mid+1,right);
Merge(A,left,Mid,right);
end;
end;
begin
inherited;
MergeSort(A,Low(A),High(A));
end;
{ THeapSort }
procedure THeapSort.CreateMaxHeap(var A: array of Integer);
var
i:integer;
begin
heapSize:=Length(A)-1;
//子数组A[(length(A) div 2) +1 .. (length(A)-1] 是完全二叉树的叶子节点
for i := (heapSize shr 1) downto 0 do
begin
MaxHeapify(A,i);
end;
end;
function THeapSort.LeftChild(parent: integer): Integer;
begin
Result:=parent shl 1;
end;
function THeapSort.RightChild(parent: integer): Integer;
begin
Result:=parent shl 1 +1;
end;
procedure THeapSort.MaxHeapify(var A: array of Integer; i: integer);
var
Left,Right,bigger:Integer;
begin
Left:= LeftChild(i);
Right:= RightChild(i);
//最大堆要确保根节点必须不小于左右子树
if (Left<=heapSize) then
begin
if (A[Left]>A[i]) then
bigger := Left
else
bigger:= i;
end;
if (Right<=heapSize) then
if (A[Right]>A[bigger]) then
bigger:=Right;
if bigger<>i then
begin
Swap(A,i,bigger);
//子树节点值改变的话,就继续递归子树
MaxHeapify(A,bigger);
end;
end;
procedure THeapSort.Sort(var A: array of Integer);
var
i:integer;
begin
inherited;
CreateMaxHeap(A);
for i := heapSize downto 1 do
begin
Swap(A,i,0);
Dec(heapSize);
MaxHeapify(A,0);
end;
end;
procedure THeapSort.Swap(var A:array of Integer;item1, item2: Integer);
var
temp:integer;
begin
VisualSwap(A[item1], A[item2], item1,item2);
temp:=A[item1];
A[item1]:=A[item2];
A[item2]:=temp;
end;
{ TCountingSort }
procedure TCountingSort.Sort(var A: array of Integer);
var
Max,i:Integer;
B,C:Array of Integer;
procedure CountingSort(var A,B,C:array of Integer);
var
i:integer;
begin
for i := 0 to Length(A)-1 do
begin
c[A[i]]:=c[A[i]]+1; //c[i]表示,莫数的个数
end;
for i := 1 to Max do //c[i]表示,小于或者等于某数的个数
begin
c[i]:=c[i]+c[i-1];
end;
for i := Length(A)-1 downto 0 do
begin
B[c[A[i]]-1]:=A[i];
Dec(c[a[i]]);
end;
end;
begin
inherited;
Max:=A[0]; //这里需要确保数组元素个数大于或者等于1,否则rang out of boundary
for i := 1 to Length(A)-1 do
begin
if a[I]>Max then Max:=A[i];
end;
SetLength(C,Max+1);//包括0
SetLength(B,Length(A));
CountingSort(A,B,C);
for i := 0 to Length(A)-1 do
begin
A[i]:=B[i];
end;
FBox.Invalidate;
end;
end.
|
unit ProjectBundles;
interface
uses Windows, Sysutils, Classes; // keep uses in old style for earlier versions
CONST
REG_PATH_DELPHI = 'SOFTWARE\Borland\Delphi\%s\Known Packages';
REG_PATH_CODEGEAR = 'SOFTWARE\CodeGear\BDS\%s\Known Packages';
REG_PATH_EMBARCADERO = 'SOFTWARE\Embarcadero\BDS\%s\Known Packages';
DELPHI_VERSION= '%DelphiVersion%';
PRODUCT_VERSION= '%ProductVersion%';
DELPHI_EXE = '%DelphiExe%';
DELPHI_GROUP = '%DelphiGroup';
START_PROJECT_NAME = 'StartProject.bat';
HG_IGNORE_FILE = '.hgignore';
GIT_IGNORE_FILE = '.gitignore';
MAX_VERSIONS=24;
VERSIONINFO : array[1..MAX_VERSIONS,1..3] of integer = (
( 1, 1, 8),( 2, 2, 9),( 3, 3,10),( 4, 4,12),( 5, 5,13),( 6, 6,14),
( 7, 7,15),( 8, 2,16),( 9, 3,17),(10, 4,18),(11, 5,18),(12, 6,20),
(14, 7,21),(15, 8,22),(16, 9,23),(17,10,24),(18,11,25),(19,12,25),
(20,14,25),(21,15,25),(22,16,25),(23,17,30),(24,18,30),(25,19,30)
);
PROJECT_STRUCTURE =
'bin'#13#10+
'client'#13#10+
'common'#13#10+
'componentLibrary\dcu\'+DELPHI_VERSION+#13#10+
'componentLibrary\bpl\'+DELPHI_VERSION+#13#10+
'componentSource'#13#10+
'resources'#13#10+
'server'#13#10+
'test';
START_PROJECT =
'SET DelphiVersion='+DELPHI_VERSION+#13#10+
'SET TargetVersion=%DelphiVersion%'#13#10+
'SET VERSIONOVERRIDE = %1' + #13#10 +
'IF DEFINED VERSIONOVERRIDE (SET DelphiVersion=%VERSIONOVERRIDE%)'+#13#10 +
'SET ActiveProjectName=CHANGE_ME_IN_START_PROJECT_BAT'#13#10+
'SET ActiveProject=%CD%\'#13#10+
'SET ActiveProject_Library=%CD%\ComponentLibrary\'#13#10+
'SET ActiveProject_BPL=%ActiveProject_Library%BPL\%TargetVersion%\'#13#10+
'SET ActiveProject_DCU=%ActiveProject_Library%DCU\%TargetVersion%\'#13#10+
'SET ActiveProject_Source=%CD%\ComponentSource\'#13#10+
'call .\checkbundle'#13#10+
'start '+DELPHI_EXE +' .\%ActiveProjectName%.'+DELPHI_GROUP+#13#10;
VC_IGNORES =
'*.local'#13#10+
'*.identcache'#13#10+
'*.~*'#13#10+
'__history/'#13#10+
'Test/**.dcu'#13#10+
'bin/'#13#10+
'Win64/'#13#10+
'Win32/'#13#10;
GIT_IGNORE = VC_IGNORES;
HG_IGNORE = 'syntax: glob'#13#10+VC_IGNORES;
var
DelphiVersion : string;
TargetVersion : string;
ProjectFolder : string;
RegistryKey : string;
ProjectBPLFolder : string;
StartDir : string;
DelphiEXE : string;
DelphiGroup : string;
ProductVersion: Integer =0;
DefaultDelphiVersion : integer=0;
procedure UpdateBundle;
procedure SetProjectPath;
Procedure SetEnvironmentVariablesByDelphiVersion(ADelphiVersion: string);
function ReplaceEnvironmentVariables(AText: string; AfirstOnly: boolean = false): string;
Procedure CreateProjectFolders;
Procedure OutputBundleFiles;
Procedure CheckBPLS;
Procedure RemoveThisProject;
Function EnvironmentVarToInt(AVariable:string): integer;
Function ListProjectBPLs: string;
Function GetDelphiVersion: string;
Function RTLCompatible(ADelphiVersion:string; ATargetVersion: string): boolean;
Function ProductVersionFromDelphiVersion(ADelphiVersion: string): string;
implementation
uses Registry;
Procedure SetProjectPath;
begin
ProjectFolder := includetrailingBackSlash(ExpandFileName(StartDir));
end;
Function ListFiles(ASearchPath : string): string;
var lFileRecord : TSearchRec;
begin
result := '';
if findfirst(ASearchPath,0,lFileRecord)>0 then exit;
try
repeat
result := result + lFileRecord.Name+#13#10;
until findNext(lFileRecord)<>0;
finally
findclose(lFileRecord);
end;
end;
Function ListProjectBPLs: string;
begin
result := '';
if ProjectBPLFolder='' then
begin
ProjectBPLFolder := GetEnvironmentVariable('ActiveProject_BPL');
if ProjectBPLFolder<>'' then ProjectBPLFolder:=includeTrailingPathDelimiter(ProjectBPLFolder);
end;
if ProjectBPLFolder='' then exit;
result := ListFiles(ProjectBPLFolder+'*.bpl');
end;
Function EnvironmentVarToInt(AVariable:string): integer;
var lVersion: single;
begin
result := 0;
if not tryStrtoFloat(AVariable,lVersion) then exit;
Result := trunc(lVersion);
end;
Function ProductVersionFromDelphiVersion(ADelphiVersion: string): string;
var lVersionAsInt,i: Integer;
begin
result := '';
lVersionAsInt := EnvironmentVarToInt(ADelphiVersion);
for i := 1 to Max_Versions do
if (lVersionAsInt=VERSIONINFO[i,1]) then
begin
result := format('%d.0',[VERSIONINFO[i,2]]);
exit;
end;
end;
Function DelphiVersionFromProductVersion(AProductVersion: string): string;
var lVersion: single;
lVersionAsInt,i: Integer;
begin
result := '';
lVersionAsInt := EnvironmentVarToInt(AProductVersion);
for i := 8 to Max_Versions do
if (lVersionAsInt=VERSIONINFO[i,2]) then
begin
result := format('%d.0',[VERSIONINFO[i,1]]);
exit;
end;
end;
Function RTLCompatible(ADelphiVersion:string;ATargetVersion:string): boolean;
var i, lDelphiVersion, lTargetVersion,
lDelphiRTL, lTargetRTL: integer;
begin
result := true;
if ADelphiVersion=ATargetVersion then exit;
lDelphiRTL:=-1;
lTargetRTL:=-2;
lDelphiVersion := EnvironmentVarToInt(ADelphiVersion);
lTargetVersion := EnvironmentVarToInt(ATargetVersion);
For i := 1 TO MAX_VERSIONS do
begin
if (lDelphiVersion=VERSIONINFO[i,1]) then lDelphiRTL:=VERSIONINFO[i,3];
if (lTargetVersion=VERSIONINFO[i,1]) then lTargetRTL:=VERSIONINFO[i,3];
end;
Result := lDelphiRTL=lTargetRTL;
end;
Function GetDelphiVersion: string;
begin
if DelphiVersion='' then
Result := getEnvironmentVariable('DelphiVersion')
else Result := DelphiVersion;
if Result='' then Result:=format('%d.0',[DefaultDelphiVersion]);
DelphiVersion:=Result;
end;
Function GetTargetVersion: string;
begin
if TargetVersion='' then
Result := getEnvironmentVariable('TargetVersion')
else Result := DelphiVersion;
if Result='' then Result:=format('%d.0',[DefaultDelphiVersion]);
TargetVersion:=Result;
end;
Function GetProductVersion: string;
begin
if ProductVersion=0 then
Result := getEnvironmentVariable('ProductVersion')
else Result := format('%d.0', [ProductVersion]);
if Result='' then Result := ProductVersionFromDelphiVersion(GetDelphiVersion);
end;
Procedure SetEnvironmentVariablesByDelphiVersion(ADelphiVersion: string);
var lRegistryFormatStr: string;
lAltVersion: string;
lVersion:integer;
begin
DelphiVersion:=ADelphiVersion;
DelphiExe := 'Bds';
DelphiGroup := 'groupproj';
lVersion := EnvironmentVarToInt(ADelphiVersion);
case lVersion of
0..8 :
begin
lRegistryFormatStr := REG_PATH_DELPHI;
DelphiGroup := 'bpg';
DelphiEXE := 'Delphi32';
end;
9..13 :
begin
lRegistryFormatStr := REG_PATH_CODEGEAR;
end;
14..99 :
begin
lRegistryFormatStr := REG_PATH_EMBARCADERO;
end;
else
begin
Writeln('Delphi Version Cannot be determined!');
exit;
end;
end;
// Registry Key requires correct Product Version
RegistryKey := format(lRegistryFormatStr,[GetProductVersion]);
end;
function ReplaceEnvironmentVariables(AText: string; AfirstOnly: boolean): string;
var lReplaceFlags : TReplaceFlags;
begin
if AfirstOnly then lReplaceFlags := [] else lReplaceFlags := [rfreplaceAll];
result := stringreplace(AText,DELPHI_VERSION, DelphiVersion, lReplaceFlags);
result := stringreplace(Result,DELPHI_EXE, DelphiExe, lReplaceFlags);
result := stringreplace(Result,DELPHI_GROUP, DelphiGroup, lReplaceFlags);
end;
Procedure CreateProjectFolders;
var lList:TStringlist;
lFolderPath: string;
i : integer;
begin
lList:=TStringlist.Create;
try
lList.Text := ReplaceEnvironmentVariables(PROJECT_STRUCTURE);
for i := 0 to pred(lList.Count) do
begin
lFolderPath := ProjectFolder + lList[i];
if not(DirectoryExists(lFolderPath)) then forceDirectories(lFolderPath);
end;
finally
freeandnil(lList);
end;
end;
Procedure OutputBundleFiles;
var lList:TStringList;
begin
lList := TStringList.Create;
try
if (not fileexists(ProjectFolder+GIT_IGNORE_FILE)) and
(not fileexists(ProjectFolder+HG_IGNORE_FILE )) then
begin
lList.Text := GIT_IGNORE;
lList.SaveToFile(ProjectFolder+GIT_IGNORE_FILE);
lList.Text := HG_IGNORE;
lList.SaveToFile(ProjectFolder+HG_IGNORE_FILE);
end;
if (not FileExists(ProjectFolder+START_PROJECT_NAME)) then
begin
lList.Text := ReplaceEnvironmentVariables(START_PROJECT,true);
lList.SaveToFile(ProjectFolder+START_PROJECT_NAME);
end;
finally
freeandnil(lList);
end;
end;
Procedure CheckBPLS;
var reg : TRegistry;
lBPLList : TStringlist;
lKnownBPLList : TStringlist;
lExpectedBPLPath, lBPLName, lknownBPLS : string;
i:integer;
begin
if (RegistryKey='') or
(not RTLCompatible(GetDelphiVersion, GetTargetVersion)) then exit;
reg := TRegistry.Create;
lKnownBPLList := TStringlist.Create;
lBPLList := TStringlist.Create;
try
reg.RootKey := HKEY_CURRENT_USER;
if not reg.KeyExists(RegistryKey) then exit;
lBPLList.Text := LowerCase(ListProjectBPLs);
if lBPLList.Count=0 then exit;
// There are BPLs to check
if not Reg.KeyExists(RegistryKey) then exit;
reg.OpenKey(RegistryKey,false);
reg.GetValueNames(lKnownBPLList);
lknownBPLS := LowerCase(lKnownBPLList.Text);
freeandnil(lKnownBPLList);
lExpectedBPLPath := '$(ActiveProject_BPL)\';
//now check that the expected Path is present in the registry
for i := 0 to pred(lBPLList.count) do
begin
lBPLName := lBPLList[i];
if pos(lowercase(lExpectedBPLPath+lBPLName),lknownBPLS)<1 then
begin
// not found. Is there a system alternate?
if pos('\'+lowercase(lBPLName)+#13#10,lknownBPLS)>0 then
begin
writeln(format(
'Warning: Component Library %s is installed outside the package', [lBPLName]));
end else
begin
reg.WriteString(lExpectedBPLPath+lBPLName,'Bundled Project Components');
end;
end;
end;
finally
freeandnil(reg);
freeandnil(lKnownBPLList);
freeandnil(lBPLList);
end;
end;
Procedure RemoveThisProject;
var lTargetFiles: TStringlist;
{$IFNDEF DEBUG}i:integer;{$ENDIF}
begin
// When this project is first run, it may not be able to remove
// all the files, but eventually it will.
lTargetFiles := TStringList.Create;
try
lTargetFiles.text := Listfiles(ProjectFolder+'checkbundle.*');
lTargetFiles.Add('ProjectBundles.pas');
lTargetFiles.Add('ProjectBundles.dcu');
{$IFNDEF DEBUG}
for i := 0 to lTargetFiles.Count-1 do
begin
deletefile(ProjectFolder+lTargetFiles[i]);
end;
{$ENDIF}
finally
freeandnil(lTargetFiles);
end;
end;
procedure UpdateBundle;
begin
SetEnvironmentVariablesByDelphiVersion(GetDelphiVersion);
SetProjectPath;
CreateProjectFolders;
OutputBundleFiles;
CheckBPLS;
RemoveThisProject;
end;
initialization
{$IFDEF VER80} DefaultDelphiVersion:=1; {$ENDIF}
{$IFDEF VER90} DefaultDelphiVersion:=2; {$ENDIF}
{$IFDEF VER100} DefaultDelphiVersion:=3; {$ENDIF}
{$IFDEF VER120} DefaultDelphiVersion:=4; {$ENDIF}
{$IFDEF VER130} DefaultDelphiVersion:=5; {$ENDIF}
{$IFDEF VER140} DefaultDelphiVersion:=6; {$ENDIF}
{$IFDEF VER150} DefaultDelphiVersion:=7; {$ENDIF}
{$IFDEF VER160} DefaultDelphiVersion:=8; {$ENDIF}
{$IFDEF VER170} DefaultDelphiVersion:=9; {$ENDIF}
{$IFDEF VER180} DefaultDelphiVersion:=10; {$ENDIF}
{$IFDEF VER180} DefaultDelphiVersion:=11; {$ENDIF}
{$IFDEF VER185} DefaultDelphiVersion:=11; {$ENDIF}
{$IFDEF VER200} DefaultDelphiVersion:=12; {$ENDIF}
{$IFDEF VER210} DefaultDelphiVersion:=14; {$ENDIF}
{$IFDEF VER220} DefaultDelphiVersion:=15; {$ENDIF}
{$IFDEF VER230} DefaultDelphiVersion:=16; {$ENDIF}
{$IFDEF VER240} DefaultDelphiVersion:=17; {$ENDIF}
{$IFDEF VER250} DefaultDelphiVersion:=18; {$ENDIF}
{$IFDEF VER260} DefaultDelphiVersion:=19; {$ENDIF}
{$IFDEF VER270} DefaultDelphiVersion:=20; {$ENDIF}
{$IFDEF VER280} DefaultDelphiVersion:=21; {$ENDIF}
{$IFDEF VER290} DefaultDelphiVersion:=22; {$ENDIF}
{$IFDEF VER300} DefaultDelphiVersion:=23; {$ENDIF}
{$IFDEF VER310} DefaultDelphiVersion:=24; {$ENDIF}
{$IFDEF VER320} DefaultDelphiVersion:=25; {$ENDIF}
end.
|
{
2Satisfiability Problem
DFS Method O(N3)
Input:
M: Number of clauses
N: Number of Xs
Pairs[I]: 1<=I<=M Literals of clause I, -x means ~x (not x)
Output:
Value[I]: Value of x[i] in a satisfiability condition
NoAnswer: System is not satisfiable
By Behdad
}
program
TwoSat;
const
MaxN = 100 + 2;
MaxM = 100 + 2;
var
M, N : Integer;
Pairs : array [1 .. MaxM, 1 .. 2] of Integer;
Value : array [1 .. MaxN] of Boolean;
NoAnswer : Boolean;
Mark, MarkBak: array [1 .. MaxN] of Boolean;
function DFS (V : Integer) : Boolean;
var
I, J : Integer;
begin
if Mark[Abs(V)] then
begin
DFS := Value[Abs(V)] xor (V < 0);
Exit;
end;
Mark [Abs(V)] := True;
Value[Abs(V)] := (V > 0);
for I := 1 to 2 do
for J := 1 to M do
if (Pairs[J, I] = -V) and not DFS(Pairs[J, 3 - I]) then
begin
DFS := False;
Exit;
end;
DFS := True;
end;
procedure TwoSatisfy;
var
I: Integer;
begin
FillChar(Mark,SizeOf(Mark),0);
MarkBak := Mark;
NoAnswer := False;
for I := 1 to N do
if not Mark[I] then
if not DFS(-I) then
begin
Mark := MarkBak;
if not DFS(I) then
begin
NoAnswer := True;
Break;
end;
end;
end;
begin
TwoSatisfy;
end.
|
{*******************************************************}
{ }
{ Delphi DBX Framework }
{ }
{ Copyright(c) 1995-2018 Embarcadero Technologies, Inc. }
{ All rights reserved }
{ }
{*******************************************************}
{$HPPEMIT LINKUNIT}
unit Data.DBXTrace;
interface
uses
{$IFDEF MSWINDOWS}
Winapi.Windows,
{$ENDIF}
Data.DBXCommon,
Data.DBXDelegate,
Data.DBXPlatform,
Data.FmtBcd,
Data.SqlTimSt,
Data.DBCommonTypes,
System.Classes,
System.Generics.Collections,
System.SyncObjs,
System.SysUtils
;
const
sDriverName = 'DBXTrace';
sConsoleOutput = ':con';
{$IFDEF MSWINDOWS}
sDebugStrOutput = ':dbgstr';
{$ENDIF}
type
TDBXTracePropertyNames = class
const
/// <remarks>Semicolon separate list of TDBXTraceFlagNames</remarks>
TraceFlags = 'TraceFlags'; { do not localize }
/// <remarks>Set to true to activate driver level tracing </remarks>
TraceDriver = 'TraceDriver'; { do not localize }
/// <remarks>Set to a file to send trace ouptput to. </remarks>
TraceFile = 'TraceFile'; { do not localize }
end;
TDBXTraceFlagNames = class
const
NONE = 'NONE'; { do not localize }
PREPARE = 'PREPARE'; { do not localize }
EXECUTE = 'EXECUTE'; { do not localize }
ERROR = 'ERROR'; { do not localize }
COMMAND = 'COMMAND'; { do not localize }
CONNECT = 'CONNECT'; { do not localize }
TRANSACT = 'TRANSACT'; { do not localize }
BLOB = 'BLOB'; { do not localize }
MISC = 'MISC'; { do not localize }
VENDOR = 'VENDOR'; { do not localize }
PARAMETER = 'PARAMETER'; { do not localize }
READER = 'READER'; { do not localize }
DRIVER_LOAD = 'DRIVER_LOAD'; { do not localize }
METADATA = 'METADATA'; { do not localize }
DRIVER = 'DRIVER'; { do not localize }
CUSTOM = 'CUSTOM'; { do not localize }
end;
TDBXTraceWriter = class
function IsSingleton: Boolean; virtual; abstract;
function WriteTrace(TraceInfo: TDBXTraceInfo): CBRType; virtual; abstract;
end;
TDBXConsoleTraceWriter = class(TDBXTraceWriter)
function IsSingleton: Boolean; override;
function WriteTrace(TraceInfo: TDBXTraceInfo): CBRType; override;
end;
TDBXTraceFormatter = class
private
FCommentStart: string;
FCommentEnd: string;
FMaxLineWidth: Integer;
constructor Create(CommentStart, CommentEnd: string; MaxLineWidth: Integer);
function Comment(CommentText: string): string; virtual; abstract;
function CommentValue(ResultName: string; Value: string): string; virtual; abstract;
function OpenComment(CommentText: string): string; virtual; abstract;
function CloseComment: string; virtual; abstract;
function GetProperty(ResultName, InstanceName, PropertyName: string): string; virtual; abstract;
function SetProperty(InstanceName, PropertyName: string;
Value: string): string; virtual; abstract;
function CallProcedure(InstanceName, MethodName: string): string; virtual; abstract;
function CallFunction(ResultName, InstanceName, MethodName: string): string; virtual; abstract;
function CallOpenProcedure(InstanceName, MethodName: string): string; virtual; abstract;
function CallOpenFunction(ResultName, InstanceName, MethodName: string): string; virtual; abstract;
function ArrayProperty(InstanceName: string; Ordinal: Integer): string; virtual; abstract;
function ParamString(Param: string; Separator: string): string; virtual; abstract;
function ParamWideString(Param: string; Separator: string): string; virtual; abstract;
function ParamBoolean(Param: Boolean; Separator: string): string; virtual; abstract;
function ParamUInt8(Param: Byte; Separator: string): string; virtual; abstract;
function ParamInt8(Param: ShortInt; Separator: string): string; virtual; abstract;
function ParamUInt16(Param: Word; Separator: string): string; virtual; abstract;
function ParamInt16(Param: SmallInt; Separator: string): string; virtual; abstract;
function ParamInt32(Param: TInt32; Separator: string): string; virtual; abstract;
function ParamInt64(Param: Int64; Separator: string): string; virtual; abstract;
function ParamDouble(Param: Double; Separator: string): string; virtual; abstract;
function ParamBcd(Param: TBcd; Separator: string): string; virtual; abstract;
function ParamDate(Param: TDBXDate; Separator: string): string; virtual; abstract;
function ParamTime(Param: TDBXTime; Separator: string): string; virtual; abstract;
function ParamTimeStamp(Param: TSqlTimeStamp; Separator: string): string; virtual; abstract;
function ParamTimeStampOffset(Param: TSqlTimeStampOffset;
Separator: string): string; virtual; abstract;
function ParamBytes(Param: array of Byte; Offset: Int64;
RequestedCount, Count: Int64; Separator: string): string; virtual; abstract;
function ColumnTypeToStr(ColumnType: TDBXType): string; virtual;
function CloseProcedure: string; virtual; abstract;
function CloseFunction: string; virtual; abstract;
function QuoteString(Value: string): string; virtual; abstract;
end;
TDBXTracePascalFormatter = class(TDBXTraceFormatter)
private
function Comment(CommentText: string): string; override;
function CommentValue(ResultName: string; Value: string): string; override;
function OpenComment(CommentText: string): string; override;
function CloseComment: string; override;
function GetProperty(ResultName, InstanceName, PropertyName: string): string; override;
function SetProperty(InstanceName, PropertyName: string;
Value: string): string; override;
function CallProcedure(InstanceName, MethodName: string): string; override;
function CallFunction(ResultName, InstanceName, MethodName: string): string; override;
function CallOpenProcedure(InstanceName, MethodName: string): string; override;
function CallOpenFunction(ResultName, InstanceName, MethodName: string): string; override;
function ArrayProperty(InstanceName: string; Ordinal: Integer): string; override;
function ParamString(Param: string; Separator: string): string; override;
function ParamWideString(Param: string; Separator: string): string; override;
function ParamBoolean(Param: Boolean; Separator: string): string; override;
function ParamUInt8(Param: Byte; Separator: string): string; override;
function ParamInt8(Param: ShortInt; Separator: string): string; override;
function ParamUInt16(Param: Word; Separator: string): string; override;
function ParamInt16(Param: SmallInt; Separator: string): string; override;
function ParamInt32(Param: TInt32; Separator: string): string; override;
function ParamInt64(Param: Int64; Separator: string): string; override;
function ParamDouble(Param: Double; Separator: string): string; override;
function ParamBcd(Param: TBcd; Separator: string): string; override;
function ParamDate(Param: TDBXDate; Separator: string): string; override;
function ParamTime(Param: TDBXTime; Separator: string): string; override;
function ParamTimeStamp(Param: TSqlTimeStamp; Separator: string): string; override;
function ParamTimeStampOffset(Param: TSqlTimeStampOffset;
Separator: string): string; override;
function ParamBytes(Param: array of Byte; Offset: Int64;
RequestedCount, Count: Int64; Separator: string): string; override;
function CloseProcedure: string; override;
function CloseFunction: string; override;
function QuoteString(Value: string): string; override;
end;
TDBXTraceOutput = class
private
FName: string;
FReferenceCount: TInt32;
FCriticalSection: TCriticalSection;
FFormatter: TDBXTraceFormatter;
procedure Open; virtual; abstract;
procedure WriteTraceln(Line: string); virtual; abstract;
function LogTrace(TraceInfo: TDBXTraceInfo): CBRType;
function LogDriverTrace(TraceInfo: TDBXTraceInfo): CBRType;
function TraceFlagToString(TraceFlag: TDBXTraceFlag): string;
procedure AddReference;
function RemoveReference: TInt32;
property Name: string read FName write FName;
property Formatter: TDBXTraceFormatter read FFormatter write FFormatter;
public
constructor Create;
destructor Destroy; override;
end;
{$IFDEF MSWINDOWS}
TDBXDebugStrTraceOutput = class(TDBXTraceOutput)
private
procedure Open; override;
procedure WriteTraceln(Line: string); override;
end;
{$ENDIF}
TDBXConsoleTraceOutput = class(TDBXTraceOutput)
private
procedure Open; override;
procedure WriteTraceln(Line: string); override;
end;
TDBXFileTraceOutput = class(TDBXTraceOutput)
private
FTraceFile: TextFile;
procedure Open; override;
procedure WriteTraceln(Line: string); override;
public
destructor Destroy; override;
end;
TDBXTraceDriver = class(TDBXDriver)
private
FConnectionCount: Int64;
FTraceOutputList: TDictionary<string, TDBXTraceOutput>;
function GetTraceOutput(Name: string): TDBXTraceOutput;
procedure AddTraceOutput(TraceOutput: TDBXTraceOutput);
procedure ReleaseTraceOutput(TraceOutput: TDBXTraceOutput);
procedure SetTraceFlags(TraceFlags: Integer);
function GetTraceFlags: Integer;
procedure SetTraceDriver(TraceDriver: Boolean);
function GetTraceDriver: Boolean;
procedure SetTraceFile(TraceFile: string);
function GetTraceFile: string;
protected
function GetDriverName: string; override;
procedure Close; override;
public
destructor Destroy; override;
constructor Create(DriverDef: TDBXDriverDef); override;
function CreateConnection(ConnectionBuilder: TDBXConnectionBuilder): TDBXConnection; override;
function GetDriverVersion: string; override;
property TraceFlags: Integer read GetTraceFlags write SetTraceFlags;
property TraceDriver: Boolean read GetTraceDriver write SetTraceDriver;
property TraceFile: string read GetTraceFile write SetTraceFile;
end;
TDBXTraceConnection = class(TDBXDelegateConnection)
private
[Weak]FFormatter: TDBXTraceFormatter;
FConnectionId: Int64;
FConnectionName: string;
FCommandCount: Int64;
FOriginalLogError: TDBXErrorEvent;
[Weak]FTraceDriver: TDBXTraceDriver;
[Weak]FTraceOutput: TDBXTraceOutput;
procedure Trace(TraceFlags: TDBXTraceFlag; Message: string);
protected
function CreateAndBeginTransaction(const Isolation: TDBXIsolation): TDBXTransaction; override;
procedure Commit(const Transaction: TDBXTransaction); override;
procedure Rollback(const Transaction: TDBXTransaction); override;
function GetDatabaseMetaData: TDBXDatabaseMetaData; override;
function GetConnectionProperties: TDBXProperties; override;
procedure SetConnectionProperties(const Value: TDBXProperties); override;
function GetTraceInfoEvent: TDBXTraceEvent; override;
procedure SetTraceInfoEvent(const TraceInfoEvent: TDBXTraceEvent); override;
function GetTraceFlags: TDBXTraceFlag; override;
procedure SetTraceFlags(const TraceFlags: TDBXTraceFlag); override;
function GetErrorEvent: TDBXErrorEvent; override;
procedure SetErrorEvent(const ErrorEvent: TDBXErrorEvent); override;
function GetDBXFormatter: TDBXFormatter; override;
procedure SetDBXFormatter(const DBXFormatter: TDBXFormatter); override;
function GetIsOpen: Boolean; override;
function DerivedCreateCommand: TDBXCommand; overload; override;
procedure DerivedOpen; override;
procedure DerivedGetCommandTypes(const List: TStrings); override;
procedure DerivedGetCommands(const CommandType: string;
const List: TStrings); override;
function CreateMorphCommand(MorphicCommand: TDBXCommand): TDBXCommand; override;
function GetProductVersion: string; override;
function GetProductName: string; override;
function GetConnectionProperty(const Name: string): string; override;
procedure LogError(DBXError: TDBXError);
function GetName: string;
public
constructor Create(ConnectionBuilder: TDBXConnectionBuilder;
TraceOutput: TDBXTraceOutput; DRIVER: TDBXTraceDriver;
Connection: TDBXConnection; ConnectionId: Int64);
destructor Destroy; override;
procedure Open; override;
procedure Close; override;
function BeginTransaction(Isolation: TDBXIsolation): TDBXTransaction; overload; override;
function BeginTransaction: TDBXTransaction; overload; override;
procedure CommitFreeAndNil(var Transaction: TDBXTransaction); override;
procedure RollbackFreeAndNil(var Transaction: TDBXTransaction); override;
procedure RollbackIncompleteFreeAndNil(var Transaction: TDBXTransaction); override;
function CreateCommand: TDBXCommand; override;
function GetVendorProperty(const Name: string): string; override;
end;
TDBXTraceCommand = class(TDBXDelegateCommand)
private
[Weak]FFormatter: TDBXTraceFormatter;
FReaderCount: Int64;
FConnectionId: Int64;
FCommandId: Int64;
FCommandName: string;
FParametersName: string;
procedure Trace(TraceFlags: TDBXTraceFlag; Message: string);
protected
procedure SetCommandType(const Value: string); override;
function GetCommandType: string; override;
function GetText: string; override;
procedure SetText(const Value: string); override;
procedure SetRowSetSize(const Value: Int64); override;
procedure SetMaxBlobSize(const MaxBlobSize: Int64); override;
function GetRowsAffected: Int64; override;
procedure SetCommandTimeout(const Timeout: Integer); override;
function GetCommandTimeout: Integer; override;
function GetErrorEvent: TDBXErrorEvent; override;
function CreateParameterRow: TDBXRow; override;
procedure CreateParameters(Command: TDBXCommand); override;
procedure Open; override;
function DerivedGetNextReader: TDBXReader; override;
procedure DerivedOpen; override;
procedure DerivedClose; override;
procedure DerivedPrepare; override;
function DerivedExecuteQuery: TDBXReader; override;
procedure DerivedExecuteUpdate; override;
procedure DerivedClearParameters; override;
function GetName: string;
public
constructor Create(Command: TDBXCommand; DBXContext: TDBXContext;
Formatter: TDBXTraceFormatter; ConnectionId: Int64; CommandId: Int64);
destructor Destroy; override;
function CreateParameter: TDBXParameter; override;
function GetParameters: TDBXParameterList; override;
procedure Prepare; override;
function ExecuteQuery: TDBXReader; override;
procedure ExecuteUpdate; override;
function GetNextReader: TDBXReader; override;
end;
TDBXTraceParameterList = class(TDBXDelegateParameterList)
strict protected
[Weak]FFormatter: TDBXTraceFormatter;
FParametersName: string;
FConnectionId: Int64;
FCommandId: Int64;
function GetName: string;
protected
function GetParameterByOrdinal(const Ordinal: TInt32): TDBXParameter; override;
function GetCount: TInt32; override;
public
constructor Create(Command: TDBXCommand; Parameters: TDBXParameterList;
DBXContext: TDBXContext; Formatter: TDBXTraceFormatter;
ParametersName: string; ConnectionId: Int64; CommandId: Int64);
procedure SetCount(const Count: TInt32); override;
procedure AddParameter(Parameter: TDBXParameter); override;
procedure SetParameter(const Ordinal: Integer;
const Parameter: TDBXParameter); override;
procedure InsertParameter(Ordinal: Integer; Parameter: TDBXParameter); override;
procedure RemoveParameter(Ordinal: Integer); overload; override;
procedure RemoveParameter(Parameter: TDBXParameter); overload; override;
procedure ClearParameters; overload; override;
procedure RemoveParameters; override;
function GetOrdinal(const Name: string): Integer; override;
end;
TDBXTraceWritableValue = class(TDBXDelegateWritableValue)
private
[Weak]FFormatter: TDBXTraceFormatter;
FValueName: string;
FValueDisplayName: string;
FLastOrdinal: TInt32;
function GetValueDisplayName: string;
protected
constructor Create(DBXContext: TDBXContext; ValueType: TDBXValueType;
Value: TDBXWritableValue; Formatter: TDBXTraceFormatter;
ValueName: string); overload;
function GetNonDelegate: TDBXValue; override;
function GetAsBoolean: Boolean; override;
function GetAsUInt8: Byte; override;
function GetAsInt8: ShortInt; override;
function GetAsUInt16: Word; override;
function GetAsInt16: SmallInt; override;
function GetAsInt32: TInt32; override;
function GetAsInt64: Int64; override;
function GetAsString: string; override;
function GetAsSingle: Single; override;
function GetAsDouble: Double; override;
function GetAsBcd: TBcd; override;
function GetAsDate: TDBXDate; override;
function GetAsTime: TDBXTime; override;
function GetAsTimeStamp: TSqlTimeStamp; override;
procedure SetPendingValue; override;
procedure SetAsBoolean(const Value: Boolean); override;
procedure SetAsUInt8(const Value: Byte); override;
procedure SetAsInt8(const Value: ShortInt); override;
procedure SetAsUInt16(const Value: Word); override;
procedure SetAsInt16(const Value: SmallInt); override;
procedure SetAsInt32(const Value: TInt32); override;
procedure SetAsInt64(const Value: Int64); override;
procedure SetAsString(const Value: string); override;
procedure SetAsSingle(const Value: Single); override;
procedure SetAsDouble(const Value: Double); override;
procedure SetAsBcd(const Value: TBcd); override;
procedure SetAsDate(const Value: TDBXDate); override;
procedure SetAsTime(const Value: TDBXTime); override;
procedure SetAsTimeStamp(const Value: TSqlTimeStamp); override;
public
function IsNull: Boolean; override;
function GetValueSize: Int64; override;
{$IFNDEF NEXTGEN}
function GetAnsiString: AnsiString; override;
{$ENDIF !NEXTGEN}
function GetDate: TDBXDate; override;
function GetBoolean: Boolean; overload; override;
function GetTime: TDBXTime; override;
function GetWideString: string; overload; override;
function GetString: string; overload; override;
function GetUInt8: Byte; overload; override;
function GetInt8: ShortInt; overload; override;
function GetUInt16: Word; overload; override;
function GetInt16: SmallInt; overload; override;
function GetInt32: TInt32; overload; override;
function GetInt64: Int64; overload; override;
function GetSingle: Single; override;
function GetDouble: Double; override;
function GetBytes(Offset: Int64; const Buffer: TArray<Byte>;
BufferOffset, Length: Int64): Int64; override;
function GetTimeStamp: TSqlTimeStamp; override;
function GetTimeStampOffset: TSqlTimeStampOffset; override;
function GetBcd: TBcd; override;
function GetDBXReader(AInstanceOwner: Boolean): TDBXReader; override;
function GetDBXConnection: TDBXConnection; override;
function GetStream(AInstanceOwner: Boolean): TStream; override;
function GetWideString(defaultValue: string): string; overload; override;
function GetBoolean(defaultValue: Boolean): Boolean; overload; override;
function GetUInt8(defaultValue: Byte): Byte; overload; override;
function GetInt8(defaultValue: ShortInt): ShortInt; overload; override;
function GetUInt16(defaultValue: Word): Word; overload; override;
function GetInt16(defaultValue: SmallInt): SmallInt; overload; override;
function GetInt32(defaultValue: TInt32): TInt32; overload; override;
function GetInt64(defaultValue: Int64): Int64; overload; override;
function EqualsValue(Other: TDBXValue): Boolean; override;
procedure SetNull; override;
procedure SetTimeStamp(const Value: TSqlTimeStamp); override;
procedure SetTimeStampOffset(const Value: TSqlTimeStampOffset); override;
procedure SetBcd(const Value: TBcd); override;
{$IFNDEF NEXTGEN}
procedure SetAnsiString(const Value: AnsiString); override;
{$ENDIF !NEXTGEN}
procedure SetBoolean(const Value: Boolean); override;
procedure SetDate(const Value: TDBXDate); override;
procedure SetTime(const Value: TDBXTime); override;
procedure SetWideString(const Value: string); override;
procedure SetString(const Value: string); override;
procedure SetUInt8(const Value: Byte); override;
procedure SetInt8(const Value: ShortInt); override;
procedure SetUInt16(const Value: Word); override;
procedure SetInt16(const Value: SmallInt); override;
procedure SetInt32(const Value: TInt32); override;
procedure SetInt64(const Value: Int64); override;
procedure SetSingle(const Value: Single); override;
procedure SetDouble(const Value: Double); override;
procedure SetStaticBytes(Offset: Int64; const Buffer: array of Byte;
BufferOffset: Int64; Length: Int64); override;
procedure SetDynamicBytes(Offset: Int64; const Buffer: TArray<Byte>;
BufferOffset: Int64; Length: Int64); override;
procedure SetDBXReader(const Value: TDBXReader;
const AInstanceOwner: Boolean); overload; override;
procedure SetStream(const Stream: TStream; const AInstanceOwner: Boolean); override;
procedure SetDBXConnection(const Value: TDBXConnection); override;
procedure SetValue(const Value: TDBXValue); override;
end;
TDBXTraceParameter = class(TDBXDelegateParameter)
private
FTraceValue: TDBXTraceWritableValue;
[Weak]FFormatter: TDBXTraceFormatter;
FParameterName: string;
protected
function GetValue: TDBXWritableValue; override;
public
constructor Create(DBXContext: TDBXContext; Parameter: TDBXParameter;
Formatter: TDBXTraceFormatter; ValueName: string);
destructor Destroy; override;
function Clone: TObject; override;
end;
TDBXTraceReader = class(TDBXDelegateReader)
private
[Weak]FFormatter: TDBXTraceFormatter;
FNextCount: Int64;
FConnectionId: Int64;
FCommandId: Int64;
FReaderId: Int64;
FReaderName: string;
FClosed: Boolean;
procedure PrintColumns;
public
constructor Create(DBXContext: TDBXContext; Reader: TDBXReader;
Formatter: TDBXTraceFormatter; ConnectionId: Int64; CommandId: Int64;
ReaderId: Int64);
destructor Destroy; override;
function Next: Boolean; override;
end;
TTraceFlag = (PARAMETER,ERROR,EXECUTE,COMMAND,CONNECT,TRANSACT,BLOB,MISC,VENDOR,READER,DRIVER_LOAD,METADATA);
TTraceFlags = set of TTraceFlag;
TDBXTraceProperties = class(TDBXProperties)
strict private
const
StrTraceFile = 'TraceFile';
const
StrTraceFlags = 'TraceFlags';
const
StrTraceDriver = 'TraceDriver';
function TraceFlagsToStr(Flags: TTraceFlags): string;
function StrtoTraceFlags(Value: string): TTraceFlags;
function GetTraceFile: string;
function GetTraceFlags: TTraceFlags;
function GetTraceDriver: Boolean;
procedure SetTraceFile(const Value: string);
procedure SetTraceFlags(const Value: TTraceFlags);
procedure SetTraceDriver(const Value: Boolean);
public
constructor Create(DBXContext: TDBXContext); override;
published
property TraceFile: string read GetTraceFile write SetTraceFile;
property TraceFlags: TTraceFlags read GetTraceFlags write SetTraceFlags;
property TraceDriver: Boolean read GetTraceDriver write SetTraceDriver;
end;
implementation
uses
System.TypInfo,
Data.DBXCommonResStrs,
System.Generics.Defaults;
type
TDBXAccessorCommand = class(TDBXCommand)
end;
{ TDBXTraceConnection }
function TDBXTraceConnection.BeginTransaction(
Isolation: TDBXIsolation): TDBXTransaction;
begin
Result := inherited BeginTransaction(Isolation);
if FDBXContext.IsTracing(TDBXTraceFlags.Transact) then
Trace(TDBXTraceFlags.Transact, FFormatter.CallProcedure(GetName, 'BeginTransaction'));
end;
function TDBXTraceConnection.BeginTransaction: TDBXTransaction;
begin
Result := inherited BeginTransaction;
if FDBXContext.IsTracing(TDBXTraceFlags.Transact) then
Trace(TDBXTraceFlags.Transact, FFormatter.CallProcedure(GetName, 'BeginTransaction'));
end;
procedure TDBXTraceConnection.Close;
begin
inherited;
if FDBXContext.IsTracing(TDBXTraceFlags.Connect) then
Trace(TDBXTraceFlags.Connect, FFormatter.CallProcedure(GetName, 'Close'));
end;
procedure TDBXTraceConnection.Commit(const Transaction: TDBXTransaction);
begin
inherited;
if FDBXContext.IsTracing(TDBXTraceFlags.Transact) then
Trace(TDBXTraceFlags.Transact, FFormatter.CallProcedure(GetName, 'Commit'));
end;
procedure TDBXTraceConnection.CommitFreeAndNil(
var Transaction: TDBXTransaction);
begin
inherited;
if FDBXContext.IsTracing(TDBXTraceFlags.Transact) then
Trace(TDBXTraceFlags.Transact, FFormatter.CallProcedure(GetName, 'CommitFreeAndNil'));
end;
constructor TDBXTraceConnection.Create(
ConnectionBuilder: TDBXConnectionBuilder;
TraceOutput: TDBXTraceOutput;
Driver: TDBXTraceDriver;
Connection: TDBXConnection;
ConnectionId: Int64);
begin
inherited Create(ConnectionBuilder, ConnectionBuilder.CreateDelegateeConnection);
if ConnectionBuilder.ConnectionProperties.GetBoolean(TDBXTracePropertyNames.TraceDriver) then
FConnection.OnTrace := TraceOutput.LogDriverTrace;
FTraceDriver := Driver;
FTraceOutput := TraceOutput;
FFormatter := TraceOutput.Formatter;
FConnectionId := ConnectionId;
FConnectionName := 'ConnectionC'+IntToStr(ConnectionId);
FOriginalLogError := FConnection.OnErrorEvent;
SetErrorEvent(LogError);
end;
function TDBXTraceConnection.CreateAndBeginTransaction(
const Isolation: TDBXIsolation): TDBXTransaction;
begin
Result := inherited CreateAndBeginTransaction(Isolation);
if FDBXContext.IsTracing(TDBXTraceFlags.Transact) then
Trace(TDBXTraceFlags.Transact, FFormatter.CallProcedure(GetName, 'CreateAndBeginTransaction'));
end;
function TDBXTraceConnection.CreateCommand: TDBXCommand;
var
Command: TDBXTraceCommand;
begin
Inc(FCommandCount);
Command := TDBXTraceCommand.Create(inherited CreateCommand, FDBXContext, FFormatter, FConnectionId, FCommandCount);
if FDBXContext.IsTracing(TDBXTraceFlags.Command) then
Trace(TDBXTraceFlags.Command,
FFormatter.CallFunction(Command.GetName, GetName, 'CreateCommand'));
Result := Command;
end;
function TDBXTraceConnection.CreateMorphCommand(
MorphicCommand: TDBXCommand): TDBXCommand;
begin
Result := inherited CreateMorphCommand(MorphicCommand);
if FDBXContext.IsTracing(TDBXTraceFlags.Command) then
Trace(TDBXTraceFlags.Command, FFormatter.CallProcedure(GetName, 'CreateMorphCommand'));
end;
function TDBXTraceConnection.DerivedCreateCommand: TDBXCommand;
begin
Result := inherited DerivedCreateCommand;
if FDBXContext.IsTracing(TDBXTraceFlags.Command) then
Trace(TDBXTraceFlags.Command, FFormatter.CallProcedure(GetName, 'DerivedCreateCommand'));
end;
procedure TDBXTraceConnection.DerivedGetCommands(const CommandType: string;
const List: TStrings);
begin
inherited;
if FDBXContext.IsTracing(TDBXTraceFlags.Command) then
Trace(TDBXTraceFlags.Command, FFormatter.CallProcedure(GetName, 'DerivedGetCommands'));
end;
procedure TDBXTraceConnection.DerivedGetCommandTypes(const List: TStrings);
begin
inherited;
if FDBXContext.IsTracing(TDBXTraceFlags.Command) then
Trace(TDBXTraceFlags.Command, FFormatter.CallProcedure(GetName, 'DerivedGetCommandTypes'));
end;
procedure TDBXTraceConnection.DerivedOpen;
begin
inherited;
if FDBXContext.IsTracing(TDBXTraceFlags.Connect) then
Trace(TDBXTraceFlags.Connect, FFormatter.CallProcedure(GetName, 'DerivedOpen'));
end;
destructor TDBXTraceConnection.Destroy;
begin
if IsOpen then
Close;
if Assigned(FDBXContext) and (FDBXContext.IsTracing(TDBXTraceFlags.Connect)) then
Trace(TDBXTraceFlags.Connect, FFormatter.CallOpenProcedure('', 'FreeAndNil')
+ GetName + FFormatter.CloseProcedure);
if (FTraceDriver <> nil) then
FTraceDriver.ReleaseTraceOutput(FTraceOutput);
FTraceOutput := nil;
inherited;
end;
procedure TDBXTraceConnection.Open;
begin
inherited;
if FDBXContext.IsTracing(TDBXTraceFlags.Connect) then
Trace(TDBXTraceFlags.Connect, FFormatter.CallProcedure(GetName, 'Open'));
end;
procedure TDBXTraceConnection.Rollback(const Transaction: TDBXTransaction);
begin
inherited;
if FDBXContext.IsTracing(TDBXTraceFlags.Transact) then
Trace(TDBXTraceFlags.Transact, FFormatter.CallProcedure(GetName, 'Rollback'));
end;
procedure TDBXTraceConnection.RollbackFreeAndNil(
var Transaction: TDBXTransaction);
begin
inherited;
if FDBXContext.IsTracing(TDBXTraceFlags.Transact) then
Trace(TDBXTraceFlags.Transact, FFormatter.CallProcedure(GetName, 'RollbackFreeAndNil'));
end;
procedure TDBXTraceConnection.RollbackIncompleteFreeAndNil(
var Transaction: TDBXTransaction);
begin
inherited;
if FDBXContext.IsTracing(TDBXTraceFlags.Transact) then
Trace(TDBXTraceFlags.Transact, FFormatter.CallProcedure(GetName, 'RollbackIncompleteFreeAndNil'));
end;
function TDBXTraceConnection.GetName: string;
begin
Result := FConnectionName;
end;
function TDBXTraceConnection.GetProductName: string;
begin
Result := inherited GetProductName;
if FDBXContext.IsTracing(TDBXTraceFlags.MetaData) then
Trace(TDBXTraceFlags.MetaData, FFormatter.CallProcedure(GetName, 'GetProductName'));
end;
function TDBXTraceConnection.GetProductVersion: string;
begin
Result := inherited GetProductVersion;
if FDBXContext.IsTracing(TDBXTraceFlags.MetaData) then
Trace(TDBXTraceFlags.MetaData, FFormatter.CallProcedure(GetName, 'GetProductVersion'));
end;
function TDBXTraceConnection.GetConnectionProperties: TDBXProperties;
begin
Result := inherited GetConnectionProperties;
if FDBXContext.IsTracing(TDBXTraceFlags.Connect) then
Trace(TDBXTraceFlags.Connect, FFormatter.CallProcedure(GetName, 'GetConnectionProperties'));
end;
function TDBXTraceConnection.GetConnectionProperty(
const Name: string): string;
begin
Result := inherited GetConnectionProperty(Name);
if FDBXContext.IsTracing(TDBXTraceFlags.Connect) then
Trace(TDBXTraceFlags.Connect, FFormatter.CallProcedure(GetName, 'GetConnectionProperty'));
end;
function TDBXTraceConnection.GetDatabaseMetaData: TDBXDatabaseMetaData;
begin
Result := inherited GetDatabaseMetaData;
if FDBXContext.IsTracing(TDBXTraceFlags.MetaData) then
Trace(TDBXTraceFlags.MetaData, FFormatter.CallProcedure(GetName, 'GetDatabaseMetaData'));
end;
function TDBXTraceConnection.GetDBXFormatter: TDBXFormatter;
begin
Result := inherited GetDBXFormatter;
end;
function TDBXTraceConnection.GetErrorEvent: TDBXErrorEvent;
begin
Result := inherited GetErrorEvent;
end;
function TDBXTraceConnection.GetIsOpen: Boolean;
begin
Result := inherited GetIsOpen;
if FDBXContext.IsTracing(TDBXTraceFlags.Connect) and Assigned(FTraceOutput) then
Trace(TDBXTraceFlags.Connect, FFormatter.CallProcedure(GetName, 'GetIsOpen'));
end;
procedure TDBXTraceConnection.SetConnectionProperties(
const Value: TDBXProperties);
begin
inherited;
if FDBXContext.IsTracing(TDBXTraceFlags.Connect) then
Trace(TDBXTraceFlags.Connect, FFormatter.CallProcedure(GetName, 'SetConnectionProperties'));
end;
function TDBXTraceConnection.GetTraceFlags: TDBXTraceFlag;
begin
Result := inherited GetTraceFlags;
end;
procedure TDBXTraceConnection.SetDBXFormatter(
const DBXFormatter: TDBXFormatter);
begin
inherited;
if Assigned(FDBXContext) then
FDBXContext.DBXFormatter := DBXFormatter;
end;
procedure TDBXTraceConnection.SetErrorEvent(const ErrorEvent: TDBXErrorEvent);
begin
inherited;
if Assigned(FDBXContext) then
FDBXContext.OnError := ErrorEvent;
end;
function TDBXTraceConnection.GetTraceInfoEvent: TDBXTraceEvent;
begin
Result := inherited GetTraceInfoEvent;
end;
function TDBXTraceConnection.GetVendorProperty(
const Name: string): string;
begin
Result := inherited GetVendorProperty(Name);
if FDBXContext.IsTracing(TDBXTraceFlags.Driver) then
Trace(TDBXTraceFlags.Driver, FFormatter.CallProcedure(GetName, 'GetVendorProperty'));
end;
procedure TDBXTraceConnection.LogError(DBXError: TDBXError);
var
ErrorMessage: string;
begin
if FDBXContext.IsTracing(TDBXTraceFlags.Error) then
begin
ErrorMessage := FFormatter.Comment( TDBXError.ErrorCodeToString(DBXError.ErrorCode)
+ ' ' + DBXError.Message);
FDBXContext.Trace(TDBXTraceFlags.Error, ErrorMessage);
if Assigned(FOriginalLogError) then
FOriginalLogError(DBXError);
end;
end;
procedure TDBXTraceConnection.SetTraceFlags(const TraceFlags: TDBXTraceFlag);
begin
inherited;
if Assigned(FDBXContext) then
FDBXContext.TraceFlags := TraceFlags;
end;
procedure TDBXTraceConnection.SetTraceInfoEvent(
const TraceInfoEvent: TDBXTraceEvent);
begin
inherited;
if Assigned(FDBXContext) then
FDBXContext.OnTrace := TraceInfoEvent;
end;
procedure TDBXTraceConnection.Trace(TraceFlags: TDBXTraceFlag;
Message: string);
begin
FDBXContext.Trace(TraceFlags, Message);
end;
{ TDBXTraceCommand }
constructor TDBXTraceCommand.Create(Command: TDBXCommand; DBXContext: TDBXContext; Formatter: TDBXTraceFormatter; ConnectionId: Int64; CommandId: Int64);
begin
inherited Create(DBXContext, Command);
FFormatter := Formatter;
FConnectionId := ConnectionId;
FCommandId := CommandId;
FCommandName := 'CommandC'+IntToStr(ConnectionId)+'_'+IntToStr(CommandId);
FParametersName := FCommandName+'.Parameters';
end;
function TDBXTraceCommand.CreateParameter: TDBXParameter;
begin
Result := TDBXTraceParameter.Create(FDBXContext, FCommand.CreateParameter, FFormatter, FParametersName);
end;
function TDBXTraceCommand.CreateParameterRow: TDBXRow;
begin
Result := inherited CreateParameterRow;
end;
procedure TDBXTraceCommand.CreateParameters(Command: TDBXCommand);
begin
if FDBXContext.IsTracing(TDBXTraceFlags.Parameter) then
Trace(TDBXTraceFlags.Parameter,
FFormatter.CallProcedure(GetName, 'CreateParameters'));
inherited;
end;
procedure TDBXTraceCommand.DerivedClearParameters;
begin
if FDBXContext.IsTracing(TDBXTraceFlags.Command) then
Trace(TDBXTraceFlags.Command, FFormatter.CallProcedure(GetName, 'DerivedClearParameters'));
inherited;
end;
procedure TDBXTraceCommand.DerivedClose;
begin
if FDBXContext.IsTracing(TDBXTraceFlags.Command) then
Trace(TDBXTraceFlags.Command, FFormatter.CallProcedure(GetName, 'DerivedClose'));
inherited;
end;
function TDBXTraceCommand.DerivedExecuteQuery: TDBXReader;
begin
if FDBXContext.IsTracing(TDBXTraceFlags.Execute) then
Trace(TDBXTraceFlags.Execute, FFormatter.CallFunction('Reader', GetName, 'DerivedExecuteQuery'));
Result := inherited DerivedExecuteQuery;
end;
procedure TDBXTraceCommand.DerivedExecuteUpdate;
begin
if FDBXContext.IsTracing(TDBXTraceFlags.Execute) then
Trace(TDBXTraceFlags.Execute, FFormatter.CallProcedure(GetName, 'DerivedExecuteUpdate'));
inherited;
end;
function TDBXTraceCommand.DerivedGetNextReader: TDBXReader;
begin
if FDBXContext.IsTracing(TDBXTraceFlags.Reader) then
Trace(TDBXTraceFlags.Reader, FFormatter.CallFunction('Reader', GetName, 'DerivedGetNextReader'));
Result := inherited DerivedGetNextReader;
end;
procedure TDBXTraceCommand.DerivedOpen;
begin
if FDBXContext.IsTracing(TDBXTraceFlags.Command) then
Trace(TDBXTraceFlags.Command, FFormatter.CallProcedure(GetName, 'DerivedOpen'));
inherited;
end;
procedure TDBXTraceCommand.DerivedPrepare;
begin
if FDBXContext.IsTracing(TDBXTraceFlags.Prepare) then
Trace(TDBXTraceFlags.Prepare, FFormatter.CallProcedure(GetName, 'DerivedPrepare'));
inherited;
end;
destructor TDBXTraceCommand.Destroy;
begin
if FDBXContext.IsTracing(TDBXTraceFlags.Command) then
Trace(TDBXTraceFlags.Command, FFormatter.CallOpenProcedure('', 'FreeAndNil')
+ GetName + FFormatter.CloseProcedure);
inherited;
end;
function TDBXTraceCommand.ExecuteQuery: TDBXReader;
var
ReaderName: string;
begin
Inc(FReaderCount);
if FDBXContext.IsTracing(TDBXTraceFlags.Execute) then
begin
ReaderName := 'ReaderC'+IntToStr(FConnectionId)+'_'+IntToStr(FCommandId)+'_'+IntToStr(FReaderCount);
Trace(TDBXTraceFlags.Command,
FFormatter.CallFunction(ReaderName, GetName, 'ExecuteQuery'));
end;
Result := inherited ExecuteQuery;
if (Result <> nil) and FDBXContext.IsTracing(TDBXTraceFlags.Reader) then
begin
Result := TDBXTraceReader.Create(FDBXContext, Result, FFormatter, FConnectionId, FCommandId, FreaderCount);
end;
end;
procedure TDBXTraceCommand.ExecuteUpdate;
begin
if FDBXContext.IsTracing(TDBXTraceFlags.Execute) then
Trace(TDBXTraceFlags.Execute, FFormatter.CallProcedure(GetName, 'ExecuteUpdate'));
inherited ExecuteUpdate;
end;
function TDBXTraceCommand.GetRowsAffected: Int64;
var
ResultName: string;
begin
if FDBXContext.IsTracing(TDBXTraceFlags.Execute) then
begin
ResultName := 'RowsAffectedC'+IntToStr(FConnectionId)+'_'+IntToStr(FCommandId);
Trace(TDBXTraceFlags.Execute, FFormatter.GetProperty(ResultName, GetName, 'RowsAffected'));
end;
Result := inherited GetRowsAffected;
if FDBXContext.IsTracing(TDBXTraceFlags.Execute) then
begin
Trace(TDBXTraceFlags.Execute, FFormatter.Comment(ResultName+' = '+IntToStr(Result)));
end;
end;
function TDBXTraceCommand.GetText: string;
begin
Result := inherited GetText;
end;
function TDBXTraceCommand.GetCommandTimeout: Integer;
begin
Result := inherited GetCommandTimeout;
end;
function TDBXTraceCommand.GetCommandType: string;
begin
Result := inherited GetCommandType;
end;
function TDBXTraceCommand.GetErrorEvent: TDBXErrorEvent;
begin
Result := inherited GetErrorEvent;
end;
procedure TDBXTraceCommand.Open;
begin
if FDBXContext.IsTracing(TDBXTraceFlags.Command) then
Trace(TDBXTraceFlags.Command, FFormatter.CallProcedure(GetName, 'Open'));
inherited;
end;
function TDBXTraceCommand.GetName: string;
begin
Result := FCommandName;
end;
function TDBXTraceCommand.GetNextReader: TDBXReader;
begin
Result := inherited GetNextReader;
end;
function TDBXTraceCommand.GetParameters: TDBXParameterList;
begin
if FParameters = nil then
FParameters := TDBXTraceParameterList.Create(Self, FCommand.Parameters, FDBXContext, FFormatter, FCommandName, FConnectionId, FCommandId);
Result := FParameters;
end;
procedure TDBXTraceCommand.Prepare;
begin
if FDBXContext.IsTracing(TDBXTraceFlags.Prepare) then
Trace(TDBXTraceFlags.Prepare, FFormatter.CallProcedure(GetName, 'Prepare'));
inherited;
end;
procedure TDBXTraceCommand.SetMaxBlobSize(const MaxBlobSize: Int64);
begin
if FDBXContext.IsTracing(TDBXTraceFlags.Command) then
Trace(TDBXTraceFlags.Command,
FFormatter.SetProperty(GetName, 'MaxBlobsize', FFormatter.ParamInt64(MaxBlobSize, '')));
inherited;
end;
procedure TDBXTraceCommand.SetRowSetSize(const Value: Int64);
begin
if FDBXContext.IsTracing(TDBXTraceFlags.Command) then
Trace(TDBXTraceFlags.Command,
FFormatter.SetProperty(GetName, 'RowSetSize', FFormatter.ParamInt64(Value, '')));
inherited;
end;
procedure TDBXTraceCommand.SetCommandTimeout(const Timeout: Integer);
begin
if FDBXContext.IsTracing(TDBXTraceFlags.Command) then
Trace(TDBXTraceFlags.Command,
FFormatter.SetProperty(GetName, 'CommandTimeout', FFormatter.ParamInt32(Timeout, '')));
inherited;
end;
procedure TDBXTraceCommand.SetCommandType(const Value: string);
begin
if FDBXContext.IsTracing(TDBXTraceFlags.Command) then
Trace(TDBXTraceFlags.Command,
FFormatter.SetProperty(GetName, 'CommandType', FFormatter.QuoteString(Value)));
inherited;
end;
procedure TDBXTraceCommand.SetText(const Value: string);
begin
if FDBXContext.IsTracing(TDBXTraceFlags.Command) then
Trace(TDBXTraceFlags.Command,
FFormatter.SetProperty(GetName, 'Text', FFormatter.QuoteString(Value)));
inherited;
end;
procedure TDBXTraceCommand.Trace(TraceFlags: TDBXTraceFlag;
Message: string);
begin
FDBXContext.Trace(TraceFlags, Message);
end;
{ TDBXTraceDriver }
procedure TDBXTraceDriver.AddTraceOutput(TraceOutput: TDBXTraceOutput);
begin
FTraceOutputList.Add(TraceOutput.Name, TraceOutput);
end;
procedure TDBXTraceDriver.Close;
begin
inherited;
end;
constructor TDBXTraceDriver.Create(DriverDef: TDBXDriverDef);
begin
inherited Create(DriverDef);
InitDriverProperties(TDBXTraceProperties.Create(DriverDef.FDBXContext));
FTraceOutputList := TObjectDictionary<string, TDBXTraceOutput>.Create([doOwnsValues], TIStringComparer.Ordinal);
end;
function TDBXTraceDriver.CreateConnection(ConnectionBuilder: TDBXConnectionBuilder): TDBXConnection;
var
Connection: TDBXTraceConnection;
DBXContext: TDBXContext;
Properties: TDBXProperties;
TraceFlagList: TStringList;
TraceFlagsProperty: string;
TraceFlagsString: string;
Index: Integer;
TraceFlags: TDBXTraceFlag;
TraceFileName: string;
NeedsOnTraceEvent: Boolean;
TraceOutput: TDBXTraceOutput;
Complete: Boolean;
LTraceName: string;
begin
DBXContext := ConnectionBuilder.DBXContext;
Properties := ConnectionBuilder.ConnectionProperties;
TraceFlagsProperty := Properties.GetRequiredValue(TDBXTracePropertyNames.TraceFlags);
TraceFlags := 0;
if TraceFlagsProperty <> TDBXTraceFlagNames.NONE then
begin
TraceFlagList := TStringList.Create;
try
TraceFlagList.Delimiter := ';';
TraceFlagList.DelimitedText := TraceFlagsProperty;
for Index := 0 to TraceFlagList.Count - 1 do
begin
TraceFlagsString := TraceFlagList[Index];
if TraceFlagsString = TDBXTraceFlagNames.PREPARE then
TraceFlags := TraceFlags or TDBXTraceFlags.Prepare
else if TraceFlagsString = TDBXTraceFlagNames.EXECUTE then
TraceFlags := TraceFlags or TDBXTraceFlags.Execute
else if TraceFlagsString = TDBXTraceFlagNames.ERROR then
TraceFlags := TraceFlags or TDBXTraceFlags.Error
else if TraceFlagsString = TDBXTraceFlagNames.COMMAND then
TraceFlags := TraceFlags or TDBXTraceFlags.Command
else if TraceFlagsString = TDBXTraceFlagNames.CONNECT then
TraceFlags := TraceFlags or TDBXTraceFlags.Connect
else if TraceFlagsString = TDBXTraceFlagNames.TRANSACT then
TraceFlags := TraceFlags or TDBXTraceFlags.Transact
else if TraceFlagsString = TDBXTraceFlagNames.BLOB then
TraceFlags := TraceFlags or TDBXTraceFlags.Blob
else if TraceFlagsString = TDBXTraceFlagNames.MISC then
TraceFlags := TraceFlags or TDBXTraceFlags.Misc
else if TraceFlagsString = TDBXTraceFlagNames.VENDOR then
TraceFlags := TraceFlags or TDBXTraceFlags.Vendor
else if TraceFlagsString = TDBXTraceFlagNames.PARAMETER then
TraceFlags := TraceFlags or TDBXTraceFlags.Parameter
else if TraceFlagsString = TDBXTraceFlagNames.READER then
TraceFlags := TraceFlags or TDBXTraceFlags.Reader
else if TraceFlagsString = TDBXTraceFlagNames.DRIVER_LOAD then
TraceFlags := TraceFlags or TDBXTraceFlags.DriverLoad
else if TraceFlagsString = TDBXTraceFlagNames.METADATA then
TraceFlags := TraceFlags or TDBXTraceFlags.MetaData
else if TraceFlagsString = TDBXTraceFlagNames.CUSTOM then
TraceFlags := TraceFlags or TDBXTraceFlags.Custom
else
DBXContext.Error(TDBXErrorCodes.InvalidParameter,
Format(SINVALID_TRACE_FLAG,
[ TraceFlagsString, TDBXTracePropertyNames.TraceFlags,
TDBXTraceFlagNames.NONE,
TDBXTraceFlagNames.PARAMETER,
TDBXTraceFlagNames.EXECUTE,
TDBXTraceFlagNames.ERROR,
TDBXTraceFlagNames.COMMAND,
TDBXTraceFlagNames.CONNECT,
TDBXTraceFlagNames.TRANSACT,
TDBXTraceFlagNames.BLOB,
TDBXTraceFlagNames.MISC,
TDBXTraceFlagNames.VENDOR,
TDBXTraceFlagNames.READER,
TDBXTraceFlagNames.DRIVER_LOAD,
TDBXTraceFlagNames.METADATA
]));
end;
finally
FreeAndNil(TraceFlagList);
end;
end;
{$IFDEF MSWINDOWS}
if not IsConsole then
LTraceName := sDebugStrOutput // Invalid file name.
else
LTraceName := sConsoleOutput; // Invalid file name.
{$ELSE}
LTraceName := sConsoleOutput; // Invalid file name.
{$ENDIF}
TraceFileName := Properties[TDBXTracePropertyNames.TraceFile];
if TraceFileName = '' then
TraceFileName := LTraceName;
TraceOutput := GetTraceOutput(TraceFileName);
if TraceOutput = nil then
begin
{$IFDEF MSWINDOWS}
if TraceFileName = LTraceName then
TraceOutput := TDBXDebugStrTraceOutput.Create;
{$ENDIF}
if TraceFileName = sConsoleOutput then
TraceOutput := TDBXConsoleTraceOutput.Create
else if TraceOutput = nil then
TraceOutput := TDBXFileTraceOutput.Create;
Complete := false;
try
TraceOutput.Name := TraceFileName;
TraceOutput.Open;
TraceOutput.AddReference;
Complete := true;
finally
if not Complete then
FreeAndNil(TraceOutput);
end;
AddTraceOutput(TraceOutput);
end
else
TraceOutput.AddReference;
DBXContext.TraceFlags := DBXContext.TraceFlags or TraceFlags;
if Assigned(DBXContext.OnTrace) then
NeedsOnTraceEvent := false
else
begin
DBXContext.OnTrace := TraceOutput.LogTrace;
NeedsOnTraceEvent := true;
end;
Complete := false;
try
Inc(FConnectionCount);
Connection := TDBXTraceConnection.Create(ConnectionBuilder, TraceOutput, Self, nil, FConnectionCount);
Result := Connection;
Complete := true;
finally
if not Complete then
ReleaseTraceOutput(TraceOutput);
if NeedsOnTraceEvent then
DBXContext.OnTrace := nil;
end;
end;
destructor TDBXTraceDriver.Destroy;
begin
FTraceOutputList.Free;
inherited;
end;
function TDBXTraceDriver.GetDriverName: string;
begin
Result := 'DBXTrace'; {Do not localize}
end;
function TDBXTraceDriver.GetDriverVersion: string;
begin
Result := 'DBXTraceDriver 1.0'; {Do not localize}
end;
function TDBXTraceDriver.GetTraceDriver: Boolean;
begin
Result := DriverProperties.GetBoolean(TDBXTracePropertyNames.TraceDriver);
end;
function TDBXTraceDriver.GetTraceFile: string;
begin
Result := DriverProperties[TDBXTracePropertyNames.TraceFile];
end;
function TDBXTraceDriver.GetTraceFlags: Integer;
begin
Result := DriverProperties.GetInteger(TDBXTracePropertyNames.TraceFlags);
end;
function TDBXTraceDriver.GetTraceOutput(Name: string): TDBXTraceOutput;
begin
if FTraceOutputList.ContainsKey(Name) then
Result := FTraceOutputList.Items[Name]
else
Result := nil;
end;
procedure TDBXTraceDriver.ReleaseTraceOutput(TraceOutput: TDBXTraceOutput);
begin
if TraceOutput = GetTraceOutput(TraceOutput.Name) then
begin
if TraceOutput.RemoveReference < 1 then
FTraceOutputList.Remove(TraceOutput.Name);
end;
end;
procedure TDBXTraceDriver.SetTraceDriver(TraceDriver: Boolean);
begin
DriverProperties[TDBXTracePropertyNames.TraceDriver] := BoolToStr(TraceDriver, True);
end;
procedure TDBXTraceDriver.SetTraceFile(TraceFile: string);
begin
DriverProperties[TDBXTracePropertyNames.TraceFile] := TraceFile;
end;
procedure TDBXTraceDriver.SetTraceFlags(TraceFlags: Integer);
begin
DriverProperties[TDBXTracePropertyNames.TraceFlags] := IntToStr(TraceFlags);
end;
{ TDBXTraceFormatter }
function TDBXTraceFormatter.ColumnTypeToStr(ColumnType: TDBXType): string;
begin
Result := TDBXValueType.DataTypeName(ColumnType);
end;
constructor TDBXTraceFormatter.Create(CommentStart, CommentEnd: string;
MaxLineWidth: Integer);
begin
inherited Create;
FCommentStart := CommentStart;
FCommentEnd := CommentEnd;
FMaxLineWidth := MaxLineWidth;
end;
{ TDBXTracePascalFormatter }
function TDBXTracePascalFormatter.ArrayProperty(InstanceName: string;
Ordinal: Integer): string;
begin
Result := InstanceName + '[' + IntToStr(Ordinal) + ']';
end;
function TDBXTracePascalFormatter.CallFunction(ResultName, InstanceName,
MethodName: string): string;
begin
if InstanceName = '' then
Result := ResultName + ' := ' + MethodName + ';'
else
Result := ResultName + ' := ' + InstanceName + '.' + MethodName + ';';
end;
function TDBXTracePascalFormatter.CallOpenFunction(ResultName, InstanceName,
MethodName: string): string;
begin
if InstanceName = '' then
Result := ResultName + ' := ' + MethodName + '('
else
Result := ResultName + ' := ' + InstanceName + '.' + MethodName + '(';
end;
function TDBXTracePascalFormatter.CallOpenProcedure(InstanceName,
MethodName: string): string;
begin
if InstanceName = '' then
Result := MethodName + '('
else
Result := InstanceName + '.' + MethodName + '(';
end;
function TDBXTracePascalFormatter.CallProcedure(InstanceName,
MethodName: string): string;
begin
if InstanceName = '' then
Result := MethodName + ';'
else
Result := InstanceName + '.' + MethodName + ';';
end;
function TDBXTracePascalFormatter.CloseComment: string;
begin
Result := FCommentEnd;
end;
function TDBXTracePascalFormatter.CloseFunction: string;
begin
Result := ');';
end;
function TDBXTracePascalFormatter.CloseProcedure: string;
begin
Result := ');';
end;
function TDBXTracePascalFormatter.Comment(CommentText: string): string;
begin
Result := FCommentStart + CommentText + FCommentEnd;
end;
function TDBXTracePascalFormatter.CommentValue(ResultName,
Value: string): string;
begin
Result := FCommentStart + ResultName + ' = ' + Value + FCommentEnd;
end;
function TDBXTracePascalFormatter.GetProperty(ResultName, InstanceName,
PropertyName: string): string;
begin
Result := ResultName + ' := ' + InstanceName + '.' + PropertyName;
end;
function TDBXTracePascalFormatter.OpenComment(CommentText: string): string;
begin
Result := FCommentEnd;
end;
function TDBXTracePascalFormatter.ParamBcd(Param: TBcd;
Separator: string): string;
begin
// When setting output params, a nil'd out value is sent
// that cannot be converted to a string.
//
if Param.Precision = 0 then
Result := 'StrToBcd('''+'0'+''')' + Separator
else
Result := 'StrToBcd('''+BcdToStr(Param)+''')' + Separator;
end;
function TDBXTracePascalFormatter.ParamBoolean(Param: Boolean;
Separator: string): string;
begin
Result := BoolToStr(Param, true) + Separator;
end;
const
Hex = '0123456789ABCDEF';
function TDBXTracePascalFormatter.ParamBytes(Param: array of Byte; Offset,
RequestedCount, Count: Int64; Separator: string): string;
var
Buffer: TDBXWideChars;
BufIndex, HexIndex, Index: Integer;
Ch: Byte;
begin
if Count < 1 then
SetLength(Buffer, 4+2)
else
SetLength(Buffer, Count*4+2);
Buffer[1] := '[';
BufIndex := 2;
for Index := Offset to High(Param) do
begin
Ch := Param[Index];
Buffer[BufIndex] := '$';
Inc(BufIndex);
HexIndex := Ch shr 4;
if HexIndex = 0 then
Buffer[BufIndex] := Char(Hex[(Ch shr 4)+1]);
Buffer[BufIndex] := Char(Hex[(Ch shr 4)+1]);
Inc(BufIndex);
Buffer[BufIndex] := Char(Hex[(Ch and $F)+1]);
Inc(BufIndex);
Buffer[BufIndex] := ',';
Inc(BufIndex);
end;
Buffer[BufIndex-1] := ']';
Result := TDBXPlatform.CreateWideString(Buffer, BufIndex) + Separator;
end;
function TDBXTracePascalFormatter.ParamDate(Param: TDBXDate;
Separator: string): string;
var
TimeStamp: TTimeStamp;
begin
TimeStamp.Date := Param;
TimeStamp.Time := 0;
Result := IntToStr(Param) + FCommentStart+DateToStr(TimeStampToDateTime(TimeStamp))+FCommentEnd + Separator;
end;
function TDBXTracePascalFormatter.ParamDouble(Param: Double;
Separator: string): string;
begin
Result := FloatToStr(Param) + Separator;
end;
function TDBXTracePascalFormatter.ParamInt16(Param: SmallInt;
Separator: string): string;
begin
Result := IntToStr(Param) + Separator;
end;
function TDBXTracePascalFormatter.ParamInt32(Param: TInt32;
Separator: string): string;
begin
Result := IntToStr(Param) + Separator;
end;
function TDBXTracePascalFormatter.ParamInt64(Param: Int64;
Separator: string): string;
begin
Result := IntToStr(Param) + Separator;
end;
function TDBXTracePascalFormatter.ParamInt8(Param: ShortInt;
Separator: string): string;
begin
Result := IntToStr(Param) + Separator;
end;
function TDBXTracePascalFormatter.ParamString(Param, Separator: string): string;
begin
Result := QuoteString(Param) + Separator;
end;
function TDBXTracePascalFormatter.ParamTime(Param: TDBXTime;
Separator: string): string;
var
TimeStamp: TTimeStamp;
begin
TimeStamp.Date := DateDelta;
TimeStamp.Time := Param;
Result := IntToStr(Param) + FCommentStart+TimeToStr(TimeStampToDateTime(TimeStamp))+FCommentEnd + Separator;
end;
function TDBXTracePascalFormatter.ParamTimeStamp(Param: TSqlTimeStamp;
Separator: string): string;
begin
Result := 'StrToSQLTimeSTamp(' + QuoteString(SQLTimeStampToStr('', Param)) + ')' + Separator;
end;
function TDBXTracePascalFormatter.ParamTimeStampOffset(
Param: TSqlTimeStampOffset; Separator: string): string;
begin
Result := 'StrToSQLTimeStampOffset(' + QuoteString(SQLTimeStampOffsetToStr('', Param)) + ')' + Separator;
end;
function TDBXTracePascalFormatter.ParamUInt16(Param: Word;
Separator: string): string;
begin
Result := IntToStr(Param) + Separator;
end;
function TDBXTracePascalFormatter.ParamUInt8(Param: Byte;
Separator: string): string;
begin
Result := IntToStr(Param) + Separator;
end;
function TDBXTracePascalFormatter.ParamWideString(Param: string;
Separator: string): string;
begin
Result := QuoteString(Param) + Separator;
end;
function TDBXTracePascalFormatter.QuoteString(Value: string): string;
var
StringList: TStringList;
Index, StartIndex, StringEnd: Integer;
Ch: Char;
begin
StringList := TStringList.Create;
try
StringList.LineBreak := '';
StartIndex := 1;
StringList.Add('''');
StringEnd := Value.Length;
Index := 1;
while Index <= StringEnd do
begin
Ch := Value.Chars[Index - 1];
if Ch < ' ' then
begin
StringList.Add(Value.Substring(StartIndex - 1, Index - StartIndex));
StartIndex := Index + 1;
StringList.Add('''#'+IntToStr(Integer(Ch))+'''');
end;
if Ch = #10 then
begin
if (Index+1) < StringEnd then
StringList.Add(''''#13#10'+''');
end;
if (Index-StartIndex) > 100 then
begin
StringList.Add(Value.Substring(StartIndex - 1, Index - StartIndex));
StringList.Add('''+''');
StartIndex := Index;
end;
Inc(Index);
end;
StringList.Add(Value.Substring(StartIndex - 1, Index - StartIndex));
StringList.Add('''');
Result := StringList.Text;
finally
StringList.Free;
end;
end;
function TDBXTracePascalFormatter.SetProperty(InstanceName,
PropertyName: string; Value: string): string;
begin
Result := InstanceName + '.' + PropertyName + ' := ' + Value + ';';
end;
{ TDBXTraceParameters }
procedure TDBXTraceParameterList.AddParameter(Parameter: TDBXParameter);
begin
inherited AddParameter(Parameter);
end;
procedure TDBXTraceParameterList.ClearParameters;
begin
inherited ClearParameters;
end;
constructor TDBXTraceParameterList.Create(
Command: TDBXCommand; Parameters: TDBXParameterList;
DBXContext: TDBXContext; Formatter: TDBXTraceFormatter;
ParametersName: string; ConnectionId, CommandId: Int64);
begin
inherited Create(DBXContext, Command, Parameters);
FFormatter := Formatter;
FConnectionId := ConnectionId;
FCommandId := CommandId;
FParametersName := ParametersName;
end;
function TDBXTraceParameterList.GetCount: TInt32;
begin
Result := inherited GetCount;
end;
function TDBXTraceParameterList.GetName: string;
begin
Result := FParametersName;
end;
function TDBXTraceParameterList.GetOrdinal(const Name: string): Integer;
begin
Result := inherited GetOrdinal(Name);
end;
function TDBXTraceParameterList.GetParameterByOrdinal(
const Ordinal: TInt32): TDBXParameter;
begin
Result := inherited GetParameterByOrdinal(Ordinal);
end;
procedure TDBXTraceParameterList.InsertParameter(Ordinal: Integer;
Parameter: TDBXParameter);
begin
inherited InsertParameter(Ordinal, Parameter);
end;
procedure TDBXTraceParameterList.RemoveParameter(Ordinal: Integer);
begin
inherited RemoveParameter(Ordinal);
end;
procedure TDBXTraceParameterList.RemoveParameter(Parameter: TDBXParameter);
begin
inherited RemoveParameter(Parameter);
end;
procedure TDBXTraceParameterList.RemoveParameters;
begin
inherited RemoveParameters;
end;
procedure TDBXTraceParameterList.SetCount(const Count: TInt32);
begin
inherited SetCount(Count);
end;
procedure TDBXTraceParameterList.SetParameter(const Ordinal: Integer;
const Parameter: TDBXParameter);
begin
inherited SetParameter(Ordinal, Parameter);
end;
{ TDBXConsoleTraceWriter }
function TDBXConsoleTraceWriter.IsSingleton: Boolean;
begin
Result := true;
end;
function TDBXConsoleTraceWriter.WriteTrace(TraceInfo: TDBXTraceInfo): CBRType;
begin
Writeln(TraceInfo.Message);
Result := cbrUSEDEF;
end;
{ TDBXTraceWritableValue }
constructor TDBXTraceWritableValue.Create(DBXContext: TDBXContext; ValueType: TDBXValueType; Value: TDBXWritableValue; Formatter: TDBXTraceFormatter;ValueName: string);
begin
inherited Create(ValueType, Value);
FFormatter := Formatter;
FValueName := ValueName;
FLastOrdinal := -1;
end;
function TDBXTraceWritableValue.EqualsValue(Other: TDBXValue): Boolean;
begin
Result := inherited EqualsValue(Other);
end;
function TDBXTraceWritableValue.GetBcd: TBcd;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultBcd',
GetValueDisplayName,
'GetBcd'));
Result := inherited GetBCD;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultBcd', FFormatter.ParamBcd(Result, '')));
end;
function TDBXTraceWritableValue.GetBoolean(defaultValue: Boolean): Boolean;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultBoolean',
GetValueDisplayName,
'GetBoolean'));
Result := inherited GetBoolean(defaultValue);
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultBoolean', FFormatter.ParamBoolean(Result, '')));
end;
function TDBXTraceWritableValue.GetBoolean: Boolean;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultBoolean',
GetValueDisplayName,
'GetBoolean'));
Result := inherited GetBoolean;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultBoolean', FFormatter.ParamBoolean(Result, '')));
end;
function TDBXTraceWritableValue.GetBytes(Offset: Int64;
const Buffer: TArray<Byte>; BufferOffset, Length: Int64): Int64;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultBytes',
GetValueDisplayName,
'GetBytes'));
Result := inherited GetBytes(Offset, Buffer, BufferOffset, Length);
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultBytes',
FFormatter.ParamBytes(Buffer, BufferOffset, Length, Result, '')));
end;
function TDBXTraceWritableValue.GetDate: TDBXDate;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultDate',
GetValueDisplayName,
'GetDate'));
Result := inherited GetDate;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultDate', FFormatter.ParamDate(Result, '')));
end;
function TDBXTraceWritableValue.GetDBXConnection: TDBXConnection;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultDBXConnection',
GetValueDisplayName,
'GetDBXConnection'));
Result := inherited GetDBXConnection;
end;
function TDBXTraceWritableValue.GetDBXReader(AInstanceOwner: Boolean): TDBXReader;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultDBXReader',
GetValueDisplayName,
'GetDBXReader'));
Result := inherited GetDBXReader(AInstanceOwner);
end;
function TDBXTraceWritableValue.GetDouble: Double;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultDouble',
GetValueDisplayName,
'GetDouble'));
Result := inherited GetDouble;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultDouble', FFormatter.ParamDouble(Result, '')));
end;
function TDBXTraceWritableValue.GetInt16: SmallInt;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultInt16',
GetValueDisplayName,
'GetInt16'));
Result := inherited GetInt16;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultInt16', FFormatter.ParamInt16(Result, '')));
end;
function TDBXTraceWritableValue.GetInt32: TInt32;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultInt32',
GetValueDisplayName,
'GetInt32'));
Result := inherited GetInt32;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultInt32', FFormatter.ParamInt32(Result, '')));
end;
function TDBXTraceWritableValue.GetInt64: Int64;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultInt64',
GetValueDisplayName,
'GetInt64'));
Result := inherited GetInt64;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultInt64', FFormatter.ParamInt64(Result, '')));
end;
{$IFNDEF NEXTGEN}
function TDBXTraceWritableValue.GetAnsiString: AnsiString;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultString',
GetValueDisplayName,
'GetAnsiString'));
Result := inherited GetAnsiString;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultString', FFormatter.ParamString(string(Result), '')));
end;
{$ENDIF !NEXTGEN}
function TDBXTraceWritableValue.GetAsBcd: TBcd;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultBcd',
GetValueDisplayName,
'GetAsBcd'));
Result := inherited GetAsBCD;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultBcd', FFormatter.ParamBcd(Result, '')));
end;
function TDBXTraceWritableValue.GetAsBoolean: Boolean;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultBoolean',
GetValueDisplayName,
'GetAsBoolean'));
Result := inherited GetAsBoolean;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultBoolean', FFormatter.ParamBoolean(Result, '')));
end;
function TDBXTraceWritableValue.GetAsDate: TDBXDate;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultDate',
GetValueDisplayName,
'GetAsDate'));
Result := inherited GetAsDate;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultDate', FFormatter.ParamDate(Result, '')));
end;
function TDBXTraceWritableValue.GetAsDouble: Double;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultDouble',
GetValueDisplayName,
'GetAsDouble'));
Result := inherited GetAsDouble;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultDouble', FFormatter.ParamDouble(Result, '')));
end;
function TDBXTraceWritableValue.GetAsInt16: SmallInt;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultInt16',
GetValueDisplayName,
'GetAsInt16'));
Result := inherited GetAsInt16;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultInt16', FFormatter.ParamInt16(Result, '')));
end;
function TDBXTraceWritableValue.GetAsInt32: TInt32;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultInt32',
GetValueDisplayName,
'GetAsInt32'));
Result := inherited GetInt32;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultInt32', FFormatter.ParamInt32(Result, '')));
end;
function TDBXTraceWritableValue.GetAsInt64: Int64;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultInt64',
GetValueDisplayName,
'GetAsInt64'));
Result := inherited GetInt64;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultInt64', FFormatter.ParamInt64(Result, '')));
end;
function TDBXTraceWritableValue.GetAsInt8: ShortInt;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultInt8',
GetValueDisplayName,
'GetAsInt8'));
Result := inherited GetAsInt8;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultInt8', FFormatter.ParamInt8(Result, '')));
end;
function TDBXTraceWritableValue.GetAsSingle: Single;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultSingle',
GetValueDisplayName,
'GetAsSingle'));
Result := inherited GetAsSingle;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultSingle', FFormatter.ParamDouble(Result, '')));
end;
function TDBXTraceWritableValue.GetAsString: string;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultString',
GetValueDisplayName,
'GetAsString'));
Result := inherited GetAsString;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultString', FFormatter.ParamString(Result, '')));
end;
function TDBXTraceWritableValue.GetAsTime: TDBXTime;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultTime',
GetValueDisplayName,
'GetAsTime'));
Result := inherited GetAsTime;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultTime', FFormatter.ParamTime(Result, '')));
end;
function TDBXTraceWritableValue.GetAsTimeStamp: TSQLTimeStamp;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultTimeStamp',
GetValueDisplayName,
'GetAsTimeStamp'));
Result := inherited GetAsTimeStamp;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultTimeStamp', FFormatter.ParamTimeStamp(Result, '')));
end;
function TDBXTraceWritableValue.GetAsUInt16: Word;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultUInt16',
GetValueDisplayName,
'GetAsUInt16'));
Result := inherited GetAsUInt16;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultUInt16', FFormatter.ParamUInt16(Result, '')));
end;
function TDBXTraceWritableValue.GetAsUInt8: Byte;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultUInt8',
GetValueDisplayName,
'GetAsUInt8'));
Result := inherited GetAsUInt8;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultUInt8', FFormatter.ParamUInt8(Result, '')));
end;
function TDBXTraceWritableValue.GetTime: TDBXTime;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultTime',
GetValueDisplayName,
'GetTime'));
Result := inherited GetTime;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultTime', FFormatter.ParamTime(Result, '')));
end;
function TDBXTraceWritableValue.GetTimeStamp: TSQLTimeStamp;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultTimeStamp',
GetValueDisplayName,
'GetTimeStamp'));
Result := inherited GetTimeStamp;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultTimeStamp', FFormatter.ParamTimeStamp(Result, '')));
end;
function TDBXTraceWritableValue.GetTimeStampOffset: TSQLTimeStampOffset;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultTimeStampOffset',
GetValueDisplayName,
'GetTimeStampOffset'));
Result := inherited GetTimeStampOffset;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultTimeStampOffset', FFormatter.ParamTimeStampOffset(Result, '')));
end;
function TDBXTraceWritableValue.GetUInt16: Word;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultUInt16',
GetValueDisplayName,
'GetUInt16'));
Result := inherited GetUInt16;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultUInt16', FFormatter.ParamUInt16(Result, '')));
end;
function TDBXTraceWritableValue.GetUInt16(defaultValue: Word): Word;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultUInt16',
GetValueDisplayName,
'GetUInt16'));
Result := inherited GetUInt16(defaultValue);
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultUInt16', FFormatter.ParamUInt16(Result, '')));
end;
function TDBXTraceWritableValue.GetUInt8(defaultValue: Byte): Byte;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultUInt8',
GetValueDisplayName,
'GetUInt8'));
Result := inherited GetUInt8(defaultValue);
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultUInt8', FFormatter.ParamUInt8(Result, '')));
end;
function TDBXTraceWritableValue.GetUInt8: Byte;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultUInt8',
GetValueDisplayName,
'GetUInt8'));
Result := inherited GetUInt8;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultUInt8', FFormatter.ParamUInt8(Result, '')));
end;
function TDBXTraceWritableValue.GetValueDisplayName: string;
begin
if FLastOrdinal <> ValueType.Ordinal then
begin
FValueDisplayName := FValueName + '[' + IntToStr(ValueType.Ordinal) + '].Value';
FLastOrdinal := ValueType.Ordinal;
end;
Result := FValueDisplayName;
end;
function TDBXTraceWritableValue.GetValueSize: Int64;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DbxContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultGetValueSize',
GetValueDisplayName,
'GetValueSize'));
Result := inherited GetValueSize;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DbxContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultGetBlobLength', FFormatter.ParamInt64(Result, '')));
end;
function TDBXTraceWritableValue.GetWideString(
defaultValue: string): string;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultWideString',
GetValueDisplayName,
'GetWideString'));
Result := inherited GetWideString(defaultValue);
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultWideString', FFormatter.ParamWideString(Result, '')));
end;
function TDBXTraceWritableValue.GetWideString: string;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultWideString',
GetValueDisplayName,
'GetWideString'));
Result := inherited GetWideString;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultWideString', FFormatter.ParamWideString(Result, '')));
end;
function TDBXTraceWritableValue.IsNull: Boolean;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty(GetValueDisplayName+' ResultIsNull',
GetValueDisplayName,
'IsNull'));
Result := inherited IsNull;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultIsNull', FFormatter.ParamBoolean(Result, '')));
end;
procedure TDBXTraceWritableValue.SetBcd(const Value: TBcd);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetBcd')
+ FFormatter.ParamBcd(Value, '')
+ FFormatter.CloseProcedure);
inherited;
end;
procedure TDBXTraceWritableValue.SetBoolean(const Value: Boolean);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetBoolean')
+ FFormatter.ParamBoolean(Value, '')
+ FFormatter.CloseProcedure);
inherited;
end;
procedure TDBXTraceWritableValue.SetDate(const Value: TDBXDate);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetDate')
+ FFormatter.ParamDate(Value, '')
+ FFormatter.CloseProcedure);
inherited;
end;
procedure TDBXTraceWritableValue.SetDBXConnection(const Value: TDBXConnection);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallProcedure(GetValueDisplayName,
'SetDBXConnection'));
inherited;
end;
procedure TDBXTraceWritableValue.SetDBXReader(const Value: TDBXReader;
const AInstanceOwner: Boolean);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetDBXReader')
+ FFormatter.ParamBoolean(AInstanceOwner, '')
+ FFormatter.CloseProcedure);
inherited;
end;
procedure TDBXTraceWritableValue.SetDouble(const Value: Double);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetDouble')
+ FFormatter.ParamDouble(Value, '')
+ FFormatter.CloseProcedure);
inherited;
end;
procedure TDBXTraceWritableValue.SetDynamicBytes(Offset: Int64;
const Buffer: TArray<Byte>; BufferOffset, Length: Int64);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetDynamicBytes')
+ FFormatter.ParamInt64(Offset, ',')
+ FFormatter.ParamBytes(Buffer, BufferOffset, Length, Length, ',')
+ FFormatter.ParamInt64(BufferOffset, ',')
+ FFormatter.ParamInt64(Length, '')
+ FFormatter.CloseProcedure);
inherited;
end;
procedure TDBXTraceWritableValue.SetInt16(const Value: SmallInt);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetInt16')
+ FFormatter.ParamInt16(Value, '')
+ FFormatter.CloseProcedure);
inherited;
end;
procedure TDBXTraceWritableValue.SetInt32(const Value: TInt32);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetInt32')
+ FFormatter.ParamInt32(Value, '')
+ FFormatter.CloseProcedure);
inherited;
end;
procedure TDBXTraceWritableValue.SetInt64(const Value: Int64);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetInt64')
+ FFormatter.ParamInt64(Value, '')
+ FFormatter.CloseProcedure);
inherited;
end;
procedure TDBXTraceWritableValue.SetInt8(const Value: ShortInt);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetInt8')
+ FFormatter.ParamInt8(Value, '')
+ FFormatter.CloseProcedure);
inherited;
end;
procedure TDBXTraceWritableValue.SetNull;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallProcedure(GetValueDisplayName,
'SetNull'));
inherited;
end;
procedure TDBXTraceWritableValue.SetPendingValue;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallProcedure(GetValueDisplayName,
'SetPendingValue'));
inherited;
end;
procedure TDBXTraceWritableValue.SetSingle(const Value: Single);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetSingle')
+ FFormatter.ParamDouble(Value, '')
+ FFormatter.CloseProcedure);
inherited;
end;
procedure TDBXTraceWritableValue.SetStaticBytes(Offset: Int64;
const Buffer: array of Byte; BufferOffset, Length: Int64);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetStaticBytes')
+ FFormatter.ParamInt64(Offset, ',')
+ FFormatter.ParamBytes(Buffer, BufferOffset, Length, Length, ',')
+ FFormatter.ParamInt64(BufferOffset, ',')
+ FFormatter.ParamInt64(Length, '')
+ FFormatter.CloseProcedure);
inherited;
end;
procedure TDBXTraceWritableValue.SetStream(const Stream: TStream;
const AInstanceOwner: Boolean);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetStream')
+ FFormatter.ParamBoolean(AInstanceOwner, '')
+ FFormatter.CloseProcedure);
inherited;
end;
procedure TDBXTraceWritableValue.SetString(const Value: string);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetString')
+ FFormatter.ParamString(Value, '')
+ FFormatter.CloseProcedure);
inherited;
end;
{$IFNDEF NEXTGEN}
procedure TDBXTraceWritableValue.SetAnsiString(const Value: AnsiString);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetAnsiString')
+ FFormatter.ParamString(string(Value), '')
+ FFormatter.CloseProcedure);
inherited;
end;
{$ENDIF !NEXTGEN}
procedure TDBXTraceWritableValue.SetAsBcd(const Value: TBcd);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetAsBcd')
+ FFormatter.ParamBcd(Value, '')
+ FFormatter.CloseProcedure);
inherited;
end;
procedure TDBXTraceWritableValue.SetAsBoolean(const Value: Boolean);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetAsBoolean')
+ FFormatter.ParamBoolean(Value, '')
+ FFormatter.CloseProcedure);
inherited;
end;
procedure TDBXTraceWritableValue.SetAsDate(const Value: TDBXDate);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetAsDate')
+ FFormatter.ParamDate(Value, '')
+ FFormatter.CloseProcedure);
inherited;
end;
procedure TDBXTraceWritableValue.SetAsDouble(const Value: Double);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetAsDouble')
+ FFormatter.ParamDouble(Value, '')
+ FFormatter.CloseProcedure);
inherited;
end;
procedure TDBXTraceWritableValue.SetAsInt16(const Value: SmallInt);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetAsInt16')
+ FFormatter.ParamInt16(Value, '')
+ FFormatter.CloseProcedure);
inherited;
end;
procedure TDBXTraceWritableValue.SetAsInt32(const Value: TInt32);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetAsInt32')
+ FFormatter.ParamInt32(Value, '')
+ FFormatter.CloseProcedure);
inherited;
end;
procedure TDBXTraceWritableValue.SetAsInt64(const Value: Int64);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetAsInt64')
+ FFormatter.ParamInt64(Value, '')
+ FFormatter.CloseProcedure);
inherited;
end;
procedure TDBXTraceWritableValue.SetAsInt8(const Value: ShortInt);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetAsInt8')
+ FFormatter.ParamInt8(Value, '')
+ FFormatter.CloseProcedure);
inherited;
end;
procedure TDBXTraceWritableValue.SetAsSingle(const Value: Single);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetAsSingle')
+ FFormatter.ParamDouble(Value, '')
+ FFormatter.CloseProcedure);
inherited;
end;
procedure TDBXTraceWritableValue.SetAsString(const Value: string);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetAsString')
+ FFormatter.ParamString(Value, '')
+ FFormatter.CloseProcedure);
inherited;
end;
procedure TDBXTraceWritableValue.SetAsTime(const Value: TDBXTime);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetAsTime')
+ FFormatter.ParamTime(Value, '')
+ FFormatter.CloseProcedure);
inherited;
end;
procedure TDBXTraceWritableValue.SetAsTimeStamp(const Value: TSQLTimeStamp);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetAsTimeStamp')
+ FFormatter.ParamTimeStamp(Value, '')
+ FFormatter.CloseProcedure);
inherited;
end;
procedure TDBXTraceWritableValue.SetAsUInt16(const Value: Word);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetAsUInt16')
+ FFormatter.ParamUInt16(Value, '')
+ FFormatter.CloseProcedure);
inherited;
end;
procedure TDBXTraceWritableValue.SetAsUInt8(const Value: Byte);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetAsUInt8')
+ FFormatter.ParamUInt8(Value, '')
+ FFormatter.CloseProcedure);
inherited;
end;
procedure TDBXTraceWritableValue.SetTime(const Value: TDBXTime);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetTime')
+ FFormatter.ParamTime(Value, '')
+ FFormatter.CloseProcedure);
inherited;
end;
procedure TDBXTraceWritableValue.SetTimeStamp(const Value: TSQLTimeStamp);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetTimeStamp')
+ FFormatter.ParamTimeStamp(Value, '')
+ FFormatter.CloseProcedure);
inherited;
end;
procedure TDBXTraceWritableValue.SetTimeStampOffset(
const Value: TSQLTimeStampOffset);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetTimeStampOffset')
+ FFormatter.ParamTimeStampOffset(Value, '')
+ FFormatter.CloseProcedure);
inherited;
end;
procedure TDBXTraceWritableValue.SetUInt16(const Value: Word);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetUInt16')
+ FFormatter.ParamUInt16(Value, '')
+ FFormatter.CloseProcedure);
inherited;
end;
procedure TDBXTraceWritableValue.SetUInt8(const Value: Byte);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetUInt8')
+ FFormatter.ParamUInt8(Value, '')
+ FFormatter.CloseProcedure);
inherited;
end;
procedure TDBXTraceWritableValue.SetValue(const Value: TDBXValue);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallProcedure(GetValueDisplayName,
'SetValue'));
inherited;
end;
procedure TDBXTraceWritableValue.SetWideString(const Value: string);
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CallOpenProcedure(GetValueDisplayName,
'SetWideString')
+ FFormatter.ParamWideString(Value, '')
+ FFormatter.CloseProcedure);
inherited;
end;
function TDBXTraceWritableValue.GetInt16(defaultValue: Smallint): Smallint;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultInt16',
GetValueDisplayName,
'GetInt16'));
Result := inherited GetInt16(defaultValue);
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultInt16', FFormatter.ParamInt16(Result, '')));
end;
function TDBXTraceWritableValue.GetInt32(defaultValue: TInt32): TInt32;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultInt32',
GetValueDisplayName,
'GetInt32'));
Result := inherited GetInt32(defaultValue);
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultInt32', FFormatter.ParamInt32(Result, '')));
end;
function TDBXTraceWritableValue.GetInt64(defaultValue: Int64): Int64;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultInt64',
GetValueDisplayName,
'GetInt64'));
Result := inherited GetInt64(defaultValue);
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultInt64', FFormatter.ParamInt64(Result, '')));
end;
function TDBXTraceWritableValue.GetInt8(defaultValue: Shortint): Shortint;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultInt8',
GetValueDisplayName,
'GetInt8'));
Result := inherited GetInt8(defaultValue);
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultInt8', FFormatter.ParamInt8(Result, '')));
end;
function TDBXTraceWritableValue.GetInt8: ShortInt;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultInt8',
GetValueDisplayName,
'GetInt8'));
Result := inherited GetInt8;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultInt8', FFormatter.ParamInt8(Result, '')));
end;
function TDBXTraceWritableValue.GetNonDelegate: TDBXValue;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultValue',
GetValueDisplayName,
'GetNonDelegate'));
Result := inherited GetNonDelegate;
end;
function TDBXTraceWritableValue.GetSingle: Single;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultSingle',
GetValueDisplayName,
'GetSingle'));
Result := inherited GetSingle;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultSingle', FFormatter.ParamDouble(Result, '')));
end;
function TDBXTraceWritableValue.GetStream(AInstanceOwner: Boolean): TStream;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultStream',
GetValueDisplayName,
'GetStream'));
Result := inherited GetStream(AInstanceOwner);
end;
function TDBXTraceWritableValue.GetString: string;
begin
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.GetProperty('ResultString',
GetValueDisplayName,
'GetString'));
Result := inherited GetString;
if DBXContext.IsTracing(TDBXTraceFlags.Parameter) then
DBXContext.Trace(TDBXTraceFlags.Parameter,
FFormatter.CommentValue(GetValueDisplayName+' ResultString', FFormatter.ParamString(Result, '')));
end;
{ TDBXTraceParameter }
function TDBXTraceParameter.Clone: TObject;
var
Parameter: TDBXParameter;
begin
if Assigned(FParameter) then
Parameter := TDBXParameter(TDBXParameter(FParameter).Clone)
else
Parameter := nil;
Result := TDBXTraceParameter.Create(FDBXContext, Parameter, FFormatter, FParameterName+'_Clone'); { Do not resource }
end;
constructor TDBXTraceParameter.Create(DbxContext: TDBXContext; Parameter: TDBXParameter;
Formatter: TDBXTraceFormatter; ValueName: string);
begin
inherited Create(DbxContext, Parameter);
FFormatter := Formatter;
FParameterName := ValueName;
end;
destructor TDBXTraceParameter.Destroy;
begin
inherited;
FreeAndNil(FTraceValue);
end;
function TDBXTraceParameter.GetValue: TDBXWritableValue;
begin
if (FTraceValue = nil) and (FParameter.Value <> nil) then
FTraceValue := TDBXTraceWritableValue.Create(FDbxContext, TDBXValueType(Self).Clone, FParameter.Value, FFormatter, FParameterName);
// Subtle. Causes type changes to be updated if needed.
//
inherited GetValue;
Result := FTraceValue;
end;
{ TDBXTraceOutput }
procedure TDBXTraceOutput.AddReference;
begin
Inc(FReferenceCount);
end;
constructor TDBXTraceOutput.Create;
begin
inherited;
FFormatter := TDBXTracePascalFormatter.Create('{', '}', 200);
FCriticalSection := TCriticalSection.Create;
end;
destructor TDBXTraceOutput.Destroy;
begin
FreeAndNil(FFormatter);
FreeAndNil(FCriticalSection);
inherited;
end;
function TDBXTraceOutput.LogDriverTrace(TraceInfo: TDBXTraceInfo): CBRType;
var
DriverTraceInfo: TDBXTraceInfo;
begin
DriverTraceInfo.TraceFlag := TraceInfo.TraceFlag or TDBXTraceFlags.Driver;
DriverTraceInfo.Message := FFormatter.Comment(TraceInfo.Message);
Result := LogTrace(DriverTraceInfo);
end;
function TDBXTraceOutput.LogTrace(TraceInfo: TDBXTraceInfo): CBRType;
var
Line, TraceName: string;
Index, OriginalLength: Integer;
begin
TraceName := TraceFlagToString(TraceInfo.TraceFlag);
OriginalLength := TraceName.Length;
for Index := OriginalLength+1 to 15 do
TraceName := TraceName + ' ';
Line := FFormatter.Comment(TraceName) + ' ' + TraceInfo.Message;
FCriticalSection.Acquire;
try
WriteTraceln(Line);
finally
FCriticalSection.Release;
end;
Result := cbrUSEDEF;
end;
function TDBXTraceOutput.RemoveReference: TInt32;
begin
Dec(FReferenceCount);
Result := FReferenceCount;
end;
function TDBXTraceOutput.TraceFlagToString(TraceFlag: TDBXTraceFlag): string;
begin
if TraceFlag and TDBXTraceFlags.Driver <> 0 then
begin
Result := TDBXTraceFlagNames.DRIVER + ' ' + TraceFlagToString(TraceFlag - TDBXTraceFlags.Driver);
end else
case TraceFlag of
TDBXTraceFlags.Prepare: Result := TDBXTraceFlagNames.PREPARE;
TDBXTraceFlags.Execute: Result := TDBXTraceFlagNames.EXECUTE;
TDBXTraceFlags.Error: Result := TDBXTraceFlagNames.ERROR;
TDBXTraceFlags.Command: Result := TDBXTraceFlagNames.COMMAND;
TDBXTraceFlags.Connect: Result := TDBXTraceFlagNames.CONNECT;
TDBXTraceFlags.Transact: Result := TDBXTraceFlagNames.TRANSACT;
TDBXTraceFlags.Blob: Result := TDBXTraceFlagNames.BLOB;
TDBXTraceFlags.Misc: Result := TDBXTraceFlagNames.MISC;
TDBXTraceFlags.Vendor: Result := TDBXTraceFlagNames.VENDOR;
TDBXTraceFlags.Parameter: Result := TDBXTraceFlagNames.PARAMETER;
TDBXTraceFlags.Reader: Result := TDBXTraceFlagNames.READER;
TDBXTraceFlags.DriverLoad: Result := TDBXTraceFlagNames.DRIVER_LOAD;
TDBXTraceFlags.MetaData: Result := TDBXTraceFlagNames.METADATA;
else
Result := 'UNKNOWN' +'('+IntToStr(TraceFlag)+')';
end;
end;
{ TDBXFileTraceOutput }
destructor TDBXFileTraceOutput.Destroy;
begin
CloseFile(FTraceFile);
inherited;
end;
procedure TDBXFileTraceOutput.Open;
begin
AssignFile(FTraceFile, string(Name));
if FileExists(Name) then
Append(FTraceFile)
else
Rewrite(FTraceFile);
WriteTraceln('Log Opened ==========================================');
end;
procedure TDBXFileTraceOutput.WriteTraceln(Line: string);
begin
Writeln(FTraceFile, Line);
end;
{ TDBXConsoleTraceOutput }
procedure TDBXConsoleTraceOutput.Open;
begin
end;
procedure TDBXConsoleTraceOutput.WriteTraceln(Line: string);
begin
Writeln(Line);
end;
{ TDBXTraceReader }
constructor TDBXTraceReader.Create(DBXContext: TDBXContext; Reader: TDBXReader;
Formatter: TDBXTraceFormatter; ConnectionId, CommandId, ReaderId: Int64);
begin
inherited Create(DBXContext, Reader);
FFormatter := Formatter;
FConnectionId := ConnectionId;
FCommandId := CommandId;
FReaderId := ReaderId;
FReaderName := 'ReaderC'+IntToStr(ConnectionId)+'_'+IntToStr(CommandId)+'_'+IntToStr(ReaderId);
if FDBXContext.IsTracing(TDBXTraceFlags.Reader) then
PrintColumns;
end;
destructor TDBXTraceReader.Destroy;
begin
if FDBXContext.IsTracing(TDBXTraceFlags.Reader) then
begin
if not FClosed then
FDbxContext.Trace( TDBXTraceFlags.Reader,
' { ' + FReaderName + ' closed. '
+ IntToStr(FNextCount) + ' row(s) read }');
FDbxContext.Trace( TDBXTraceFlags.Reader,
FFormatter.CallOpenProcedure('', 'FreeAndNil')
+ FReaderName + FFormatter.CloseProcedure);
end;
inherited;
end;
function TDBXTraceReader.Next: Boolean;
begin
Result := inherited Next;
if Result then
Inc(FNextCount)
else if not FClosed then
begin
if FDBXContext.IsTracing(TDBXTraceFlags.Reader) then
begin
FDbxContext.Trace( TDBXTraceFlags.Reader,
' { ' + FReaderName + ' closed. '
+ IntToStr(FNextCount) + ' row(s) read }');
end;
FClosed := true;
end;
end;
procedure TDBXTraceReader.PrintColumns;
var
Ordinal: Integer;
LastOrdinal: Integer;
LocalValueType: TDBXValueType;
begin
LastOrdinal := GetColumnCount - 1;
for Ordinal := 0 to LastOrdinal do
begin
LocalValueType := ValueType[Ordinal];
FDBXContext.Trace(TDBXTraceFlags.Reader,
' {' + LocalValueType.Name
+ ' ' + FFormatter.ColumnTypeToStr(LocalValueType.DataType)
+ ' }');
end;
end;
{ TDBXTraceProperties }
constructor TDBXTraceProperties.Create(DBXContext: TDBXContext);
begin
inherited Create(DBXContext);
TraceFlags := [PARAMETER,ERROR,EXECUTE,COMMAND,CONNECT,TRANSACT,BLOB,MISC,VENDOR,READER,DRIVER_LOAD,METADATA];
Values[TDBXPropertyNames.DriverUnit] := 'Data.DBXTrace';
Values[TDBXPropertyNames.DelegateDriver] := BoolToStr(True, True);
end;
function TDBXTraceProperties.GetTraceDriver: Boolean;
begin
Result := StrToBoolDef(Values[StrTraceDriver], False);
end;
function TDBXTraceProperties.GetTraceFile: string;
begin
Result := Values[StrTraceFile];
end;
function TDBXTraceProperties.GetTraceFlags: TTraceFlags;
begin
Result := StrToTraceFlags(Values[StrTraceFlags]);
end;
procedure TDBXTraceProperties.SetTraceDriver(const Value: Boolean);
begin
Values[StrTraceDriver] := BoolToStr(Value, True);
end;
procedure TDBXTraceProperties.SetTraceFile(const Value: string);
begin
Values[StrTraceFile] := Value;
end;
procedure TDBXTraceProperties.SetTraceFlags(const Value: TTraceFlags);
begin
Values[StrTraceFlags] := TraceFlagsToStr(Value);
end;
function TDBXTraceProperties.StrtoTraceFlags(Value: string): TTraceFlags;
var
Strings: TStringList;
Flag: TTraceFlag;
Info: PTypeInfo;
Str: string;
begin
Info := TypeInfo(TTraceFlag);
Strings := TStringList.Create;
try
ExtractStrings([';'],[], PChar(Value), Strings);
Result := [];
for Str in Strings do
begin
Flag := TTraceFlag(GetEnumValue(Info, Str));
Include(Result, Flag);
end;
finally
Strings.Free;
end;
end;
function TDBXTraceProperties.TraceFlagsToStr(Flags: TTraceFlags): string;
var
Flag: TTraceFlag;
Info: PTypeInfo;
begin
Info := TypeInfo(TTraceFlag);
Result := '';
for Flag in Flags do
begin
if Result <> EmptyStr then
Result := Result + ';';
Result := Result + GetEnumName(Info, Ord(Flag));
end;
end;
{$IFDEF MSWINDOWS}
{ TDBXDebugStrTraceOutput }
procedure TDBXDebugStrTraceOutput.Open;
begin
end;
procedure TDBXDebugStrTraceOutput.WriteTraceln(Line: string);
begin
if Line <> '' then
OutputDebugString(Pointer(Line));
end;
{$ENDIF}
initialization
TDBXDriverRegistry.RegisterDriverClass(sDriverName, TDBXTraceDriver);
finalization
TDBXDriverRegistry.UnloadDriver(sDriverName);
end.
|
{*******************************************************}
{ }
{ CodeGear Delphi Runtime Library }
{ Copyright(c) 2013-2018 Embarcadero Technologies, Inc. }
{ All rights reserved }
{ }
{*******************************************************}
unit Androidapi.JNI.JavaTypes;
interface
uses
Androidapi.JNIBridge;
type
// ===== Forward declarations =====
JObject = interface;//java.lang.Object
JInputStream = interface;//java.io.InputStream
JByteArrayInputStream = interface;//java.io.ByteArrayInputStream
JOutputStream = interface;//java.io.OutputStream
JByteArrayOutputStream = interface;//java.io.ByteArrayOutputStream
JAutoCloseable = interface;//java.lang.AutoCloseable
JCloseable = interface;//java.io.Closeable
JFile = interface;//java.io.File
JFileDescriptor = interface;//java.io.FileDescriptor
JFileFilter = interface;//java.io.FileFilter
JFileInputStream = interface;//java.io.FileInputStream
JFileOutputStream = interface;//java.io.FileOutputStream
JFilenameFilter = interface;//java.io.FilenameFilter
JFilterOutputStream = interface;//java.io.FilterOutputStream
JThrowable = interface;//java.lang.Throwable
JException = interface;//java.lang.Exception
JIOException = interface;//java.io.IOException
JPrintStream = interface;//java.io.PrintStream
JWriter = interface;//java.io.Writer
JPrintWriter = interface;//java.io.PrintWriter
JRandomAccessFile = interface;//java.io.RandomAccessFile
JReader = interface;//java.io.Reader
JSerializable = interface;//java.io.Serializable
JAbstractStringBuilder = interface;//java.lang.AbstractStringBuilder
JAppendable = interface;//java.lang.Appendable
JBoolean = interface;//java.lang.Boolean
JNumber = interface;//java.lang.Number
JByte = interface;//java.lang.Byte
JCharSequence = interface;//java.lang.CharSequence
Jlang_Class = interface;//java.lang.Class
JClassLoader = interface;//java.lang.ClassLoader
JCloneable = interface;//java.lang.Cloneable
JComparable = interface;//java.lang.Comparable
JDouble = interface;//java.lang.Double
JEnum = interface;//java.lang.Enum
JFloat = interface;//java.lang.Float
JRuntimeException = interface;//java.lang.RuntimeException
JIllegalStateException = interface;//java.lang.IllegalStateException
JInteger = interface;//java.lang.Integer
JIterable = interface;//java.lang.Iterable
JLong = interface;//java.lang.Long
JPackage = interface;//java.lang.Package
JRunnable = interface;//java.lang.Runnable
JShort = interface;//java.lang.Short
JStackTraceElement = interface;//java.lang.StackTraceElement
JString = interface;//java.lang.String
JStringBuffer = interface;//java.lang.StringBuffer
JStringBuilder = interface;//java.lang.StringBuilder
JThread = interface;//java.lang.Thread
JThread_State = interface;//java.lang.Thread$State
JThread_UncaughtExceptionHandler = interface;//java.lang.Thread$UncaughtExceptionHandler
JThreadGroup = interface;//java.lang.ThreadGroup
JAnnotation = interface;//java.lang.annotation.Annotation
JAccessibleObject = interface;//java.lang.reflect.AccessibleObject
JAnnotatedElement = interface;//java.lang.reflect.AnnotatedElement
JExecutable = interface;//java.lang.reflect.Executable
JConstructor = interface;//java.lang.reflect.Constructor
JField = interface;//java.lang.reflect.Field
JGenericDeclaration = interface;//java.lang.reflect.GenericDeclaration
JMethod = interface;//java.lang.reflect.Method
JParameter = interface;//java.lang.reflect.Parameter
Jreflect_Type = interface;//java.lang.reflect.Type
JTypeVariable = interface;//java.lang.reflect.TypeVariable
JBigInteger = interface;//java.math.BigInteger
JBuffer = interface;//java.nio.Buffer
JByteBuffer = interface;//java.nio.ByteBuffer
JByteOrder = interface;//java.nio.ByteOrder
JCharBuffer = interface;//java.nio.CharBuffer
JDoubleBuffer = interface;//java.nio.DoubleBuffer
JFloatBuffer = interface;//java.nio.FloatBuffer
JIntBuffer = interface;//java.nio.IntBuffer
JLongBuffer = interface;//java.nio.LongBuffer
JMappedByteBuffer = interface;//java.nio.MappedByteBuffer
JShortBuffer = interface;//java.nio.ShortBuffer
JAsynchronousFileChannel = interface;//java.nio.channels.AsynchronousFileChannel
JChannel = interface;//java.nio.channels.Channel
JReadableByteChannel = interface;//java.nio.channels.ReadableByteChannel
JByteChannel = interface;//java.nio.channels.ByteChannel
JCompletionHandler = interface;//java.nio.channels.CompletionHandler
JAbstractInterruptibleChannel = interface;//java.nio.channels.spi.AbstractInterruptibleChannel
JSelectableChannel = interface;//java.nio.channels.SelectableChannel
JAbstractSelectableChannel = interface;//java.nio.channels.spi.AbstractSelectableChannel
JDatagramChannel = interface;//java.nio.channels.DatagramChannel
JFileChannel = interface;//java.nio.channels.FileChannel
JFileChannel_MapMode = interface;//java.nio.channels.FileChannel$MapMode
JFileLock = interface;//java.nio.channels.FileLock
JPipe = interface;//java.nio.channels.Pipe
JPipe_SinkChannel = interface;//java.nio.channels.Pipe$SinkChannel
JPipe_SourceChannel = interface;//java.nio.channels.Pipe$SourceChannel
JSeekableByteChannel = interface;//java.nio.channels.SeekableByteChannel
JSelectionKey = interface;//java.nio.channels.SelectionKey
JSelector = interface;//java.nio.channels.Selector
JServerSocketChannel = interface;//java.nio.channels.ServerSocketChannel
JSocketChannel = interface;//java.nio.channels.SocketChannel
JWritableByteChannel = interface;//java.nio.channels.WritableByteChannel
JAbstractSelector = interface;//java.nio.channels.spi.AbstractSelector
JSelectorProvider = interface;//java.nio.channels.spi.SelectorProvider
JCharset = interface;//java.nio.charset.Charset
JCharsetDecoder = interface;//java.nio.charset.CharsetDecoder
JCharsetEncoder = interface;//java.nio.charset.CharsetEncoder
JCoderResult = interface;//java.nio.charset.CoderResult
JCodingErrorAction = interface;//java.nio.charset.CodingErrorAction
JAccessMode = interface;//java.nio.file.AccessMode
JCopyOption = interface;//java.nio.file.CopyOption
JDirectoryStream = interface;//java.nio.file.DirectoryStream
JDirectoryStream_Filter = interface;//java.nio.file.DirectoryStream$Filter
JFileStore = interface;//java.nio.file.FileStore
JFileSystem = interface;//java.nio.file.FileSystem
JLinkOption = interface;//java.nio.file.LinkOption
JOpenOption = interface;//java.nio.file.OpenOption
Jfile_Path = interface;//java.nio.file.Path
JPathMatcher = interface;//java.nio.file.PathMatcher
JWatchEvent_Kind = interface;//java.nio.file.WatchEvent$Kind
JWatchEvent_Modifier = interface;//java.nio.file.WatchEvent$Modifier
JWatchKey = interface;//java.nio.file.WatchKey
JWatchService = interface;//java.nio.file.WatchService
JWatchable = interface;//java.nio.file.Watchable
JAttributeView = interface;//java.nio.file.attribute.AttributeView
JBasicFileAttributes = interface;//java.nio.file.attribute.BasicFileAttributes
JFileAttribute = interface;//java.nio.file.attribute.FileAttribute
JFileAttributeView = interface;//java.nio.file.attribute.FileAttributeView
JFileStoreAttributeView = interface;//java.nio.file.attribute.FileStoreAttributeView
JFileTime = interface;//java.nio.file.attribute.FileTime
//JUserPrincipal = interface;//java.nio.file.attribute.UserPrincipal
//JGroupPrincipal = interface;//java.nio.file.attribute.GroupPrincipal
JUserPrincipalLookupService = interface;//java.nio.file.attribute.UserPrincipalLookupService
JFileSystemProvider = interface;//java.nio.file.spi.FileSystemProvider
JCharacterIterator = interface;//java.text.CharacterIterator
JAttributedCharacterIterator = interface;//java.text.AttributedCharacterIterator
JAttributedCharacterIterator_Attribute = interface;//java.text.AttributedCharacterIterator$Attribute
JFieldPosition = interface;//java.text.FieldPosition
JFormat = interface;//java.text.Format
JFormat_Field = interface;//java.text.Format$Field
JParsePosition = interface;//java.text.ParsePosition
JClock = interface;//java.time.Clock
JDayOfWeek = interface;//java.time.DayOfWeek
Jtime_Duration = interface;//java.time.Duration
JInstant = interface;//java.time.Instant
JLocalDate = interface;//java.time.LocalDate
JLocalDateTime = interface;//java.time.LocalDateTime
JLocalTime = interface;//java.time.LocalTime
JMonth = interface;//java.time.Month
JOffsetDateTime = interface;//java.time.OffsetDateTime
JOffsetTime = interface;//java.time.OffsetTime
JPeriod = interface;//java.time.Period
JZoneId = interface;//java.time.ZoneId
JZoneOffset = interface;//java.time.ZoneOffset
JZonedDateTime = interface;//java.time.ZonedDateTime
JAbstractChronology = interface;//java.time.chrono.AbstractChronology
JChronoLocalDate = interface;//java.time.chrono.ChronoLocalDate
JChronoLocalDateTime = interface;//java.time.chrono.ChronoLocalDateTime
JTemporalAmount = interface;//java.time.temporal.TemporalAmount
JChronoPeriod = interface;//java.time.chrono.ChronoPeriod
JChronoZonedDateTime = interface;//java.time.chrono.ChronoZonedDateTime
JChronology = interface;//java.time.chrono.Chronology
JTemporalAccessor = interface;//java.time.temporal.TemporalAccessor
JEra = interface;//java.time.chrono.Era
JIsoChronology = interface;//java.time.chrono.IsoChronology
JIsoEra = interface;//java.time.chrono.IsoEra
JDateTimeFormatter = interface;//java.time.format.DateTimeFormatter
JDecimalStyle = interface;//java.time.format.DecimalStyle
JFormatStyle = interface;//java.time.format.FormatStyle
JResolverStyle = interface;//java.time.format.ResolverStyle
JTextStyle = interface;//java.time.format.TextStyle
JChronoField = interface;//java.time.temporal.ChronoField
JTemporal = interface;//java.time.temporal.Temporal
JTemporalAdjuster = interface;//java.time.temporal.TemporalAdjuster
JTemporalField = interface;//java.time.temporal.TemporalField
JTemporalQuery = interface;//java.time.temporal.TemporalQuery
JTemporalUnit = interface;//java.time.temporal.TemporalUnit
JValueRange = interface;//java.time.temporal.ValueRange
JZoneOffsetTransition = interface;//java.time.zone.ZoneOffsetTransition
JZoneRules = interface;//java.time.zone.ZoneRules
JAbstractCollection = interface;//java.util.AbstractCollection
JAbstractList = interface;//java.util.AbstractList
JAbstractMap = interface;//java.util.AbstractMap
JAbstractSet = interface;//java.util.AbstractSet
JArrayList = interface;//java.util.ArrayList
JBitSet = interface;//java.util.BitSet
JCalendar = interface;//java.util.Calendar
JCollection = interface;//java.util.Collection
JComparator = interface;//java.util.Comparator
JDate = interface;//java.util.Date
JDictionary = interface;//java.util.Dictionary
JDoubleSummaryStatistics = interface;//java.util.DoubleSummaryStatistics
JEnumSet = interface;//java.util.EnumSet
JEnumeration = interface;//java.util.Enumeration
JGregorianCalendar = interface;//java.util.GregorianCalendar
JHashMap = interface;//java.util.HashMap
JHashSet = interface;//java.util.HashSet
JHashtable = interface;//java.util.Hashtable
JIntSummaryStatistics = interface;//java.util.IntSummaryStatistics
JIterator = interface;//java.util.Iterator
JList = interface;//java.util.List
JListIterator = interface;//java.util.ListIterator
JLocale = interface;//java.util.Locale
JLocale_Category = interface;//java.util.Locale$Category
JLocale_FilteringMode = interface;//java.util.Locale$FilteringMode
JLongSummaryStatistics = interface;//java.util.LongSummaryStatistics
JMap = interface;//java.util.Map
Jutil_Observable = interface;//java.util.Observable
JObserver = interface;//java.util.Observer
JOptional = interface;//java.util.Optional
JOptionalDouble = interface;//java.util.OptionalDouble
JOptionalInt = interface;//java.util.OptionalInt
JOptionalLong = interface;//java.util.OptionalLong
JPrimitiveIterator = interface;//java.util.PrimitiveIterator
JPrimitiveIterator_OfDouble = interface;//java.util.PrimitiveIterator$OfDouble
JPrimitiveIterator_OfInt = interface;//java.util.PrimitiveIterator$OfInt
JPrimitiveIterator_OfLong = interface;//java.util.PrimitiveIterator$OfLong
JProperties = interface;//java.util.Properties
JQueue = interface;//java.util.Queue
JRandom = interface;//java.util.Random
JSet = interface;//java.util.Set
JSortedMap = interface;//java.util.SortedMap
JSpliterator = interface;//java.util.Spliterator
JSpliterator_OfPrimitive = interface;//java.util.Spliterator$OfPrimitive
JSpliterator_OfDouble = interface;//java.util.Spliterator$OfDouble
JSpliterator_OfInt = interface;//java.util.Spliterator$OfInt
JSpliterator_OfLong = interface;//java.util.Spliterator$OfLong
JTimeZone = interface;//java.util.TimeZone
JTimer = interface;//java.util.Timer
JTimerTask = interface;//java.util.TimerTask
JUUID = interface;//java.util.UUID
JAbstractExecutorService = interface;//java.util.concurrent.AbstractExecutorService
JBlockingQueue = interface;//java.util.concurrent.BlockingQueue
JCallable = interface;//java.util.concurrent.Callable
JCountDownLatch = interface;//java.util.concurrent.CountDownLatch
JDelayed = interface;//java.util.concurrent.Delayed
JExecutor = interface;//java.util.concurrent.Executor
JExecutorService = interface;//java.util.concurrent.ExecutorService
JFuture = interface;//java.util.concurrent.Future
JRejectedExecutionHandler = interface;//java.util.concurrent.RejectedExecutionHandler
JScheduledFuture = interface;//java.util.concurrent.ScheduledFuture
JThreadPoolExecutor = interface;//java.util.concurrent.ThreadPoolExecutor
JScheduledThreadPoolExecutor = interface;//java.util.concurrent.ScheduledThreadPoolExecutor
JThreadFactory = interface;//java.util.concurrent.ThreadFactory
JTimeUnit = interface;//java.util.concurrent.TimeUnit
JBiConsumer = interface;//java.util.function.BiConsumer
JBiFunction = interface;//java.util.function.BiFunction
JBinaryOperator = interface;//java.util.function.BinaryOperator
JConsumer = interface;//java.util.function.Consumer
JDoubleBinaryOperator = interface;//java.util.function.DoubleBinaryOperator
JDoubleConsumer = interface;//java.util.function.DoubleConsumer
JDoubleFunction = interface;//java.util.function.DoubleFunction
JDoublePredicate = interface;//java.util.function.DoublePredicate
JDoubleSupplier = interface;//java.util.function.DoubleSupplier
JDoubleToIntFunction = interface;//java.util.function.DoubleToIntFunction
JDoubleToLongFunction = interface;//java.util.function.DoubleToLongFunction
JDoubleUnaryOperator = interface;//java.util.function.DoubleUnaryOperator
JFunction = interface;//java.util.function.Function
JIntBinaryOperator = interface;//java.util.function.IntBinaryOperator
JIntConsumer = interface;//java.util.function.IntConsumer
JIntFunction = interface;//java.util.function.IntFunction
JIntPredicate = interface;//java.util.function.IntPredicate
JIntSupplier = interface;//java.util.function.IntSupplier
JIntToDoubleFunction = interface;//java.util.function.IntToDoubleFunction
JIntToLongFunction = interface;//java.util.function.IntToLongFunction
JIntUnaryOperator = interface;//java.util.function.IntUnaryOperator
JLongBinaryOperator = interface;//java.util.function.LongBinaryOperator
JLongConsumer = interface;//java.util.function.LongConsumer
JLongFunction = interface;//java.util.function.LongFunction
JLongPredicate = interface;//java.util.function.LongPredicate
JLongSupplier = interface;//java.util.function.LongSupplier
JLongToDoubleFunction = interface;//java.util.function.LongToDoubleFunction
JLongToIntFunction = interface;//java.util.function.LongToIntFunction
JLongUnaryOperator = interface;//java.util.function.LongUnaryOperator
JObjDoubleConsumer = interface;//java.util.function.ObjDoubleConsumer
JObjIntConsumer = interface;//java.util.function.ObjIntConsumer
JObjLongConsumer = interface;//java.util.function.ObjLongConsumer
Jfunction_Predicate = interface;//java.util.function.Predicate
JSupplier = interface;//java.util.function.Supplier
JToDoubleFunction = interface;//java.util.function.ToDoubleFunction
JToIntFunction = interface;//java.util.function.ToIntFunction
JToLongFunction = interface;//java.util.function.ToLongFunction
JUnaryOperator = interface;//java.util.function.UnaryOperator
JBaseStream = interface;//java.util.stream.BaseStream
JCollector = interface;//java.util.stream.Collector
JCollector_Characteristics = interface;//java.util.stream.Collector$Characteristics
JDoubleStream = interface;//java.util.stream.DoubleStream
JDoubleStream_Builder = interface;//java.util.stream.DoubleStream$Builder
JIntStream = interface;//java.util.stream.IntStream
JIntStream_Builder = interface;//java.util.stream.IntStream$Builder
JLongStream = interface;//java.util.stream.LongStream
JLongStream_Builder = interface;//java.util.stream.LongStream$Builder
JStream = interface;//java.util.stream.Stream
JStream_Builder = interface;//java.util.stream.Stream$Builder
//JSecretKey = interface;//javax.crypto.SecretKey
JEGL = interface;//javax.microedition.khronos.egl.EGL
JEGL10 = interface;//javax.microedition.khronos.egl.EGL10
JEGLConfig = interface;//javax.microedition.khronos.egl.EGLConfig
JEGLContext = interface;//javax.microedition.khronos.egl.EGLContext
JEGLDisplay = interface;//javax.microedition.khronos.egl.EGLDisplay
JEGLSurface = interface;//javax.microedition.khronos.egl.EGLSurface
JGL = interface;//javax.microedition.khronos.opengles.GL
JGL10 = interface;//javax.microedition.khronos.opengles.GL10
JJSONArray = interface;//org.json.JSONArray
JJSONException = interface;//org.json.JSONException
JJSONObject = interface;//org.json.JSONObject
JJSONTokener = interface;//org.json.JSONTokener
JXmlPullParser = interface;//org.xmlpull.v1.XmlPullParser
JXmlSerializer = interface;//org.xmlpull.v1.XmlSerializer
// ===== Interface declarations =====
JObjectClass = interface(IJavaClass)
['{83BD30EE-FE9B-470D-AD6C-23AEAABB7FFA}']
{class} function init: JObject; cdecl;
end;
[JavaSignature('java/lang/Object')]
JObject = interface(IJavaInstance)
['{32321F8A-4001-4BF8-92E7-6190D070988D}']
function equals(obj: JObject): Boolean; cdecl;
function getClass: Jlang_Class; cdecl;
function hashCode: Integer; cdecl;
procedure notify; cdecl;
procedure notifyAll; cdecl;
function toString: JString; cdecl;
procedure wait(millis: Int64); cdecl; overload;
procedure wait(millis: Int64; nanos: Integer); cdecl; overload;
procedure wait; cdecl; overload;
end;
TJObject = class(TJavaGenericImport<JObjectClass, JObject>) end;
JInputStreamClass = interface(JObjectClass)
['{8D8C2F8A-AD54-42D0-ADA4-FC30FD95A933}']
{class} function init: JInputStream; cdecl;
end;
[JavaSignature('java/io/InputStream')]
JInputStream = interface(JObject)
['{5FD3C203-8A19-42A2-8FD2-643501DF62BC}']
function available: Integer; cdecl;
procedure close; cdecl;
procedure mark(readlimit: Integer); cdecl;
function markSupported: Boolean; cdecl;
function read: Integer; cdecl; overload;
function read(b: TJavaArray<Byte>): Integer; cdecl; overload;
function read(b: TJavaArray<Byte>; off: Integer; len: Integer): Integer; cdecl; overload;
procedure reset; cdecl;
function skip(n: Int64): Int64; cdecl;
end;
TJInputStream = class(TJavaGenericImport<JInputStreamClass, JInputStream>) end;
JByteArrayInputStreamClass = interface(JInputStreamClass)
['{1C0763C7-3F23-4531-A6E1-65AF97251C2F}']
{class} function init(buf: TJavaArray<Byte>): JByteArrayInputStream; cdecl; overload;
{class} function init(buf: TJavaArray<Byte>; offset: Integer; length: Integer): JByteArrayInputStream; cdecl; overload;
end;
[JavaSignature('java/io/ByteArrayInputStream')]
JByteArrayInputStream = interface(JInputStream)
['{D8AE245D-6831-48AC-A6F5-1E480815A22D}']
function available: Integer; cdecl;
procedure close; cdecl;
procedure mark(readAheadLimit: Integer); cdecl;
function markSupported: Boolean; cdecl;
function read: Integer; cdecl; overload;
function read(b: TJavaArray<Byte>; off: Integer; len: Integer): Integer; cdecl; overload;
procedure reset; cdecl;
function skip(n: Int64): Int64; cdecl;
end;
TJByteArrayInputStream = class(TJavaGenericImport<JByteArrayInputStreamClass, JByteArrayInputStream>) end;
JOutputStreamClass = interface(JObjectClass)
['{769D969C-3DFB-417B-8B7E-AA5662FB1539}']
{class} function init: JOutputStream; cdecl;
end;
[JavaSignature('java/io/OutputStream')]
JOutputStream = interface(JObject)
['{308A10DA-ACF9-4EC3-B4BD-D9F9CEEB29A5}']
procedure close; cdecl;
procedure flush; cdecl;
procedure write(b: Integer); cdecl; overload;
procedure write(b: TJavaArray<Byte>); cdecl; overload;
procedure write(b: TJavaArray<Byte>; off: Integer; len: Integer); cdecl; overload;
end;
TJOutputStream = class(TJavaGenericImport<JOutputStreamClass, JOutputStream>) end;
JByteArrayOutputStreamClass = interface(JOutputStreamClass)
['{2F08E462-5F49-4A89-9ACD-F0A5CD01C3A8}']
{class} function init: JByteArrayOutputStream; cdecl; overload;
{class} function init(size: Integer): JByteArrayOutputStream; cdecl; overload;
end;
[JavaSignature('java/io/ByteArrayOutputStream')]
JByteArrayOutputStream = interface(JOutputStream)
['{6AD653C4-3A67-4CCD-9B53-2E57D0DC0727}']
procedure close; cdecl;
procedure reset; cdecl;
function size: Integer; cdecl;
function toByteArray: TJavaArray<Byte>; cdecl;
function toString: JString; cdecl; overload;
function toString(charsetName: JString): JString; cdecl; overload;
function toString(hibyte: Integer): JString; cdecl; overload;//Deprecated
procedure write(b: Integer); cdecl; overload;
procedure write(b: TJavaArray<Byte>; off: Integer; len: Integer); cdecl; overload;
procedure writeTo(out_: JOutputStream); cdecl;
end;
TJByteArrayOutputStream = class(TJavaGenericImport<JByteArrayOutputStreamClass, JByteArrayOutputStream>) end;
JAutoCloseableClass = interface(IJavaClass)
['{BC0BF424-12A8-4AA4-ABC4-29A2BCE762E3}']
end;
[JavaSignature('java/lang/AutoCloseable')]
JAutoCloseable = interface(IJavaInstance)
['{48D31CFB-52DE-4C24-985E-3601B839C436}']
procedure close; cdecl;
end;
TJAutoCloseable = class(TJavaGenericImport<JAutoCloseableClass, JAutoCloseable>) end;
JCloseableClass = interface(JAutoCloseableClass)
['{CAFF3044-E3EC-444F-AF50-403A65BFA20B}']
end;
[JavaSignature('java/io/Closeable')]
JCloseable = interface(JAutoCloseable)
['{DD3E86BD-46E1-44D8-84DD-B7607A3F9C56}']
procedure close; cdecl;
end;
TJCloseable = class(TJavaGenericImport<JCloseableClass, JCloseable>) end;
JFileClass = interface(JObjectClass)
['{D2CE81B7-01CE-468B-A2F2-B85DD35642EC}']
{class} function _GetpathSeparator: JString; cdecl;
{class} function _GetpathSeparatorChar: Char; cdecl;
{class} function _Getseparator: JString; cdecl;
{class} function _GetseparatorChar: Char; cdecl;
{class} function init(pathname: JString): JFile; cdecl; overload;
{class} function init(parent: JString; child: JString): JFile; cdecl; overload;
{class} function init(parent: JFile; child: JString): JFile; cdecl; overload;
{class} //function init(uri: JURI): JFile; cdecl; overload;
{class} function createTempFile(prefix: JString; suffix: JString; directory: JFile): JFile; cdecl; overload;
{class} function createTempFile(prefix: JString; suffix: JString): JFile; cdecl; overload;
{class} function listRoots: TJavaObjectArray<JFile>; cdecl;
{class} property pathSeparator: JString read _GetpathSeparator;
{class} property pathSeparatorChar: Char read _GetpathSeparatorChar;
{class} property separator: JString read _Getseparator;
{class} property separatorChar: Char read _GetseparatorChar;
end;
[JavaSignature('java/io/File')]
JFile = interface(JObject)
['{38C3EB7E-315A-47D2-9052-1E61170EB37F}']
function canExecute: Boolean; cdecl;
function canRead: Boolean; cdecl;
function canWrite: Boolean; cdecl;
function compareTo(pathname: JFile): Integer; cdecl;
function createNewFile: Boolean; cdecl;
function delete: Boolean; cdecl;
procedure deleteOnExit; cdecl;
function equals(obj: JObject): Boolean; cdecl;
function exists: Boolean; cdecl;
function getAbsoluteFile: JFile; cdecl;
function getAbsolutePath: JString; cdecl;
function getCanonicalFile: JFile; cdecl;
function getCanonicalPath: JString; cdecl;
function getFreeSpace: Int64; cdecl;
function getName: JString; cdecl;
function getParent: JString; cdecl;
function getParentFile: JFile; cdecl;
function getPath: JString; cdecl;
function getTotalSpace: Int64; cdecl;
function getUsableSpace: Int64; cdecl;
function hashCode: Integer; cdecl;
function isAbsolute: Boolean; cdecl;
function isDirectory: Boolean; cdecl;
function isFile: Boolean; cdecl;
function isHidden: Boolean; cdecl;
function lastModified: Int64; cdecl;
function length: Int64; cdecl;
function list: TJavaObjectArray<JString>; cdecl; overload;
function list(filter: JFilenameFilter): TJavaObjectArray<JString>; cdecl; overload;
function listFiles: TJavaObjectArray<JFile>; cdecl; overload;
function listFiles(filter: JFilenameFilter): TJavaObjectArray<JFile>; cdecl; overload;
function listFiles(filter: JFileFilter): TJavaObjectArray<JFile>; cdecl; overload;
function mkdir: Boolean; cdecl;
function mkdirs: Boolean; cdecl;
function renameTo(dest: JFile): Boolean; cdecl;
function setExecutable(executable: Boolean; ownerOnly: Boolean): Boolean; cdecl; overload;
function setExecutable(executable: Boolean): Boolean; cdecl; overload;
function setLastModified(time: Int64): Boolean; cdecl;
function setReadOnly: Boolean; cdecl;
function setReadable(readable: Boolean; ownerOnly: Boolean): Boolean; cdecl; overload;
function setReadable(readable: Boolean): Boolean; cdecl; overload;
function setWritable(writable: Boolean; ownerOnly: Boolean): Boolean; cdecl; overload;
function setWritable(writable: Boolean): Boolean; cdecl; overload;
function toPath: Jfile_Path; cdecl;
function toString: JString; cdecl;
//function toURI: JURI; cdecl;
//function toURL: JURL; cdecl;//Deprecated
end;
TJFile = class(TJavaGenericImport<JFileClass, JFile>) end;
JFileDescriptorClass = interface(JObjectClass)
['{B01F2343-4F8E-4FF8-838E-8FB9CFE304E2}']
{class} function _Geterr: JFileDescriptor; cdecl;
{class} function _Getin: JFileDescriptor; cdecl;
{class} function _Getout: JFileDescriptor; cdecl;
{class} function init: JFileDescriptor; cdecl;
{class} property err: JFileDescriptor read _Geterr;
{class} property &in: JFileDescriptor read _Getin;
{class} property &out: JFileDescriptor read _Getout;
end;
[JavaSignature('java/io/FileDescriptor')]
JFileDescriptor = interface(JObject)
['{B6D7B003-DD99-4563-93A3-F902501CD6C1}']
procedure sync; cdecl;
function valid: Boolean; cdecl;
end;
TJFileDescriptor = class(TJavaGenericImport<JFileDescriptorClass, JFileDescriptor>) end;
JFileFilterClass = interface(IJavaClass)
['{74779212-F9FA-40FE-A5C2-41FBC7919220}']
end;
[JavaSignature('java/io/FileFilter')]
JFileFilter = interface(IJavaInstance)
['{5A5564B5-D25E-4D6A-AF92-F0725E9011DE}']
function accept(pathname: JFile): Boolean; cdecl;
end;
TJFileFilter = class(TJavaGenericImport<JFileFilterClass, JFileFilter>) end;
JFileInputStreamClass = interface(JInputStreamClass)
['{A1EB6AE5-8562-4E38-8182-61F57E51733A}']
{class} function init(name: JString): JFileInputStream; cdecl; overload;
{class} function init(file_: JFile): JFileInputStream; cdecl; overload;
{class} function init(fdObj: JFileDescriptor): JFileInputStream; cdecl; overload;
end;
[JavaSignature('java/io/FileInputStream')]
JFileInputStream = interface(JInputStream)
['{55CBCA4D-B04C-442A-BD74-ADFFD715A1A5}']
function available: Integer; cdecl;
procedure close; cdecl;
function getChannel: JFileChannel; cdecl;
function getFD: JFileDescriptor; cdecl;
function read: Integer; cdecl; overload;
function read(b: TJavaArray<Byte>): Integer; cdecl; overload;
function read(b: TJavaArray<Byte>; off: Integer; len: Integer): Integer; cdecl; overload;
function skip(n: Int64): Int64; cdecl;
end;
TJFileInputStream = class(TJavaGenericImport<JFileInputStreamClass, JFileInputStream>) end;
JFileOutputStreamClass = interface(JOutputStreamClass)
['{4808736C-4C9B-46DF-A1B6-EB94324D9666}']
{class} function init(name: JString): JFileOutputStream; cdecl; overload;
{class} function init(name: JString; append: Boolean): JFileOutputStream; cdecl; overload;
{class} function init(file_: JFile): JFileOutputStream; cdecl; overload;
{class} function init(file_: JFile; append: Boolean): JFileOutputStream; cdecl; overload;
{class} function init(fdObj: JFileDescriptor): JFileOutputStream; cdecl; overload;
end;
[JavaSignature('java/io/FileOutputStream')]
JFileOutputStream = interface(JOutputStream)
['{3D49DAFB-A222-4001-9DBE-7FAE66E23404}']
procedure close; cdecl;
function getChannel: JFileChannel; cdecl;
function getFD: JFileDescriptor; cdecl;
procedure write(b: Integer); cdecl; overload;
procedure write(b: TJavaArray<Byte>); cdecl; overload;
procedure write(b: TJavaArray<Byte>; off: Integer; len: Integer); cdecl; overload;
end;
TJFileOutputStream = class(TJavaGenericImport<JFileOutputStreamClass, JFileOutputStream>) end;
JFilenameFilterClass = interface(IJavaClass)
['{E466E540-E65D-43EC-8913-E8F8AEEA354F}']
end;
[JavaSignature('java/io/FilenameFilter')]
JFilenameFilter = interface(IJavaInstance)
['{B55A4F67-1AE9-41F5-BCF8-305D3902A782}']
function accept(dir: JFile; name: JString): Boolean; cdecl;
end;
TJFilenameFilter = class(TJavaGenericImport<JFilenameFilterClass, JFilenameFilter>) end;
JFilterOutputStreamClass = interface(JOutputStreamClass)
['{4273682E-2DA8-4BA9-BFC7-A9356DC43D40}']
{class} function init(out_: JOutputStream): JFilterOutputStream; cdecl;
end;
[JavaSignature('java/io/FilterOutputStream')]
JFilterOutputStream = interface(JOutputStream)
['{B0DB7F97-9758-43B1-8FC4-19A12503CD3F}']
procedure close; cdecl;
procedure flush; cdecl;
procedure write(b: Integer); cdecl; overload;
procedure write(b: TJavaArray<Byte>); cdecl; overload;
procedure write(b: TJavaArray<Byte>; off: Integer; len: Integer); cdecl; overload;
end;
TJFilterOutputStream = class(TJavaGenericImport<JFilterOutputStreamClass, JFilterOutputStream>) end;
JThrowableClass = interface(JObjectClass)
['{9B871585-74E6-4B49-B4C2-4DB387B0E599}']
{class} function init: JThrowable; cdecl; overload;
{class} function init(message: JString): JThrowable; cdecl; overload;
{class} function init(message: JString; cause: JThrowable): JThrowable; cdecl; overload;
{class} function init(cause: JThrowable): JThrowable; cdecl; overload;
end;
[JavaSignature('java/lang/Throwable')]
JThrowable = interface(JObject)
['{44BECA0F-21B9-45A8-B21F-8806ABE80CE2}']
procedure addSuppressed(exception: JThrowable); cdecl;
function fillInStackTrace: JThrowable; cdecl;
function getCause: JThrowable; cdecl;
function getLocalizedMessage: JString; cdecl;
function getMessage: JString; cdecl;
function getStackTrace: TJavaObjectArray<JStackTraceElement>; cdecl;
function getSuppressed: TJavaObjectArray<JThrowable>; cdecl;
function initCause(cause: JThrowable): JThrowable; cdecl;
procedure printStackTrace; cdecl; overload;
procedure printStackTrace(s: JPrintStream); cdecl; overload;
procedure printStackTrace(s: JPrintWriter); cdecl; overload;
procedure setStackTrace(stackTrace: TJavaObjectArray<JStackTraceElement>); cdecl;
function toString: JString; cdecl;
end;
TJThrowable = class(TJavaGenericImport<JThrowableClass, JThrowable>) end;
JExceptionClass = interface(JThrowableClass)
['{6E1BA58E-A106-4CC0-A40C-99F4E1188B10}']
{class} function init: JException; cdecl; overload;
{class} function init(message: JString): JException; cdecl; overload;
{class} function init(message: JString; cause: JThrowable): JException; cdecl; overload;
{class} function init(cause: JThrowable): JException; cdecl; overload;
end;
[JavaSignature('java/lang/Exception')]
JException = interface(JThrowable)
['{6EA7D981-2F3C-44C4-B9D2-F581529C08E0}']
end;
TJException = class(TJavaGenericImport<JExceptionClass, JException>) end;
JIOExceptionClass = interface(JExceptionClass)
['{24D5DABE-094D-45DB-9F6A-A5AB51B47322}']
{class} function init: JIOException; cdecl; overload;
{class} function init(message: JString): JIOException; cdecl; overload;
{class} function init(message: JString; cause: JThrowable): JIOException; cdecl; overload;
{class} function init(cause: JThrowable): JIOException; cdecl; overload;
end;
[JavaSignature('java/io/IOException')]
JIOException = interface(JException)
['{7318D96A-B3D4-4168-BDAB-356A539E6399}']
end;
TJIOException = class(TJavaGenericImport<JIOExceptionClass, JIOException>) end;
JPrintStreamClass = interface(JFilterOutputStreamClass)
['{4B5683E3-32D0-4225-9A80-FB961D9B334F}']
{class} function init(out_: JOutputStream): JPrintStream; cdecl; overload;
{class} function init(out_: JOutputStream; autoFlush: Boolean): JPrintStream; cdecl; overload;
{class} function init(out_: JOutputStream; autoFlush: Boolean; encoding: JString): JPrintStream; cdecl; overload;
{class} function init(fileName: JString): JPrintStream; cdecl; overload;
{class} function init(fileName: JString; csn: JString): JPrintStream; cdecl; overload;
{class} function init(file_: JFile): JPrintStream; cdecl; overload;
{class} function init(file_: JFile; csn: JString): JPrintStream; cdecl; overload;
end;
[JavaSignature('java/io/PrintStream')]
JPrintStream = interface(JFilterOutputStream)
['{8B23171F-06EF-4D87-A463-863F687A7918}']
function append(csq: JCharSequence): JPrintStream; cdecl; overload;
function append(csq: JCharSequence; start: Integer; end_: Integer): JPrintStream; cdecl; overload;
function append(c: Char): JPrintStream; cdecl; overload;
function checkError: Boolean; cdecl;
procedure close; cdecl;
procedure flush; cdecl;
procedure print(b: Boolean); cdecl; overload;
procedure print(c: Char); cdecl; overload;
procedure print(i: Integer); cdecl; overload;
procedure print(l: Int64); cdecl; overload;
procedure print(f: Single); cdecl; overload;
procedure print(d: Double); cdecl; overload;
procedure print(s: TJavaArray<Char>); cdecl; overload;
procedure print(s: JString); cdecl; overload;
procedure print(obj: JObject); cdecl; overload;
procedure println; cdecl; overload;
procedure println(x: Boolean); cdecl; overload;
procedure println(x: Char); cdecl; overload;
procedure println(x: Integer); cdecl; overload;
procedure println(x: Int64); cdecl; overload;
procedure println(x: Single); cdecl; overload;
procedure println(x: Double); cdecl; overload;
procedure println(x: TJavaArray<Char>); cdecl; overload;
procedure println(x: JString); cdecl; overload;
procedure println(x: JObject); cdecl; overload;
procedure write(b: Integer); cdecl; overload;
procedure write(buf: TJavaArray<Byte>; off: Integer; len: Integer); cdecl; overload;
end;
TJPrintStream = class(TJavaGenericImport<JPrintStreamClass, JPrintStream>) end;
JWriterClass = interface(JObjectClass)
['{1B3FE1C9-6FF8-45AE-89D6-267E4CC1F003}']
end;
[JavaSignature('java/io/Writer')]
JWriter = interface(JObject)
['{50C5DAA8-B851-43A7-8FF9-E827DC14E67B}']
function append(csq: JCharSequence): JWriter; cdecl; overload;
function append(csq: JCharSequence; start: Integer; end_: Integer): JWriter; cdecl; overload;
function append(c: Char): JWriter; cdecl; overload;
procedure close; cdecl;
procedure flush; cdecl;
procedure write(c: Integer); cdecl; overload;
procedure write(cbuf: TJavaArray<Char>); cdecl; overload;
procedure write(cbuf: TJavaArray<Char>; off: Integer; len: Integer); cdecl; overload;
procedure write(str: JString); cdecl; overload;
procedure write(str: JString; off: Integer; len: Integer); cdecl; overload;
end;
TJWriter = class(TJavaGenericImport<JWriterClass, JWriter>) end;
JPrintWriterClass = interface(JWriterClass)
['{0176F2C9-CDCB-40D9-B26E-E983BE269B0D}']
{class} function init(out_: JWriter): JPrintWriter; cdecl; overload;
{class} function init(out_: JWriter; autoFlush: Boolean): JPrintWriter; cdecl; overload;
{class} function init(out_: JOutputStream): JPrintWriter; cdecl; overload;
{class} function init(out_: JOutputStream; autoFlush: Boolean): JPrintWriter; cdecl; overload;
{class} function init(fileName: JString): JPrintWriter; cdecl; overload;
{class} function init(fileName: JString; csn: JString): JPrintWriter; cdecl; overload;
{class} function init(file_: JFile): JPrintWriter; cdecl; overload;
{class} function init(file_: JFile; csn: JString): JPrintWriter; cdecl; overload;
end;
[JavaSignature('java/io/PrintWriter')]
JPrintWriter = interface(JWriter)
['{1C7483CD-045F-4478-A223-A9FBBF9C1D80}']
function append(csq: JCharSequence): JPrintWriter; cdecl; overload;
function append(csq: JCharSequence; start: Integer; end_: Integer): JPrintWriter; cdecl; overload;
function append(c: Char): JPrintWriter; cdecl; overload;
function checkError: Boolean; cdecl;
procedure close; cdecl;
procedure flush; cdecl;
procedure print(b: Boolean); cdecl; overload;
procedure print(c: Char); cdecl; overload;
procedure print(i: Integer); cdecl; overload;
procedure print(l: Int64); cdecl; overload;
procedure print(f: Single); cdecl; overload;
procedure print(d: Double); cdecl; overload;
procedure print(s: TJavaArray<Char>); cdecl; overload;
procedure print(s: JString); cdecl; overload;
procedure print(obj: JObject); cdecl; overload;
procedure println; cdecl; overload;
procedure println(x: Boolean); cdecl; overload;
procedure println(x: Char); cdecl; overload;
procedure println(x: Integer); cdecl; overload;
procedure println(x: Int64); cdecl; overload;
procedure println(x: Single); cdecl; overload;
procedure println(x: Double); cdecl; overload;
procedure println(x: TJavaArray<Char>); cdecl; overload;
procedure println(x: JString); cdecl; overload;
procedure println(x: JObject); cdecl; overload;
procedure write(c: Integer); cdecl; overload;
procedure write(buf: TJavaArray<Char>; off: Integer; len: Integer); cdecl; overload;
procedure write(buf: TJavaArray<Char>); cdecl; overload;
procedure write(s: JString; off: Integer; len: Integer); cdecl; overload;
procedure write(s: JString); cdecl; overload;
end;
TJPrintWriter = class(TJavaGenericImport<JPrintWriterClass, JPrintWriter>) end;
JRandomAccessFileClass = interface(JObjectClass)
['{A3AAF4BA-F473-4135-AF7F-13B89D0BA76A}']
{class} function init(name: JString; mode: JString): JRandomAccessFile; cdecl; overload;
{class} function init(file_: JFile; mode: JString): JRandomAccessFile; cdecl; overload;
end;
[JavaSignature('java/io/RandomAccessFile')]
JRandomAccessFile = interface(JObject)
['{59DD1A15-35C5-456F-BBE2-61B628DAE3DB}']
procedure close; cdecl;
function getChannel: JFileChannel; cdecl;
function getFD: JFileDescriptor; cdecl;
function getFilePointer: Int64; cdecl;
function length: Int64; cdecl;
function read: Integer; cdecl; overload;
function read(b: TJavaArray<Byte>; off: Integer; len: Integer): Integer; cdecl; overload;
function read(b: TJavaArray<Byte>): Integer; cdecl; overload;
function readBoolean: Boolean; cdecl;
function readByte: Byte; cdecl;
function readChar: Char; cdecl;
function readDouble: Double; cdecl;
function readFloat: Single; cdecl;
procedure readFully(b: TJavaArray<Byte>); cdecl; overload;
procedure readFully(b: TJavaArray<Byte>; off: Integer; len: Integer); cdecl; overload;
function readInt: Integer; cdecl;
function readLine: JString; cdecl;
function readLong: Int64; cdecl;
function readShort: SmallInt; cdecl;
function readUTF: JString; cdecl;
function readUnsignedByte: Integer; cdecl;
function readUnsignedShort: Integer; cdecl;
procedure seek(offset: Int64); cdecl;
procedure setLength(newLength: Int64); cdecl;
function skipBytes(n: Integer): Integer; cdecl;
procedure write(b: Integer); cdecl; overload;
procedure write(b: TJavaArray<Byte>); cdecl; overload;
procedure write(b: TJavaArray<Byte>; off: Integer; len: Integer); cdecl; overload;
procedure writeBoolean(v: Boolean); cdecl;
procedure writeByte(v: Integer); cdecl;
procedure writeBytes(s: JString); cdecl;
procedure writeChar(v: Integer); cdecl;
procedure writeChars(s: JString); cdecl;
procedure writeDouble(v: Double); cdecl;
procedure writeFloat(v: Single); cdecl;
procedure writeInt(v: Integer); cdecl;
procedure writeLong(v: Int64); cdecl;
procedure writeShort(v: Integer); cdecl;
procedure writeUTF(str: JString); cdecl;
end;
TJRandomAccessFile = class(TJavaGenericImport<JRandomAccessFileClass, JRandomAccessFile>) end;
JReaderClass = interface(JObjectClass)
['{C04A4F72-F3EC-4774-9336-AA82265956FF}']
end;
[JavaSignature('java/io/Reader')]
JReader = interface(JObject)
['{D163CFD3-9781-435C-8FF5-98667DCD8189}']
procedure close; cdecl;
procedure mark(readAheadLimit: Integer); cdecl;
function markSupported: Boolean; cdecl;
function read(target: JCharBuffer): Integer; cdecl; overload;
function read: Integer; cdecl; overload;
function read(cbuf: TJavaArray<Char>): Integer; cdecl; overload;
function read(cbuf: TJavaArray<Char>; off: Integer; len: Integer): Integer; cdecl; overload;
function ready: Boolean; cdecl;
procedure reset; cdecl;
function skip(n: Int64): Int64; cdecl;
end;
TJReader = class(TJavaGenericImport<JReaderClass, JReader>) end;
JSerializableClass = interface(IJavaClass)
['{BFE14BCE-11F1-41B5-A14F-3217521E82BA}']
end;
[JavaSignature('java/io/Serializable')]
JSerializable = interface(IJavaInstance)
['{D24AB8DC-4E6F-411D-9C40-2210F71A3B0D}']
end;
TJSerializable = class(TJavaGenericImport<JSerializableClass, JSerializable>) end;
JAbstractStringBuilderClass = interface(JObjectClass)
['{A3321EF2-EA76-44CD-90CE-DFDADB9936BD}']
end;
[JavaSignature('java/lang/AbstractStringBuilder')]
JAbstractStringBuilder = interface(JObject)
['{39A0E6C5-8F79-44ED-BECB-02252CA2F5C0}']
function capacity: Integer; cdecl;
function charAt(index: Integer): Char; cdecl;
function codePointAt(index: Integer): Integer; cdecl;
function codePointBefore(index: Integer): Integer; cdecl;
function codePointCount(beginIndex: Integer; endIndex: Integer): Integer; cdecl;
procedure ensureCapacity(minimumCapacity: Integer); cdecl;
procedure getChars(srcBegin: Integer; srcEnd: Integer; dst: TJavaArray<Char>; dstBegin: Integer); cdecl;
function indexOf(str: JString): Integer; cdecl; overload;
function indexOf(str: JString; fromIndex: Integer): Integer; cdecl; overload;
function lastIndexOf(str: JString): Integer; cdecl; overload;
function lastIndexOf(str: JString; fromIndex: Integer): Integer; cdecl; overload;
function length: Integer; cdecl;
function offsetByCodePoints(index: Integer; codePointOffset: Integer): Integer; cdecl;
procedure setCharAt(index: Integer; ch: Char); cdecl;
procedure setLength(newLength: Integer); cdecl;
function subSequence(start: Integer; end_: Integer): JCharSequence; cdecl;
function substring(start: Integer): JString; cdecl; overload;
function substring(start: Integer; end_: Integer): JString; cdecl; overload;
function toString: JString; cdecl;
procedure trimToSize; cdecl;
end;
TJAbstractStringBuilder = class(TJavaGenericImport<JAbstractStringBuilderClass, JAbstractStringBuilder>) end;
JAppendableClass = interface(IJavaClass)
['{B34AA52A-C9D0-4E5C-AB21-D5D644536B6C}']
end;
[JavaSignature('java/lang/Appendable')]
JAppendable = interface(IJavaInstance)
['{A8613E4E-753A-417E-8F1C-0075F4F35D09}']
function append(csq: JCharSequence): JAppendable; cdecl; overload;
function append(csq: JCharSequence; start: Integer; end_: Integer): JAppendable; cdecl; overload;
function append(c: Char): JAppendable; cdecl; overload;
end;
TJAppendable = class(TJavaGenericImport<JAppendableClass, JAppendable>) end;
JBooleanClass = interface(JObjectClass)
['{CD51CE90-BCDA-4291-99B0-7BC70033C3CB}']
{class} function _GetFALSE: JBoolean; cdecl;
{class} function _GetTRUE: JBoolean; cdecl;
{class} function _GetTYPE: Jlang_Class; cdecl;
{class} function init(value: Boolean): JBoolean; cdecl; overload;
{class} function init(s: JString): JBoolean; cdecl; overload;
{class} function compare(x: Boolean; y: Boolean): Integer; cdecl;
{class} function getBoolean(name: JString): Boolean; cdecl;
{class} function hashCode(value: Boolean): Integer; cdecl; overload;
{class} function logicalAnd(a: Boolean; b: Boolean): Boolean; cdecl;
{class} function logicalOr(a: Boolean; b: Boolean): Boolean; cdecl;
{class} function logicalXor(a: Boolean; b: Boolean): Boolean; cdecl;
{class} function parseBoolean(s: JString): Boolean; cdecl;
{class} function toString(b: Boolean): JString; cdecl; overload;
{class} function valueOf(b: Boolean): JBoolean; cdecl; overload;
{class} function valueOf(s: JString): JBoolean; cdecl; overload;
{class} property FALSE: JBoolean read _GetFALSE;
{class} property TRUE: JBoolean read _GetTRUE;
{class} property &TYPE: Jlang_Class read _GetTYPE;
end;
[JavaSignature('java/lang/Boolean')]
JBoolean = interface(JObject)
['{21EAFAED-5848-48C2-9998-141B57439F6F}']
function booleanValue: Boolean; cdecl;
function compareTo(b: JBoolean): Integer; cdecl;
function equals(obj: JObject): Boolean; cdecl;
function hashCode: Integer; cdecl; overload;
function toString: JString; cdecl; overload;
end;
TJBoolean = class(TJavaGenericImport<JBooleanClass, JBoolean>) end;
JNumberClass = interface(JObjectClass)
['{9A30B143-2018-4C7B-9E9B-316F62D643C5}']
{class} function init: JNumber; cdecl;
end;
[JavaSignature('java/lang/Number')]
JNumber = interface(JObject)
['{DFF915A9-AFBE-4EDA-89AC-D0FE32A85482}']
function byteValue: Byte; cdecl;
function doubleValue: Double; cdecl;
function floatValue: Single; cdecl;
function intValue: Integer; cdecl;
function longValue: Int64; cdecl;
function shortValue: SmallInt; cdecl;
end;
TJNumber = class(TJavaGenericImport<JNumberClass, JNumber>) end;
JByteClass = interface(JNumberClass)
['{EDEFB599-A2A8-49AD-B413-C2FCEBD19B11}']
{class} function _GetBYTES: Integer; cdecl;
{class} function _GetMAX_VALUE: Byte; cdecl;
{class} function _GetMIN_VALUE: Byte; cdecl;
{class} function _GetSIZE: Integer; cdecl;
{class} function _GetTYPE: Jlang_Class; cdecl;
{class} function init(value: Byte): JByte; cdecl; overload;
{class} function init(s: JString): JByte; cdecl; overload;
{class} function compare(x: Byte; y: Byte): Integer; cdecl;
{class} function decode(nm: JString): JByte; cdecl;
{class} function hashCode(value: Byte): Integer; cdecl; overload;
{class} function parseByte(s: JString; radix: Integer): Byte; cdecl; overload;
{class} function parseByte(s: JString): Byte; cdecl; overload;
{class} function toString(b: Byte): JString; cdecl; overload;
{class} function toUnsignedInt(x: Byte): Integer; cdecl;
{class} function toUnsignedLong(x: Byte): Int64; cdecl;
{class} function valueOf(b: Byte): JByte; cdecl; overload;
{class} function valueOf(s: JString; radix: Integer): JByte; cdecl; overload;
{class} function valueOf(s: JString): JByte; cdecl; overload;
{class} property BYTES: Integer read _GetBYTES;
{class} property MAX_VALUE: Byte read _GetMAX_VALUE;
{class} property MIN_VALUE: Byte read _GetMIN_VALUE;
{class} property SIZE: Integer read _GetSIZE;
{class} property &TYPE: Jlang_Class read _GetTYPE;
end;
[JavaSignature('java/lang/Byte')]
JByte = interface(JNumber)
['{882439AC-111F-445F-B6CD-2E1E8D793CDE}']
function byteValue: Byte; cdecl;
function compareTo(anotherByte: JByte): Integer; cdecl;
function doubleValue: Double; cdecl;
function equals(obj: JObject): Boolean; cdecl;
function floatValue: Single; cdecl;
function hashCode: Integer; cdecl; overload;
function intValue: Integer; cdecl;
function longValue: Int64; cdecl;
function shortValue: SmallInt; cdecl;
function toString: JString; cdecl; overload;
end;
TJByte = class(TJavaGenericImport<JByteClass, JByte>) end;
JCharSequenceClass = interface(IJavaClass)
['{85DCA69A-F296-4BB4-8FE2-5ECE0EBE6611}']
end;
[JavaSignature('java/lang/CharSequence')]
JCharSequence = interface(IJavaInstance)
['{D026566C-D7C6-43E7-AECA-030E2C23A8B8}']
function charAt(index: Integer): Char; cdecl;
function chars: JIntStream; cdecl;
function codePoints: JIntStream; cdecl;
function length: Integer; cdecl;
function subSequence(start: Integer; end_: Integer): JCharSequence; cdecl;
function toString: JString; cdecl;
end;
TJCharSequence = class(TJavaGenericImport<JCharSequenceClass, JCharSequence>) end;
Jlang_ClassClass = interface(JObjectClass)
['{E1A7F20A-FD87-4D67-9469-7492FD97D55D}']
{class} function forName(className: JString): Jlang_Class; cdecl; overload;
{class} function forName(name: JString; initialize: Boolean; loader: JClassLoader): Jlang_Class; cdecl; overload;
end;
[JavaSignature('java/lang/Class')]
Jlang_Class = interface(JObject)
['{B056EDE6-77D8-4CDD-9864-147C201FD87C}']
function asSubclass(clazz: Jlang_Class): Jlang_Class; cdecl;
function cast(obj: JObject): JObject; cdecl;
function desiredAssertionStatus: Boolean; cdecl;
function getAnnotation(annotationClass: Jlang_Class): JAnnotation; cdecl;
function getAnnotations: TJavaObjectArray<JAnnotation>; cdecl;
function getAnnotationsByType(annotationClass: Jlang_Class): TJavaObjectArray<JAnnotation>; cdecl;
function getCanonicalName: JString; cdecl;
function getClassLoader: JClassLoader; cdecl;
function getClasses: TJavaObjectArray<Jlang_Class>; cdecl;
function getComponentType: Jlang_Class; cdecl;
function getConstructors: TJavaObjectArray<JConstructor>; cdecl;
function getDeclaredAnnotation(annotationClass: Jlang_Class): JAnnotation; cdecl;
function getDeclaredAnnotations: TJavaObjectArray<JAnnotation>; cdecl;
function getDeclaredClasses: TJavaObjectArray<Jlang_Class>; cdecl;
function getDeclaredConstructors: TJavaObjectArray<JConstructor>; cdecl;
function getDeclaredField(name: JString): JField; cdecl;
function getDeclaredFields: TJavaObjectArray<JField>; cdecl;
function getDeclaredMethods: TJavaObjectArray<JMethod>; cdecl;
function getDeclaringClass: Jlang_Class; cdecl;
function getEnclosingClass: Jlang_Class; cdecl;
function getEnclosingConstructor: JConstructor; cdecl;
function getEnclosingMethod: JMethod; cdecl;
function getEnumConstants: TJavaObjectArray<JObject>; cdecl;
function getField(name: JString): JField; cdecl;
function getFields: TJavaObjectArray<JField>; cdecl;
function getGenericInterfaces: TJavaObjectArray<Jreflect_Type>; cdecl;
function getGenericSuperclass: Jreflect_Type; cdecl;
function getInterfaces: TJavaObjectArray<Jlang_Class>; cdecl;
function getMethods: TJavaObjectArray<JMethod>; cdecl;
function getModifiers: Integer; cdecl;
function getName: JString; cdecl;
function getPackage: JPackage; cdecl;
//function getProtectionDomain: JProtectionDomain; cdecl;
//function getResource(name: JString): JURL; cdecl;
function getResourceAsStream(name: JString): JInputStream; cdecl;
function getSigners: TJavaObjectArray<JObject>; cdecl;
function getSimpleName: JString; cdecl;
function getSuperclass: Jlang_Class; cdecl;
function getTypeName: JString; cdecl;
function getTypeParameters: TJavaObjectArray<JTypeVariable>; cdecl;
function isAnnotation: Boolean; cdecl;
function isAnnotationPresent(annotationClass: Jlang_Class): Boolean; cdecl;
function isAnonymousClass: Boolean; cdecl;
function isArray: Boolean; cdecl;
function isAssignableFrom(cls: Jlang_Class): Boolean; cdecl;
function isEnum: Boolean; cdecl;
function isInstance(obj: JObject): Boolean; cdecl;
function isInterface: Boolean; cdecl;
function isLocalClass: Boolean; cdecl;
function isMemberClass: Boolean; cdecl;
function isPrimitive: Boolean; cdecl;
function isSynthetic: Boolean; cdecl;
function newInstance: JObject; cdecl;
function toGenericString: JString; cdecl;
function toString: JString; cdecl;
end;
TJlang_Class = class(TJavaGenericImport<Jlang_ClassClass, Jlang_Class>) end;
JClassLoaderClass = interface(JObjectClass)
['{453BE0D7-B813-4C83-A30C-F24C026FD112}']
{class} function getSystemClassLoader: JClassLoader; cdecl;
{class} //function getSystemResource(name: JString): JURL; cdecl;
{class} function getSystemResourceAsStream(name: JString): JInputStream; cdecl;
{class} function getSystemResources(name: JString): JEnumeration; cdecl;
end;
[JavaSignature('java/lang/ClassLoader')]
JClassLoader = interface(JObject)
['{17B43D0A-2016-44ED-84B5-9EAB55AF8FDD}']
procedure clearAssertionStatus; cdecl;
function getParent: JClassLoader; cdecl;
//function getResource(name: JString): JURL; cdecl;
function getResourceAsStream(name: JString): JInputStream; cdecl;
function getResources(name: JString): JEnumeration; cdecl;
function loadClass(name: JString): Jlang_Class; cdecl;
procedure setClassAssertionStatus(className: JString; enabled: Boolean); cdecl;
procedure setDefaultAssertionStatus(enabled: Boolean); cdecl;
procedure setPackageAssertionStatus(packageName: JString; enabled: Boolean); cdecl;
end;
TJClassLoader = class(TJavaGenericImport<JClassLoaderClass, JClassLoader>) end;
JCloneableClass = interface(IJavaClass)
['{0E9E456D-6AA1-4C39-8466-0FC2809B0004}']
end;
[JavaSignature('java/lang/Cloneable')]
JCloneable = interface(IJavaInstance)
['{44D68986-0DF0-43AF-8D4C-3AB3381328CF}']
end;
TJCloneable = class(TJavaGenericImport<JCloneableClass, JCloneable>) end;
JComparableClass = interface(IJavaClass)
['{919AEA14-2451-4CFB-BFAB-387DB8BBE854}']
end;
[JavaSignature('java/lang/Comparable')]
JComparable = interface(IJavaInstance)
['{AE58973C-F988-4AA5-969C-EBB4E2515276}']
function compareTo(o: JObject): Integer; cdecl;
end;
TJComparable = class(TJavaGenericImport<JComparableClass, JComparable>) end;
JDoubleClass = interface(JNumberClass)
['{1B133955-7ECE-4429-97CD-9118396AC3AE}']
{class} function _GetBYTES: Integer; cdecl;
{class} function _GetMAX_EXPONENT: Integer; cdecl;
{class} function _GetMAX_VALUE: Double; cdecl;
{class} function _GetMIN_EXPONENT: Integer; cdecl;
{class} function _GetMIN_NORMAL: Double; cdecl;
{class} function _GetMIN_VALUE: Double; cdecl;
{class} function _GetNEGATIVE_INFINITY: Double; cdecl;
{class} function _GetNaN: Double; cdecl;
{class} function _GetPOSITIVE_INFINITY: Double; cdecl;
{class} function _GetSIZE: Integer; cdecl;
{class} function _GetTYPE: Jlang_Class; cdecl;
{class} function init(value: Double): JDouble; cdecl; overload;
{class} function init(s: JString): JDouble; cdecl; overload;
{class} function compare(d1: Double; d2: Double): Integer; cdecl;
{class} function doubleToLongBits(value: Double): Int64; cdecl;
{class} function doubleToRawLongBits(value: Double): Int64; cdecl;
{class} function hashCode(value: Double): Integer; cdecl; overload;
{class} function isFinite(d: Double): Boolean; cdecl;
{class} function isInfinite(v: Double): Boolean; cdecl; overload;
{class} function isNaN(v: Double): Boolean; cdecl; overload;
{class} function longBitsToDouble(bits: Int64): Double; cdecl;
{class} function max(a: Double; b: Double): Double; cdecl;
{class} function min(a: Double; b: Double): Double; cdecl;
{class} function parseDouble(s: JString): Double; cdecl;
{class} function sum(a: Double; b: Double): Double; cdecl;
{class} function toHexString(d: Double): JString; cdecl;
{class} function toString(d: Double): JString; cdecl; overload;
{class} function valueOf(s: JString): JDouble; cdecl; overload;
{class} function valueOf(d: Double): JDouble; cdecl; overload;
{class} property BYTES: Integer read _GetBYTES;
{class} property MAX_EXPONENT: Integer read _GetMAX_EXPONENT;
{class} property MAX_VALUE: Double read _GetMAX_VALUE;
{class} property MIN_EXPONENT: Integer read _GetMIN_EXPONENT;
{class} property MIN_NORMAL: Double read _GetMIN_NORMAL;
{class} property MIN_VALUE: Double read _GetMIN_VALUE;
{class} property NEGATIVE_INFINITY: Double read _GetNEGATIVE_INFINITY;
{class} property NaN: Double read _GetNaN;
{class} property POSITIVE_INFINITY: Double read _GetPOSITIVE_INFINITY;
{class} property SIZE: Integer read _GetSIZE;
{class} property &TYPE: Jlang_Class read _GetTYPE;
end;
[JavaSignature('java/lang/Double')]
JDouble = interface(JNumber)
['{81639AF9-E21C-4CB0-99E6-1E7F013E11CC}']
function byteValue: Byte; cdecl;
function compareTo(anotherDouble: JDouble): Integer; cdecl;
function doubleValue: Double; cdecl;
function equals(obj: JObject): Boolean; cdecl;
function floatValue: Single; cdecl;
function hashCode: Integer; cdecl; overload;
function intValue: Integer; cdecl;
function isInfinite: Boolean; cdecl; overload;
function isNaN: Boolean; cdecl; overload;
function longValue: Int64; cdecl;
function shortValue: SmallInt; cdecl;
function toString: JString; cdecl; overload;
end;
TJDouble = class(TJavaGenericImport<JDoubleClass, JDouble>) end;
JEnumClass = interface(JObjectClass)
['{2DB4C98D-F244-4372-9487-E9B9E2F48391}']
{class} function valueOf(enumType: Jlang_Class; name: JString): JEnum; cdecl;
end;
[JavaSignature('java/lang/Enum')]
JEnum = interface(JObject)
['{0CFB5F00-FBF2-469D-806C-471A09BE1BAF}']
function compareTo(o: JEnum): Integer; cdecl;
function equals(other: JObject): Boolean; cdecl;
function getDeclaringClass: Jlang_Class; cdecl;
function hashCode: Integer; cdecl;
function name: JString; cdecl;
function ordinal: Integer; cdecl;
function toString: JString; cdecl;
end;
TJEnum = class(TJavaGenericImport<JEnumClass, JEnum>) end;
JFloatClass = interface(JNumberClass)
['{E2E64017-238D-4910-8DF8-BD66A034BDFE}']
{class} function _GetBYTES: Integer; cdecl;
{class} function _GetMAX_EXPONENT: Integer; cdecl;
{class} function _GetMAX_VALUE: Single; cdecl;
{class} function _GetMIN_EXPONENT: Integer; cdecl;
{class} function _GetMIN_NORMAL: Single; cdecl;
{class} function _GetMIN_VALUE: Single; cdecl;
{class} function _GetNEGATIVE_INFINITY: Single; cdecl;
{class} function _GetNaN: Single; cdecl;
{class} function _GetPOSITIVE_INFINITY: Single; cdecl;
{class} function _GetSIZE: Integer; cdecl;
{class} function _GetTYPE: Jlang_Class; cdecl;
{class} function init(value: Single): JFloat; cdecl; overload;
{class} function init(value: Double): JFloat; cdecl; overload;
{class} function init(s: JString): JFloat; cdecl; overload;
{class} function compare(f1: Single; f2: Single): Integer; cdecl;
{class} function floatToIntBits(value: Single): Integer; cdecl;
{class} function floatToRawIntBits(value: Single): Integer; cdecl;
{class} function hashCode(value: Single): Integer; cdecl; overload;
{class} function intBitsToFloat(bits: Integer): Single; cdecl;
{class} function isFinite(f: Single): Boolean; cdecl;
{class} function isInfinite(v: Single): Boolean; cdecl; overload;
{class} function isNaN(v: Single): Boolean; cdecl; overload;
{class} function max(a: Single; b: Single): Single; cdecl;
{class} function min(a: Single; b: Single): Single; cdecl;
{class} function parseFloat(s: JString): Single; cdecl;
{class} function sum(a: Single; b: Single): Single; cdecl;
{class} function toHexString(f: Single): JString; cdecl;
{class} function toString(f: Single): JString; cdecl; overload;
{class} function valueOf(s: JString): JFloat; cdecl; overload;
{class} function valueOf(f: Single): JFloat; cdecl; overload;
{class} property BYTES: Integer read _GetBYTES;
{class} property MAX_EXPONENT: Integer read _GetMAX_EXPONENT;
{class} property MAX_VALUE: Single read _GetMAX_VALUE;
{class} property MIN_EXPONENT: Integer read _GetMIN_EXPONENT;
{class} property MIN_NORMAL: Single read _GetMIN_NORMAL;
{class} property MIN_VALUE: Single read _GetMIN_VALUE;
{class} property NEGATIVE_INFINITY: Single read _GetNEGATIVE_INFINITY;
{class} property NaN: Single read _GetNaN;
{class} property POSITIVE_INFINITY: Single read _GetPOSITIVE_INFINITY;
{class} property SIZE: Integer read _GetSIZE;
{class} property &TYPE: Jlang_Class read _GetTYPE;
end;
[JavaSignature('java/lang/Float')]
JFloat = interface(JNumber)
['{F13BF843-909A-4866-918B-B1B2B1A8F483}']
function byteValue: Byte; cdecl;
function compareTo(anotherFloat: JFloat): Integer; cdecl;
function doubleValue: Double; cdecl;
function equals(obj: JObject): Boolean; cdecl;
function floatValue: Single; cdecl;
function hashCode: Integer; cdecl; overload;
function intValue: Integer; cdecl;
function isInfinite: Boolean; cdecl; overload;
function isNaN: Boolean; cdecl; overload;
function longValue: Int64; cdecl;
function shortValue: SmallInt; cdecl;
function toString: JString; cdecl; overload;
end;
TJFloat = class(TJavaGenericImport<JFloatClass, JFloat>) end;
JRuntimeExceptionClass = interface(JExceptionClass)
['{58C58616-58EF-4783-92DB-5AE4F2A079A7}']
{class} function init: JRuntimeException; cdecl; overload;
{class} function init(message: JString): JRuntimeException; cdecl; overload;
{class} function init(message: JString; cause: JThrowable): JRuntimeException; cdecl; overload;
{class} function init(cause: JThrowable): JRuntimeException; cdecl; overload;
end;
[JavaSignature('java/lang/RuntimeException')]
JRuntimeException = interface(JException)
['{7CEA4E55-B247-4073-A601-7C2C6D8BEE22}']
end;
TJRuntimeException = class(TJavaGenericImport<JRuntimeExceptionClass, JRuntimeException>) end;
JIllegalStateExceptionClass = interface(JRuntimeExceptionClass)
['{C0717EAB-C1D7-4E7A-A545-922D0CC4B532}']
{class} function init: JIllegalStateException; cdecl; overload;
{class} function init(s: JString): JIllegalStateException; cdecl; overload;
{class} function init(message: JString; cause: JThrowable): JIllegalStateException; cdecl; overload;
{class} function init(cause: JThrowable): JIllegalStateException; cdecl; overload;
end;
[JavaSignature('java/lang/IllegalStateException')]
JIllegalStateException = interface(JRuntimeException)
['{47074700-88B6-49D2-A5F3-43540D5B910D}']
end;
TJIllegalStateException = class(TJavaGenericImport<JIllegalStateExceptionClass, JIllegalStateException>) end;
JIntegerClass = interface(JNumberClass)
['{DA48E911-AB80-4875-993F-316B9F310559}']
{class} function _GetBYTES: Integer; cdecl;
{class} function _GetMAX_VALUE: Integer; cdecl;
{class} function _GetMIN_VALUE: Integer; cdecl;
{class} function _GetSIZE: Integer; cdecl;
{class} function _GetTYPE: Jlang_Class; cdecl;
{class} function init(value: Integer): JInteger; cdecl; overload;
{class} function init(s: JString): JInteger; cdecl; overload;
{class} function bitCount(i: Integer): Integer; cdecl;
{class} function compare(x: Integer; y: Integer): Integer; cdecl;
{class} function compareUnsigned(x: Integer; y: Integer): Integer; cdecl;
{class} function decode(nm: JString): JInteger; cdecl;
{class} function divideUnsigned(dividend: Integer; divisor: Integer): Integer; cdecl;
{class} function getInteger(nm: JString): JInteger; cdecl; overload;
{class} function getInteger(nm: JString; val: Integer): JInteger; cdecl; overload;
{class} function getInteger(nm: JString; val: JInteger): JInteger; cdecl; overload;
{class} function hashCode(value: Integer): Integer; cdecl; overload;
{class} function highestOneBit(i: Integer): Integer; cdecl;
{class} function lowestOneBit(i: Integer): Integer; cdecl;
{class} function max(a: Integer; b: Integer): Integer; cdecl;
{class} function min(a: Integer; b: Integer): Integer; cdecl;
{class} function numberOfLeadingZeros(i: Integer): Integer; cdecl;
{class} function numberOfTrailingZeros(i: Integer): Integer; cdecl;
{class} function parseInt(s: JString; radix: Integer): Integer; cdecl; overload;
{class} function parseInt(s: JString): Integer; cdecl; overload;
{class} function parseUnsignedInt(s: JString; radix: Integer): Integer; cdecl; overload;
{class} function parseUnsignedInt(s: JString): Integer; cdecl; overload;
{class} function remainderUnsigned(dividend: Integer; divisor: Integer): Integer; cdecl;
{class} function reverse(i: Integer): Integer; cdecl;
{class} function reverseBytes(i: Integer): Integer; cdecl;
{class} function rotateLeft(i: Integer; distance: Integer): Integer; cdecl;
{class} function rotateRight(i: Integer; distance: Integer): Integer; cdecl;
{class} function signum(i: Integer): Integer; cdecl;
{class} function sum(a: Integer; b: Integer): Integer; cdecl;
{class} function toBinaryString(i: Integer): JString; cdecl;
{class} function toHexString(i: Integer): JString; cdecl;
{class} function toOctalString(i: Integer): JString; cdecl;
{class} function toString(i: Integer; radix: Integer): JString; cdecl; overload;
{class} function toString(i: Integer): JString; cdecl; overload;
{class} function toUnsignedLong(x: Integer): Int64; cdecl;
{class} function toUnsignedString(i: Integer; radix: Integer): JString; cdecl; overload;
{class} function toUnsignedString(i: Integer): JString; cdecl; overload;
{class} function valueOf(s: JString; radix: Integer): JInteger; cdecl; overload;
{class} function valueOf(s: JString): JInteger; cdecl; overload;
{class} function valueOf(i: Integer): JInteger; cdecl; overload;
{class} property BYTES: Integer read _GetBYTES;
{class} property MAX_VALUE: Integer read _GetMAX_VALUE;
{class} property MIN_VALUE: Integer read _GetMIN_VALUE;
{class} property SIZE: Integer read _GetSIZE;
{class} property &TYPE: Jlang_Class read _GetTYPE;
end;
[JavaSignature('java/lang/Integer')]
JInteger = interface(JNumber)
['{A07D13BE-2418-4FCB-8CEB-F4160E5884D5}']
function byteValue: Byte; cdecl;
function compareTo(anotherInteger: JInteger): Integer; cdecl;
function doubleValue: Double; cdecl;
function equals(obj: JObject): Boolean; cdecl;
function floatValue: Single; cdecl;
function hashCode: Integer; cdecl; overload;
function intValue: Integer; cdecl;
function longValue: Int64; cdecl;
function shortValue: SmallInt; cdecl;
function toString: JString; cdecl; overload;
end;
TJInteger = class(TJavaGenericImport<JIntegerClass, JInteger>) end;
JIterableClass = interface(IJavaClass)
['{EEADA3A8-2116-491E-ACC7-21F84F84D65A}']
end;
[JavaSignature('java/lang/Iterable')]
JIterable = interface(IJavaInstance)
['{ABC85F3B-F161-4206-882A-FFD5F1DEFEA2}']
procedure forEach(action: JConsumer); cdecl;
function iterator: JIterator; cdecl;
function spliterator: JSpliterator; cdecl;
end;
TJIterable = class(TJavaGenericImport<JIterableClass, JIterable>) end;
JLongClass = interface(JNumberClass)
['{BA567CF5-58F3-41A7-BAA4-538606294DE9}']
{class} function _GetBYTES: Integer; cdecl;
{class} function _GetMAX_VALUE: Int64; cdecl;
{class} function _GetMIN_VALUE: Int64; cdecl;
{class} function _GetSIZE: Integer; cdecl;
{class} function _GetTYPE: Jlang_Class; cdecl;
{class} function init(value: Int64): JLong; cdecl; overload;
{class} function init(s: JString): JLong; cdecl; overload;
{class} function bitCount(i: Int64): Integer; cdecl;
{class} function compare(x: Int64; y: Int64): Integer; cdecl;
{class} function compareUnsigned(x: Int64; y: Int64): Integer; cdecl;
{class} function decode(nm: JString): JLong; cdecl;
{class} function divideUnsigned(dividend: Int64; divisor: Int64): Int64; cdecl;
{class} function getLong(nm: JString): JLong; cdecl; overload;
{class} function getLong(nm: JString; val: Int64): JLong; cdecl; overload;
{class} function getLong(nm: JString; val: JLong): JLong; cdecl; overload;
{class} function hashCode(value: Int64): Integer; cdecl; overload;
{class} function highestOneBit(i: Int64): Int64; cdecl;
{class} function lowestOneBit(i: Int64): Int64; cdecl;
{class} function max(a: Int64; b: Int64): Int64; cdecl;
{class} function min(a: Int64; b: Int64): Int64; cdecl;
{class} function numberOfLeadingZeros(i: Int64): Integer; cdecl;
{class} function numberOfTrailingZeros(i: Int64): Integer; cdecl;
{class} function parseLong(s: JString; radix: Integer): Int64; cdecl; overload;
{class} function parseLong(s: JString): Int64; cdecl; overload;
{class} function parseUnsignedLong(s: JString; radix: Integer): Int64; cdecl; overload;
{class} function parseUnsignedLong(s: JString): Int64; cdecl; overload;
{class} function remainderUnsigned(dividend: Int64; divisor: Int64): Int64; cdecl;
{class} function reverse(i: Int64): Int64; cdecl;
{class} function reverseBytes(i: Int64): Int64; cdecl;
{class} function rotateLeft(i: Int64; distance: Integer): Int64; cdecl;
{class} function rotateRight(i: Int64; distance: Integer): Int64; cdecl;
{class} function signum(i: Int64): Integer; cdecl;
{class} function sum(a: Int64; b: Int64): Int64; cdecl;
{class} function toBinaryString(i: Int64): JString; cdecl;
{class} function toHexString(i: Int64): JString; cdecl;
{class} function toOctalString(i: Int64): JString; cdecl;
{class} function toString(i: Int64; radix: Integer): JString; cdecl; overload;
{class} function toString(i: Int64): JString; cdecl; overload;
{class} function toUnsignedString(i: Int64; radix: Integer): JString; cdecl; overload;
{class} function toUnsignedString(i: Int64): JString; cdecl; overload;
{class} function valueOf(s: JString; radix: Integer): JLong; cdecl; overload;
{class} function valueOf(s: JString): JLong; cdecl; overload;
{class} function valueOf(l: Int64): JLong; cdecl; overload;
{class} property BYTES: Integer read _GetBYTES;
{class} property MAX_VALUE: Int64 read _GetMAX_VALUE;
{class} property MIN_VALUE: Int64 read _GetMIN_VALUE;
{class} property SIZE: Integer read _GetSIZE;
{class} property &TYPE: Jlang_Class read _GetTYPE;
end;
[JavaSignature('java/lang/Long')]
JLong = interface(JNumber)
['{F2E23531-34CC-4607-94D6-F85B4F95FB43}']
function byteValue: Byte; cdecl;
function compareTo(anotherLong: JLong): Integer; cdecl;
function doubleValue: Double; cdecl;
function equals(obj: JObject): Boolean; cdecl;
function floatValue: Single; cdecl;
function hashCode: Integer; cdecl; overload;
function intValue: Integer; cdecl;
function longValue: Int64; cdecl;
function shortValue: SmallInt; cdecl;
function toString: JString; cdecl; overload;
end;
TJLong = class(TJavaGenericImport<JLongClass, JLong>) end;
JPackageClass = interface(JObjectClass)
['{1FC1C1DD-321C-4601-8946-916E19BD67FA}']
{class} function getPackage(name: JString): JPackage; cdecl;
{class} function getPackages: TJavaObjectArray<JPackage>; cdecl;
end;
[JavaSignature('java/lang/Package')]
JPackage = interface(JObject)
['{E8F397DF-1FB0-4C08-B9CB-08C8B38917EE}']
function getAnnotation(annotationClass: Jlang_Class): JAnnotation; cdecl;
function getAnnotations: TJavaObjectArray<JAnnotation>; cdecl;
function getAnnotationsByType(annotationClass: Jlang_Class): TJavaObjectArray<JAnnotation>; cdecl;
function getDeclaredAnnotation(annotationClass: Jlang_Class): JAnnotation; cdecl;
function getDeclaredAnnotations: TJavaObjectArray<JAnnotation>; cdecl;
function getDeclaredAnnotationsByType(annotationClass: Jlang_Class): TJavaObjectArray<JAnnotation>; cdecl;
function getImplementationTitle: JString; cdecl;
function getImplementationVendor: JString; cdecl;
function getImplementationVersion: JString; cdecl;
function getName: JString; cdecl;
function getSpecificationTitle: JString; cdecl;
function getSpecificationVendor: JString; cdecl;
function getSpecificationVersion: JString; cdecl;
function hashCode: Integer; cdecl;
function isAnnotationPresent(annotationClass: Jlang_Class): Boolean; cdecl;
function isCompatibleWith(desired: JString): Boolean; cdecl;
function isSealed: Boolean; cdecl; overload;
//function isSealed(url: JURL): Boolean; cdecl; overload;
function toString: JString; cdecl;
end;
TJPackage = class(TJavaGenericImport<JPackageClass, JPackage>) end;
JRunnableClass = interface(IJavaClass)
['{49A6EA8E-0ADB-4D8E-8FA3-F13D4ADCF281}']
end;
[JavaSignature('java/lang/Runnable')]
JRunnable = interface(IJavaInstance)
['{BC131B27-7A72-4CAF-BB8E-170B8359B22E}']
procedure run; cdecl;
end;
TJRunnable = class(TJavaGenericImport<JRunnableClass, JRunnable>) end;
JShortClass = interface(JNumberClass)
['{FAD495F3-40B7-46DB-B3B6-8DBBD38D8E16}']
{class} function _GetBYTES: Integer; cdecl;
{class} function _GetMAX_VALUE: SmallInt; cdecl;
{class} function _GetMIN_VALUE: SmallInt; cdecl;
{class} function _GetSIZE: Integer; cdecl;
{class} function _GetTYPE: Jlang_Class; cdecl;
{class} function init(value: SmallInt): JShort; cdecl; overload;
{class} function init(s: JString): JShort; cdecl; overload;
{class} function compare(x: SmallInt; y: SmallInt): Integer; cdecl;
{class} function decode(nm: JString): JShort; cdecl;
{class} function hashCode(value: SmallInt): Integer; cdecl; overload;
{class} function parseShort(s: JString; radix: Integer): SmallInt; cdecl; overload;
{class} function parseShort(s: JString): SmallInt; cdecl; overload;
{class} function reverseBytes(i: SmallInt): SmallInt; cdecl;
{class} function toString(s: SmallInt): JString; cdecl; overload;
{class} function toUnsignedInt(x: SmallInt): Integer; cdecl;
{class} function toUnsignedLong(x: SmallInt): Int64; cdecl;
{class} function valueOf(s: JString; radix: Integer): JShort; cdecl; overload;
{class} function valueOf(s: JString): JShort; cdecl; overload;
{class} function valueOf(s: SmallInt): JShort; cdecl; overload;
{class} property BYTES: Integer read _GetBYTES;
{class} property MAX_VALUE: SmallInt read _GetMAX_VALUE;
{class} property MIN_VALUE: SmallInt read _GetMIN_VALUE;
{class} property SIZE: Integer read _GetSIZE;
{class} property &TYPE: Jlang_Class read _GetTYPE;
end;
[JavaSignature('java/lang/Short')]
JShort = interface(JNumber)
['{48D3B355-1222-4BD6-94BF-F40B5EE8EF02}']
function byteValue: Byte; cdecl;
function compareTo(anotherShort: JShort): Integer; cdecl;
function doubleValue: Double; cdecl;
function equals(obj: JObject): Boolean; cdecl;
function floatValue: Single; cdecl;
function hashCode: Integer; cdecl; overload;
function intValue: Integer; cdecl;
function longValue: Int64; cdecl;
function shortValue: SmallInt; cdecl;
function toString: JString; cdecl; overload;
end;
TJShort = class(TJavaGenericImport<JShortClass, JShort>) end;
JStackTraceElementClass = interface(JObjectClass)
['{21CBE31F-4A81-4CB3-ADB1-EA9B3166692E}']
{class} function init(declaringClass: JString; methodName: JString; fileName: JString; lineNumber: Integer): JStackTraceElement; cdecl;
end;
[JavaSignature('java/lang/StackTraceElement')]
JStackTraceElement = interface(JObject)
['{3304B89A-29EB-4B53-943F-E70F4252E8FF}']
function equals(obj: JObject): Boolean; cdecl;
function getClassName: JString; cdecl;
function getFileName: JString; cdecl;
function getLineNumber: Integer; cdecl;
function getMethodName: JString; cdecl;
function hashCode: Integer; cdecl;
function isNativeMethod: Boolean; cdecl;
function toString: JString; cdecl;
end;
TJStackTraceElement = class(TJavaGenericImport<JStackTraceElementClass, JStackTraceElement>) end;
JStringClass = interface(JObjectClass)
['{E61829D1-1FD3-49B2-BAC6-FB0FFDB1A495}']
{class} function _GetCASE_INSENSITIVE_ORDER: JComparator; cdecl;
{class} function init: JString; cdecl; overload;
{class} function init(original: JString): JString; cdecl; overload;
{class} function init(value: TJavaArray<Char>): JString; cdecl; overload;
{class} function init(value: TJavaArray<Char>; offset: Integer; count: Integer): JString; cdecl; overload;
{class} function init(codePoints: TJavaArray<Integer>; offset: Integer; count: Integer): JString; cdecl; overload;
{class} function init(ascii: TJavaArray<Byte>; hibyte: Integer; offset: Integer; count: Integer): JString; cdecl; overload;//Deprecated
{class} function init(ascii: TJavaArray<Byte>; hibyte: Integer): JString; cdecl; overload;//Deprecated
{class} function init(bytes: TJavaArray<Byte>; offset: Integer; length: Integer; charsetName: JString): JString; cdecl; overload;
{class} function init(bytes: TJavaArray<Byte>; offset: Integer; length: Integer; charset: JCharset): JString; cdecl; overload;
{class} function init(bytes: TJavaArray<Byte>; charsetName: JString): JString; cdecl; overload;
{class} function init(bytes: TJavaArray<Byte>; charset: JCharset): JString; cdecl; overload;
{class} function init(bytes: TJavaArray<Byte>; offset: Integer; length: Integer): JString; cdecl; overload;
{class} function init(bytes: TJavaArray<Byte>): JString; cdecl; overload;
{class} function init(buffer: JStringBuffer): JString; cdecl; overload;
{class} function init(builder: JStringBuilder): JString; cdecl; overload;
{class} function copyValueOf(data: TJavaArray<Char>; offset: Integer; count: Integer): JString; cdecl; overload;
{class} function copyValueOf(data: TJavaArray<Char>): JString; cdecl; overload;
{class} function join(delimiter: JCharSequence; elements: JIterable): JString; cdecl; overload;
{class} function valueOf(obj: JObject): JString; cdecl; overload;
{class} function valueOf(data: TJavaArray<Char>): JString; cdecl; overload;
{class} function valueOf(data: TJavaArray<Char>; offset: Integer; count: Integer): JString; cdecl; overload;
{class} function valueOf(b: Boolean): JString; cdecl; overload;
{class} function valueOf(c: Char): JString; cdecl; overload;
{class} function valueOf(i: Integer): JString; cdecl; overload;
{class} function valueOf(l: Int64): JString; cdecl; overload;
{class} function valueOf(f: Single): JString; cdecl; overload;
{class} function valueOf(d: Double): JString; cdecl; overload;
{class} property CASE_INSENSITIVE_ORDER: JComparator read _GetCASE_INSENSITIVE_ORDER;
end;
[JavaSignature('java/lang/String')]
JString = interface(JObject)
['{8579B374-1E68-4729-AE3C-C8DA0A6D6F9F}']
function charAt(index: Integer): Char; cdecl;
function codePointAt(index: Integer): Integer; cdecl;
function codePointBefore(index: Integer): Integer; cdecl;
function codePointCount(beginIndex: Integer; endIndex: Integer): Integer; cdecl;
function compareTo(anotherString: JString): Integer; cdecl;
function compareToIgnoreCase(str: JString): Integer; cdecl;
function concat(str: JString): JString; cdecl;
function &contains(s: JCharSequence): Boolean; cdecl;
function contentEquals(sb: JStringBuffer): Boolean; cdecl; overload;
function contentEquals(cs: JCharSequence): Boolean; cdecl; overload;
function endsWith(suffix: JString): Boolean; cdecl;
function equals(anObject: JObject): Boolean; cdecl;
function equalsIgnoreCase(anotherString: JString): Boolean; cdecl;
procedure getBytes(srcBegin: Integer; srcEnd: Integer; dst: TJavaArray<Byte>; dstBegin: Integer); cdecl; overload;//Deprecated
function getBytes(charsetName: JString): TJavaArray<Byte>; cdecl; overload;
function getBytes(charset: JCharset): TJavaArray<Byte>; cdecl; overload;
function getBytes: TJavaArray<Byte>; cdecl; overload;
procedure getChars(srcBegin: Integer; srcEnd: Integer; dst: TJavaArray<Char>; dstBegin: Integer); cdecl;
function hashCode: Integer; cdecl;
function indexOf(ch: Integer): Integer; cdecl; overload;
function indexOf(ch: Integer; fromIndex: Integer): Integer; cdecl; overload;
function indexOf(str: JString): Integer; cdecl; overload;
function indexOf(str: JString; fromIndex: Integer): Integer; cdecl; overload;
function intern: JString; cdecl;
function isEmpty: Boolean; cdecl;
function lastIndexOf(ch: Integer): Integer; cdecl; overload;
function lastIndexOf(ch: Integer; fromIndex: Integer): Integer; cdecl; overload;
function lastIndexOf(str: JString): Integer; cdecl; overload;
function lastIndexOf(str: JString; fromIndex: Integer): Integer; cdecl; overload;
function length: Integer; cdecl;
function matches(regex: JString): Boolean; cdecl;
function offsetByCodePoints(index: Integer; codePointOffset: Integer): Integer; cdecl;
function regionMatches(toffset: Integer; other: JString; ooffset: Integer; len: Integer): Boolean; cdecl; overload;
function regionMatches(ignoreCase: Boolean; toffset: Integer; other: JString; ooffset: Integer; len: Integer): Boolean; cdecl; overload;
function replace(oldChar: Char; newChar: Char): JString; cdecl; overload;
function replace(target: JCharSequence; replacement: JCharSequence): JString; cdecl; overload;
function replaceAll(regex: JString; replacement: JString): JString; cdecl;
function replaceFirst(regex: JString; replacement: JString): JString; cdecl;
function split(regex: JString; limit: Integer): TJavaObjectArray<JString>; cdecl; overload;
function split(regex: JString): TJavaObjectArray<JString>; cdecl; overload;
function startsWith(prefix: JString; toffset: Integer): Boolean; cdecl; overload;
function startsWith(prefix: JString): Boolean; cdecl; overload;
function subSequence(beginIndex: Integer; endIndex: Integer): JCharSequence; cdecl;
function substring(beginIndex: Integer): JString; cdecl; overload;
function substring(beginIndex: Integer; endIndex: Integer): JString; cdecl; overload;
function toCharArray: TJavaArray<Char>; cdecl;
function toLowerCase(locale: JLocale): JString; cdecl; overload;
function toLowerCase: JString; cdecl; overload;
function toString: JString; cdecl;
function toUpperCase(locale: JLocale): JString; cdecl; overload;
function toUpperCase: JString; cdecl; overload;
function trim: JString; cdecl;
end;
TJString = class(TJavaGenericImport<JStringClass, JString>) end;
JStringBufferClass = interface(JAbstractStringBuilderClass)
['{F6BF4ECD-EA63-4AF3-A901-99D4221796D7}']
{class} function init: JStringBuffer; cdecl; overload;
{class} function init(capacity: Integer): JStringBuffer; cdecl; overload;
{class} function init(str: JString): JStringBuffer; cdecl; overload;
{class} function init(seq: JCharSequence): JStringBuffer; cdecl; overload;
end;
[JavaSignature('java/lang/StringBuffer')]
JStringBuffer = interface(JAbstractStringBuilder)
['{3CECFBBE-9C21-4D67-9F6F-52BB1DB2C638}']
function append(obj: JObject): JStringBuffer; cdecl; overload;
function append(str: JString): JStringBuffer; cdecl; overload;
function append(sb: JStringBuffer): JStringBuffer; cdecl; overload;
function append(s: JCharSequence): JStringBuffer; cdecl; overload;
function append(s: JCharSequence; start: Integer; end_: Integer): JStringBuffer; cdecl; overload;
function append(str: TJavaArray<Char>): JStringBuffer; cdecl; overload;
function append(str: TJavaArray<Char>; offset: Integer; len: Integer): JStringBuffer; cdecl; overload;
function append(b: Boolean): JStringBuffer; cdecl; overload;
function append(c: Char): JStringBuffer; cdecl; overload;
function append(i: Integer): JStringBuffer; cdecl; overload;
function append(lng: Int64): JStringBuffer; cdecl; overload;
function append(f: Single): JStringBuffer; cdecl; overload;
function append(d: Double): JStringBuffer; cdecl; overload;
function appendCodePoint(codePoint: Integer): JStringBuffer; cdecl;
function capacity: Integer; cdecl;
function charAt(index: Integer): Char; cdecl;
function codePointAt(index: Integer): Integer; cdecl;
function codePointBefore(index: Integer): Integer; cdecl;
function codePointCount(beginIndex: Integer; endIndex: Integer): Integer; cdecl;
function delete(start: Integer; end_: Integer): JStringBuffer; cdecl;
function deleteCharAt(index: Integer): JStringBuffer; cdecl;
procedure ensureCapacity(minimumCapacity: Integer); cdecl;
procedure getChars(srcBegin: Integer; srcEnd: Integer; dst: TJavaArray<Char>; dstBegin: Integer); cdecl;
function indexOf(str: JString): Integer; cdecl; overload;
function indexOf(str: JString; fromIndex: Integer): Integer; cdecl; overload;
function insert(index: Integer; str: TJavaArray<Char>; offset: Integer; len: Integer): JStringBuffer; cdecl; overload;
function insert(offset: Integer; obj: JObject): JStringBuffer; cdecl; overload;
function insert(offset: Integer; str: JString): JStringBuffer; cdecl; overload;
function insert(offset: Integer; str: TJavaArray<Char>): JStringBuffer; cdecl; overload;
function insert(dstOffset: Integer; s: JCharSequence): JStringBuffer; cdecl; overload;
function insert(dstOffset: Integer; s: JCharSequence; start: Integer; end_: Integer): JStringBuffer; cdecl; overload;
function insert(offset: Integer; b: Boolean): JStringBuffer; cdecl; overload;
function insert(offset: Integer; c: Char): JStringBuffer; cdecl; overload;
function insert(offset: Integer; i: Integer): JStringBuffer; cdecl; overload;
function insert(offset: Integer; l: Int64): JStringBuffer; cdecl; overload;
function insert(offset: Integer; f: Single): JStringBuffer; cdecl; overload;
function insert(offset: Integer; d: Double): JStringBuffer; cdecl; overload;
function lastIndexOf(str: JString): Integer; cdecl; overload;
function lastIndexOf(str: JString; fromIndex: Integer): Integer; cdecl; overload;
function length: Integer; cdecl;
function offsetByCodePoints(index: Integer; codePointOffset: Integer): Integer; cdecl;
function replace(start: Integer; end_: Integer; str: JString): JStringBuffer; cdecl;
function reverse: JStringBuffer; cdecl;
procedure setCharAt(index: Integer; ch: Char); cdecl;
procedure setLength(newLength: Integer); cdecl;
function subSequence(start: Integer; end_: Integer): JCharSequence; cdecl;
function substring(start: Integer): JString; cdecl; overload;
function substring(start: Integer; end_: Integer): JString; cdecl; overload;
function toString: JString; cdecl;
procedure trimToSize; cdecl;
end;
TJStringBuffer = class(TJavaGenericImport<JStringBufferClass, JStringBuffer>) end;
JStringBuilderClass = interface(JAbstractStringBuilderClass)
['{D9FACB66-EE60-4BCB-B5B2-248751CCF1B4}']
{class} function init: JStringBuilder; cdecl; overload;
{class} function init(capacity: Integer): JStringBuilder; cdecl; overload;
{class} function init(str: JString): JStringBuilder; cdecl; overload;
{class} function init(seq: JCharSequence): JStringBuilder; cdecl; overload;
end;
[JavaSignature('java/lang/StringBuilder')]
JStringBuilder = interface(JAbstractStringBuilder)
['{F8A75A66-EA10-4337-9ECC-B0CA4FF4D9C5}']
function append(obj: JObject): JStringBuilder; cdecl; overload;
function append(str: JString): JStringBuilder; cdecl; overload;
function append(sb: JStringBuffer): JStringBuilder; cdecl; overload;
function append(s: JCharSequence): JStringBuilder; cdecl; overload;
function append(s: JCharSequence; start: Integer; end_: Integer): JStringBuilder; cdecl; overload;
function append(str: TJavaArray<Char>): JStringBuilder; cdecl; overload;
function append(str: TJavaArray<Char>; offset: Integer; len: Integer): JStringBuilder; cdecl; overload;
function append(b: Boolean): JStringBuilder; cdecl; overload;
function append(c: Char): JStringBuilder; cdecl; overload;
function append(i: Integer): JStringBuilder; cdecl; overload;
function append(lng: Int64): JStringBuilder; cdecl; overload;
function append(f: Single): JStringBuilder; cdecl; overload;
function append(d: Double): JStringBuilder; cdecl; overload;
function appendCodePoint(codePoint: Integer): JStringBuilder; cdecl;
function delete(start: Integer; end_: Integer): JStringBuilder; cdecl;
function deleteCharAt(index: Integer): JStringBuilder; cdecl;
function indexOf(str: JString): Integer; cdecl; overload;
function indexOf(str: JString; fromIndex: Integer): Integer; cdecl; overload;
function insert(index: Integer; str: TJavaArray<Char>; offset: Integer; len: Integer): JStringBuilder; cdecl; overload;
function insert(offset: Integer; obj: JObject): JStringBuilder; cdecl; overload;
function insert(offset: Integer; str: JString): JStringBuilder; cdecl; overload;
function insert(offset: Integer; str: TJavaArray<Char>): JStringBuilder; cdecl; overload;
function insert(dstOffset: Integer; s: JCharSequence): JStringBuilder; cdecl; overload;
function insert(dstOffset: Integer; s: JCharSequence; start: Integer; end_: Integer): JStringBuilder; cdecl; overload;
function insert(offset: Integer; b: Boolean): JStringBuilder; cdecl; overload;
function insert(offset: Integer; c: Char): JStringBuilder; cdecl; overload;
function insert(offset: Integer; i: Integer): JStringBuilder; cdecl; overload;
function insert(offset: Integer; l: Int64): JStringBuilder; cdecl; overload;
function insert(offset: Integer; f: Single): JStringBuilder; cdecl; overload;
function insert(offset: Integer; d: Double): JStringBuilder; cdecl; overload;
function lastIndexOf(str: JString): Integer; cdecl; overload;
function lastIndexOf(str: JString; fromIndex: Integer): Integer; cdecl; overload;
function replace(start: Integer; end_: Integer; str: JString): JStringBuilder; cdecl;
function reverse: JStringBuilder; cdecl;
function toString: JString; cdecl;
end;
TJStringBuilder = class(TJavaGenericImport<JStringBuilderClass, JStringBuilder>) end;
JThreadClass = interface(JObjectClass)
['{AC2B33CB-D349-4506-8809-B9762209222B}']
{class} function _GetMAX_PRIORITY: Integer; cdecl;
{class} function _GetMIN_PRIORITY: Integer; cdecl;
{class} function _GetNORM_PRIORITY: Integer; cdecl;
{class} function init: JThread; cdecl; overload;
{class} function init(target: JRunnable): JThread; cdecl; overload;
{class} function init(group: JThreadGroup; target: JRunnable): JThread; cdecl; overload;
{class} function init(name: JString): JThread; cdecl; overload;
{class} function init(group: JThreadGroup; name: JString): JThread; cdecl; overload;
{class} function init(target: JRunnable; name: JString): JThread; cdecl; overload;
{class} function init(group: JThreadGroup; target: JRunnable; name: JString): JThread; cdecl; overload;
{class} function init(group: JThreadGroup; target: JRunnable; name: JString; stackSize: Int64): JThread; cdecl; overload;
{class} function activeCount: Integer; cdecl;
{class} function currentThread: JThread; cdecl;
{class} procedure dumpStack; cdecl;
{class} function enumerate(tarray: TJavaObjectArray<JThread>): Integer; cdecl;
{class} function getAllStackTraces: TJavaObjectArray<JMap>; cdecl;
{class} function getDefaultUncaughtExceptionHandler: JThread_UncaughtExceptionHandler; cdecl;
{class} function holdsLock(obj: JObject): Boolean; cdecl;
{class} function interrupted: Boolean; cdecl;
{class} procedure setDefaultUncaughtExceptionHandler(eh: JThread_UncaughtExceptionHandler); cdecl;
{class} procedure sleep(millis: Int64); cdecl; overload;
{class} procedure sleep(millis: Int64; nanos: Integer); cdecl; overload;
{class} procedure yield; cdecl;
{class} property MAX_PRIORITY: Integer read _GetMAX_PRIORITY;
{class} property MIN_PRIORITY: Integer read _GetMIN_PRIORITY;
{class} property NORM_PRIORITY: Integer read _GetNORM_PRIORITY;
end;
[JavaSignature('java/lang/Thread')]
JThread = interface(JObject)
['{8E288CBE-F5A4-4D6E-98B7-D0B5075A0FCA}']
procedure checkAccess; cdecl;
function countStackFrames: Integer; cdecl;//Deprecated
procedure destroy; cdecl;//Deprecated
function getContextClassLoader: JClassLoader; cdecl;
function getId: Int64; cdecl;
function getName: JString; cdecl;
function getPriority: Integer; cdecl;
function getStackTrace: TJavaObjectArray<JStackTraceElement>; cdecl;
function getState: JThread_State; cdecl;
function getThreadGroup: JThreadGroup; cdecl;
function getUncaughtExceptionHandler: JThread_UncaughtExceptionHandler; cdecl;
procedure interrupt; cdecl;
function isAlive: Boolean; cdecl;
function isDaemon: Boolean; cdecl;
function isInterrupted: Boolean; cdecl;
procedure join(millis: Int64); cdecl; overload;
procedure join(millis: Int64; nanos: Integer); cdecl; overload;
procedure join; cdecl; overload;
procedure resume; cdecl;//Deprecated
procedure run; cdecl;
procedure setContextClassLoader(cl: JClassLoader); cdecl;
procedure setDaemon(on: Boolean); cdecl;
procedure setName(name: JString); cdecl;
procedure setPriority(newPriority: Integer); cdecl;
procedure setUncaughtExceptionHandler(eh: JThread_UncaughtExceptionHandler); cdecl;
procedure start; cdecl;
procedure stop; cdecl; overload;//Deprecated
procedure stop(obj: JThrowable); cdecl; overload;//Deprecated
procedure suspend; cdecl;//Deprecated
function toString: JString; cdecl;
end;
TJThread = class(TJavaGenericImport<JThreadClass, JThread>) end;
JThread_StateClass = interface(JEnumClass)
['{493F7CE3-3BE4-4CE5-9F96-7563BC2DC814}']
{class} function _GetBLOCKED: JThread_State; cdecl;
{class} function _GetNEW: JThread_State; cdecl;
{class} function _GetRUNNABLE: JThread_State; cdecl;
{class} function _GetTERMINATED: JThread_State; cdecl;
{class} function _GetTIMED_WAITING: JThread_State; cdecl;
{class} function _GetWAITING: JThread_State; cdecl;
{class} function valueOf(name: JString): JThread_State; cdecl;
{class} function values: TJavaObjectArray<JThread_State>; cdecl;
{class} property BLOCKED: JThread_State read _GetBLOCKED;
{class} property NEW: JThread_State read _GetNEW;
{class} property RUNNABLE: JThread_State read _GetRUNNABLE;
{class} property TERMINATED: JThread_State read _GetTERMINATED;
{class} property TIMED_WAITING: JThread_State read _GetTIMED_WAITING;
{class} property WAITING: JThread_State read _GetWAITING;
end;
[JavaSignature('java/lang/Thread$State')]
JThread_State = interface(JEnum)
['{E3910394-C461-461E-9C1D-64E9BC367F84}']
end;
TJThread_State = class(TJavaGenericImport<JThread_StateClass, JThread_State>) end;
JThread_UncaughtExceptionHandlerClass = interface(IJavaClass)
['{3E2F71F3-BF00-457C-9970-9F1DA9EA7498}']
end;
[JavaSignature('java/lang/Thread$UncaughtExceptionHandler')]
JThread_UncaughtExceptionHandler = interface(IJavaInstance)
['{C9E75389-E9B3-45FF-9EA2-D7BC024DB9DA}']
procedure uncaughtException(t: JThread; e: JThrowable); cdecl;
end;
TJThread_UncaughtExceptionHandler = class(TJavaGenericImport<JThread_UncaughtExceptionHandlerClass, JThread_UncaughtExceptionHandler>) end;
JThreadGroupClass = interface(JObjectClass)
['{D7D65FE0-0CB7-4C72-9129-C344705D0F4C}']
{class} function init(name: JString): JThreadGroup; cdecl; overload;
{class} function init(parent: JThreadGroup; name: JString): JThreadGroup; cdecl; overload;
end;
[JavaSignature('java/lang/ThreadGroup')]
JThreadGroup = interface(JObject)
['{5BF3F856-7BFB-444A-8059-341CBC2A10B2}']
function activeCount: Integer; cdecl;
function activeGroupCount: Integer; cdecl;
function allowThreadSuspension(b: Boolean): Boolean; cdecl;//Deprecated
procedure checkAccess; cdecl;
procedure destroy; cdecl;
function enumerate(list: TJavaObjectArray<JThread>): Integer; cdecl; overload;
function enumerate(list: TJavaObjectArray<JThread>; recurse: Boolean): Integer; cdecl; overload;
function enumerate(list: TJavaObjectArray<JThreadGroup>): Integer; cdecl; overload;
function enumerate(list: TJavaObjectArray<JThreadGroup>; recurse: Boolean): Integer; cdecl; overload;
function getMaxPriority: Integer; cdecl;
function getName: JString; cdecl;
function getParent: JThreadGroup; cdecl;
procedure interrupt; cdecl;
function isDaemon: Boolean; cdecl;
function isDestroyed: Boolean; cdecl;
procedure list; cdecl;
function parentOf(g: JThreadGroup): Boolean; cdecl;
procedure resume; cdecl;//Deprecated
procedure setDaemon(daemon: Boolean); cdecl;
procedure setMaxPriority(pri: Integer); cdecl;
procedure stop; cdecl;//Deprecated
procedure suspend; cdecl;//Deprecated
function toString: JString; cdecl;
procedure uncaughtException(t: JThread; e: JThrowable); cdecl;
end;
TJThreadGroup = class(TJavaGenericImport<JThreadGroupClass, JThreadGroup>) end;
JAnnotationClass = interface(IJavaClass)
['{E8A654D9-AA21-468D-AEF1-9261C6E3F760}']
end;
[JavaSignature('java/lang/annotation/Annotation')]
JAnnotation = interface(IJavaInstance)
['{508C3063-7E6D-4963-B22F-27538F9D20CE}']
function annotationType: Jlang_Class; cdecl;
function equals(obj: JObject): Boolean; cdecl;
function hashCode: Integer; cdecl;
function toString: JString; cdecl;
end;
TJAnnotation = class(TJavaGenericImport<JAnnotationClass, JAnnotation>) end;
JAccessibleObjectClass = interface(JObjectClass)
['{BFC4376F-593C-474E-804A-B2AD9F617DCC}']
{class} procedure setAccessible(array_: TJavaObjectArray<JAccessibleObject>; flag: Boolean); cdecl; overload;
end;
[JavaSignature('java/lang/reflect/AccessibleObject')]
JAccessibleObject = interface(JObject)
['{C062CF92-1A4F-4E32-94CB-2571A4C6A2DA}']
function getAnnotation(annotationClass: Jlang_Class): JAnnotation; cdecl;
function getAnnotations: TJavaObjectArray<JAnnotation>; cdecl;
function getAnnotationsByType(annotationClass: Jlang_Class): TJavaObjectArray<JAnnotation>; cdecl;
function getDeclaredAnnotation(annotationClass: Jlang_Class): JAnnotation; cdecl;
function getDeclaredAnnotations: TJavaObjectArray<JAnnotation>; cdecl;
function getDeclaredAnnotationsByType(annotationClass: Jlang_Class): TJavaObjectArray<JAnnotation>; cdecl;
function isAccessible: Boolean; cdecl;
function isAnnotationPresent(annotationClass: Jlang_Class): Boolean; cdecl;
procedure setAccessible(flag: Boolean); cdecl; overload;
end;
TJAccessibleObject = class(TJavaGenericImport<JAccessibleObjectClass, JAccessibleObject>) end;
JAnnotatedElementClass = interface(IJavaClass)
['{B8D3187C-18C3-4B73-9C38-0CB31BEC79AD}']
end;
[JavaSignature('java/lang/reflect/AnnotatedElement')]
JAnnotatedElement = interface(IJavaInstance)
['{D21138BE-6F61-4580-B687-82E3C44ECC9D}']
function getAnnotation(annotationClass: Jlang_Class): JAnnotation; cdecl;
function getAnnotations: TJavaObjectArray<JAnnotation>; cdecl;
function getAnnotationsByType(annotationClass: Jlang_Class): TJavaObjectArray<JAnnotation>; cdecl;
function getDeclaredAnnotation(annotationClass: Jlang_Class): JAnnotation; cdecl;
function getDeclaredAnnotations: TJavaObjectArray<JAnnotation>; cdecl;
function getDeclaredAnnotationsByType(annotationClass: Jlang_Class): TJavaObjectArray<JAnnotation>; cdecl;
function isAnnotationPresent(annotationClass: Jlang_Class): Boolean; cdecl;
end;
TJAnnotatedElement = class(TJavaGenericImport<JAnnotatedElementClass, JAnnotatedElement>) end;
JExecutableClass = interface(JAccessibleObjectClass)
['{4CC5A892-808B-4158-A14C-E932AE3AA2DA}']
end;
[JavaSignature('java/lang/reflect/Executable')]
JExecutable = interface(JAccessibleObject)
['{C094543B-9218-40A4-9D51-67C131336D98}']
function getAnnotation(annotationClass: Jlang_Class): JAnnotation; cdecl;
function getAnnotationsByType(annotationClass: Jlang_Class): TJavaObjectArray<JAnnotation>; cdecl;
function getDeclaredAnnotations: TJavaObjectArray<JAnnotation>; cdecl;
function getDeclaringClass: Jlang_Class; cdecl;
function getExceptionTypes: TJavaObjectArray<Jlang_Class>; cdecl;
function getGenericExceptionTypes: TJavaObjectArray<Jreflect_Type>; cdecl;
function getGenericParameterTypes: TJavaObjectArray<Jreflect_Type>; cdecl;
function getModifiers: Integer; cdecl;
function getName: JString; cdecl;
function getParameterAnnotations: TJavaObjectBiArray<JAnnotation>; cdecl;
function getParameterCount: Integer; cdecl;
function getParameterTypes: TJavaObjectArray<Jlang_Class>; cdecl;
function getParameters: TJavaObjectArray<JParameter>; cdecl;
function getTypeParameters: TJavaObjectArray<JTypeVariable>; cdecl;
function isAnnotationPresent(annotationType: Jlang_Class): Boolean; cdecl;
function isSynthetic: Boolean; cdecl;
function isVarArgs: Boolean; cdecl;
function toGenericString: JString; cdecl;
end;
TJExecutable = class(TJavaGenericImport<JExecutableClass, JExecutable>) end;
JConstructorClass = interface(JExecutableClass)
['{80E33E85-BECE-4E23-80BE-3F6D2AD32DA6}']
end;
[JavaSignature('java/lang/reflect/Constructor')]
JConstructor = interface(JExecutable)
['{D765E763-03C2-4484-BF92-F8C5BC18BBC2}']
function equals(obj: JObject): Boolean; cdecl;
function getAnnotation(annotationClass: Jlang_Class): JAnnotation; cdecl;
function getDeclaredAnnotations: TJavaObjectArray<JAnnotation>; cdecl;
function getDeclaringClass: Jlang_Class; cdecl;
function getExceptionTypes: TJavaObjectArray<Jlang_Class>; cdecl;
function getGenericExceptionTypes: TJavaObjectArray<Jreflect_Type>; cdecl;
function getGenericParameterTypes: TJavaObjectArray<Jreflect_Type>; cdecl;
function getModifiers: Integer; cdecl;
function getName: JString; cdecl;
function getParameterAnnotations: TJavaObjectBiArray<JAnnotation>; cdecl;
function getParameterCount: Integer; cdecl;
function getParameterTypes: TJavaObjectArray<Jlang_Class>; cdecl;
function getTypeParameters: TJavaObjectArray<JTypeVariable>; cdecl;
function hashCode: Integer; cdecl;
function isSynthetic: Boolean; cdecl;
function isVarArgs: Boolean; cdecl;
function toGenericString: JString; cdecl;
function toString: JString; cdecl;
end;
TJConstructor = class(TJavaGenericImport<JConstructorClass, JConstructor>) end;
JFieldClass = interface(JAccessibleObjectClass)
['{76F4F74B-58A0-4CA5-A596-B027AE99C55E}']
end;
[JavaSignature('java/lang/reflect/Field')]
JField = interface(JAccessibleObject)
['{756027C5-4F1B-4A24-BEF9-70D5A951744A}']
function equals(obj: JObject): Boolean; cdecl;
function &get(obj: JObject): JObject; cdecl;
function getAnnotation(annotationClass: Jlang_Class): JAnnotation; cdecl;
function getAnnotationsByType(annotationClass: Jlang_Class): TJavaObjectArray<JAnnotation>; cdecl;
function getBoolean(obj: JObject): Boolean; cdecl;
function getByte(obj: JObject): Byte; cdecl;
function getChar(obj: JObject): Char; cdecl;
function getDeclaredAnnotations: TJavaObjectArray<JAnnotation>; cdecl;
function getDeclaringClass: Jlang_Class; cdecl;
function getDouble(obj: JObject): Double; cdecl;
function getFloat(obj: JObject): Single; cdecl;
function getGenericType: Jreflect_Type; cdecl;
function getInt(obj: JObject): Integer; cdecl;
function getLong(obj: JObject): Int64; cdecl;
function getModifiers: Integer; cdecl;
function getName: JString; cdecl;
function getShort(obj: JObject): SmallInt; cdecl;
function getType: Jlang_Class; cdecl;
function hashCode: Integer; cdecl;
function isAnnotationPresent(annotationType: Jlang_Class): Boolean; cdecl;
function isEnumConstant: Boolean; cdecl;
function isSynthetic: Boolean; cdecl;
procedure &set(obj: JObject; value: JObject); cdecl;
procedure setBoolean(obj: JObject; z: Boolean); cdecl;
procedure setByte(obj: JObject; b: Byte); cdecl;
procedure setChar(obj: JObject; c: Char); cdecl;
procedure setDouble(obj: JObject; d: Double); cdecl;
procedure setFloat(obj: JObject; f: Single); cdecl;
procedure setInt(obj: JObject; i: Integer); cdecl;
procedure setLong(obj: JObject; l: Int64); cdecl;
procedure setShort(obj: JObject; s: SmallInt); cdecl;
function toGenericString: JString; cdecl;
function toString: JString; cdecl;
end;
TJField = class(TJavaGenericImport<JFieldClass, JField>) end;
JGenericDeclarationClass = interface(JAnnotatedElementClass)
['{193301E7-C0FE-473C-BBC1-94DAF25C4497}']
end;
[JavaSignature('java/lang/reflect/GenericDeclaration')]
JGenericDeclaration = interface(JAnnotatedElement)
['{BD87C28A-4E41-4E44-A2F9-03BB724E9ECC}']
function getTypeParameters: TJavaObjectArray<JTypeVariable>; cdecl;
end;
TJGenericDeclaration = class(TJavaGenericImport<JGenericDeclarationClass, JGenericDeclaration>) end;
JMethodClass = interface(JExecutableClass)
['{C995BD27-1D77-48E5-B478-EB8E9E607020}']
end;
[JavaSignature('java/lang/reflect/Method')]
JMethod = interface(JExecutable)
['{ED1B0770-0BD6-4D4A-B801-9D18AB92C834}']
function equals(obj: JObject): Boolean; cdecl;
function getAnnotation(annotationClass: Jlang_Class): JAnnotation; cdecl;
function getDeclaredAnnotations: TJavaObjectArray<JAnnotation>; cdecl;
function getDeclaringClass: Jlang_Class; cdecl;
function getDefaultValue: JObject; cdecl;
function getExceptionTypes: TJavaObjectArray<Jlang_Class>; cdecl;
function getGenericExceptionTypes: TJavaObjectArray<Jreflect_Type>; cdecl;
function getGenericParameterTypes: TJavaObjectArray<Jreflect_Type>; cdecl;
function getGenericReturnType: Jreflect_Type; cdecl;
function getModifiers: Integer; cdecl;
function getName: JString; cdecl;
function getParameterAnnotations: TJavaObjectBiArray<JAnnotation>; cdecl;
function getParameterCount: Integer; cdecl;
function getParameterTypes: TJavaObjectArray<Jlang_Class>; cdecl;
function getReturnType: Jlang_Class; cdecl;
function getTypeParameters: TJavaObjectArray<JTypeVariable>; cdecl;
function hashCode: Integer; cdecl;
function isBridge: Boolean; cdecl;
function isDefault: Boolean; cdecl;
function isSynthetic: Boolean; cdecl;
function isVarArgs: Boolean; cdecl;
function toGenericString: JString; cdecl;
function toString: JString; cdecl;
end;
TJMethod = class(TJavaGenericImport<JMethodClass, JMethod>) end;
JParameterClass = interface(JObjectClass)
['{E28B4510-A3B5-44B0-8F29-D96374EC5698}']
end;
[JavaSignature('java/lang/reflect/Parameter')]
JParameter = interface(JObject)
['{16D21E3B-C67D-4820-B8CE-83A3A5B26746}']
function equals(obj: JObject): Boolean; cdecl;
function getAnnotation(annotationClass: Jlang_Class): JAnnotation; cdecl;
function getAnnotations: TJavaObjectArray<JAnnotation>; cdecl;
function getAnnotationsByType(annotationClass: Jlang_Class): TJavaObjectArray<JAnnotation>; cdecl;
function getDeclaredAnnotation(annotationClass: Jlang_Class): JAnnotation; cdecl;
function getDeclaredAnnotations: TJavaObjectArray<JAnnotation>; cdecl;
function getDeclaredAnnotationsByType(annotationClass: Jlang_Class): TJavaObjectArray<JAnnotation>; cdecl;
function getDeclaringExecutable: JExecutable; cdecl;
function getModifiers: Integer; cdecl;
function getName: JString; cdecl;
function getParameterizedType: Jreflect_Type; cdecl;
function getType: Jlang_Class; cdecl;
function hashCode: Integer; cdecl;
function isImplicit: Boolean; cdecl;
function isNamePresent: Boolean; cdecl;
function isSynthetic: Boolean; cdecl;
function isVarArgs: Boolean; cdecl;
function toString: JString; cdecl;
end;
TJParameter = class(TJavaGenericImport<JParameterClass, JParameter>) end;
Jreflect_TypeClass = interface(IJavaClass)
['{843FF2A0-9372-4F7B-9CF7-C825AFD78970}']
end;
[JavaSignature('java/lang/reflect/Type')]
Jreflect_Type = interface(IJavaInstance)
['{90AD4932-3D22-4B5B-B279-56EC7A2174CD}']
end;
TJreflect_Type = class(TJavaGenericImport<Jreflect_TypeClass, Jreflect_Type>) end;
JTypeVariableClass = interface(Jreflect_TypeClass)
['{26AC832B-6883-4CDF-8BDC-49E5A1E6B0EF}']
end;
[JavaSignature('java/lang/reflect/TypeVariable')]
JTypeVariable = interface(Jreflect_Type)
['{5635CD21-A6AD-420D-B742-599EC17C5931}']
function getBounds: TJavaObjectArray<Jreflect_Type>; cdecl;
function getGenericDeclaration: JGenericDeclaration; cdecl;
function getName: JString; cdecl;
end;
TJTypeVariable = class(TJavaGenericImport<JTypeVariableClass, JTypeVariable>) end;
JBigIntegerClass = interface(JNumberClass)
['{ACED883B-58FF-466A-80D3-BB30E54F84A5}']
{class} function _GetONE: JBigInteger; cdecl;
{class} function _GetTEN: JBigInteger; cdecl;
{class} function _GetZERO: JBigInteger; cdecl;
{class} function init(numBits: Integer; random: JRandom): JBigInteger; cdecl; overload;
{class} function init(bitLength: Integer; certainty: Integer; random: JRandom): JBigInteger; cdecl; overload;
{class} function init(value: JString): JBigInteger; cdecl; overload;
{class} function init(value: JString; radix: Integer): JBigInteger; cdecl; overload;
{class} function init(signum: Integer; magnitude: TJavaArray<Byte>): JBigInteger; cdecl; overload;
{class} function init(value: TJavaArray<Byte>): JBigInteger; cdecl; overload;
{class} function probablePrime(bitLength: Integer; random: JRandom): JBigInteger; cdecl;
{class} function valueOf(value: Int64): JBigInteger; cdecl;
{class} property ONE: JBigInteger read _GetONE;
{class} property TEN: JBigInteger read _GetTEN;
{class} property ZERO: JBigInteger read _GetZERO;
end;
[JavaSignature('java/math/BigInteger')]
JBigInteger = interface(JNumber)
['{4B14E1DC-D46C-4434-BF1C-E804437732C3}']
function abs: JBigInteger; cdecl;
function add(value: JBigInteger): JBigInteger; cdecl;
function &and(value: JBigInteger): JBigInteger; cdecl;
function andNot(value: JBigInteger): JBigInteger; cdecl;
function bitCount: Integer; cdecl;
function bitLength: Integer; cdecl;
function clearBit(n: Integer): JBigInteger; cdecl;
function compareTo(value: JBigInteger): Integer; cdecl;
function divide(divisor: JBigInteger): JBigInteger; cdecl;
function divideAndRemainder(divisor: JBigInteger): TJavaObjectArray<JBigInteger>; cdecl;
function doubleValue: Double; cdecl;
function equals(x: JObject): Boolean; cdecl;
function flipBit(n: Integer): JBigInteger; cdecl;
function floatValue: Single; cdecl;
function gcd(value: JBigInteger): JBigInteger; cdecl;
function getLowestSetBit: Integer; cdecl;
function hashCode: Integer; cdecl;
function intValue: Integer; cdecl;
function isProbablePrime(certainty: Integer): Boolean; cdecl;
function longValue: Int64; cdecl;
function max(value: JBigInteger): JBigInteger; cdecl;
function min(value: JBigInteger): JBigInteger; cdecl;
function &mod(m: JBigInteger): JBigInteger; cdecl;
function modInverse(m: JBigInteger): JBigInteger; cdecl;
function modPow(exponent: JBigInteger; modulus: JBigInteger): JBigInteger; cdecl;
function multiply(value: JBigInteger): JBigInteger; cdecl;
function negate: JBigInteger; cdecl;
function nextProbablePrime: JBigInteger; cdecl;
function ¬: JBigInteger; cdecl;
function &or(value: JBigInteger): JBigInteger; cdecl;
function pow(exp: Integer): JBigInteger; cdecl;
function remainder(divisor: JBigInteger): JBigInteger; cdecl;
function setBit(n: Integer): JBigInteger; cdecl;
function shiftLeft(n: Integer): JBigInteger; cdecl;
function shiftRight(n: Integer): JBigInteger; cdecl;
function signum: Integer; cdecl;
function subtract(value: JBigInteger): JBigInteger; cdecl;
function testBit(n: Integer): Boolean; cdecl;
function toByteArray: TJavaArray<Byte>; cdecl;
function toString: JString; cdecl; overload;
function toString(radix: Integer): JString; cdecl; overload;
function &xor(value: JBigInteger): JBigInteger; cdecl;
end;
TJBigInteger = class(TJavaGenericImport<JBigIntegerClass, JBigInteger>) end;
JBufferClass = interface(JObjectClass)
['{481ABEA6-E331-446F-BF1A-789FC5B36341}']
end;
[JavaSignature('java/nio/Buffer')]
JBuffer = interface(JObject)
['{0F836282-2E7D-40FE-BFA9-9B58507FB238}']
function &array: JObject; cdecl;
function arrayOffset: Integer; cdecl;
function capacity: Integer; cdecl;
function clear: JBuffer; cdecl;
function flip: JBuffer; cdecl;
function hasArray: Boolean; cdecl;
function hasRemaining: Boolean; cdecl;
function isDirect: Boolean; cdecl;
function isReadOnly: Boolean; cdecl;
function limit: Integer; cdecl; overload;
function limit(newLimit: Integer): JBuffer; cdecl; overload;
function mark: JBuffer; cdecl;
function position: Integer; cdecl; overload;
function position(newPosition: Integer): JBuffer; cdecl; overload;
function remaining: Integer; cdecl;
function reset: JBuffer; cdecl;
function rewind: JBuffer; cdecl;
end;
TJBuffer = class(TJavaGenericImport<JBufferClass, JBuffer>) end;
JByteBufferClass = interface(JBufferClass)
['{7B879DB7-5B81-4A1F-B862-6127F1BE739D}']
{class} function allocate(capacity: Integer): JByteBuffer; cdecl;
{class} function allocateDirect(capacity: Integer): JByteBuffer; cdecl;
{class} function wrap(array_: TJavaArray<Byte>; offset: Integer; length: Integer): JByteBuffer; cdecl; overload;
{class} function wrap(array_: TJavaArray<Byte>): JByteBuffer; cdecl; overload;
end;
[JavaSignature('java/nio/ByteBuffer')]
JByteBuffer = interface(JBuffer)
['{CB03FB80-318C-4812-97DE-59301638C25A}']
function &array: TJavaArray<Byte>; cdecl;
function arrayOffset: Integer; cdecl;
function asCharBuffer: JCharBuffer; cdecl;
function asDoubleBuffer: JDoubleBuffer; cdecl;
function asFloatBuffer: JFloatBuffer; cdecl;
function asIntBuffer: JIntBuffer; cdecl;
function asLongBuffer: JLongBuffer; cdecl;
function asReadOnlyBuffer: JByteBuffer; cdecl;
function asShortBuffer: JShortBuffer; cdecl;
function compact: JByteBuffer; cdecl;
function compareTo(that: JByteBuffer): Integer; cdecl;
function duplicate: JByteBuffer; cdecl;
function equals(ob: JObject): Boolean; cdecl;
function &get: Byte; cdecl; overload;
function &get(index: Integer): Byte; cdecl; overload;
function &get(dst: TJavaArray<Byte>; offset: Integer; length: Integer): JByteBuffer; cdecl; overload;
function &get(dst: TJavaArray<Byte>): JByteBuffer; cdecl; overload;
function getChar: Char; cdecl; overload;
function getChar(index: Integer): Char; cdecl; overload;
function getDouble: Double; cdecl; overload;
function getDouble(index: Integer): Double; cdecl; overload;
function getFloat: Single; cdecl; overload;
function getFloat(index: Integer): Single; cdecl; overload;
function getInt: Integer; cdecl; overload;
function getInt(index: Integer): Integer; cdecl; overload;
function getLong: Int64; cdecl; overload;
function getLong(index: Integer): Int64; cdecl; overload;
function getShort: SmallInt; cdecl; overload;
function getShort(index: Integer): SmallInt; cdecl; overload;
function hasArray: Boolean; cdecl;
function hashCode: Integer; cdecl;
function isDirect: Boolean; cdecl;
function order: JByteOrder; cdecl; overload;
function order(bo: JByteOrder): JByteBuffer; cdecl; overload;
function put(b: Byte): JByteBuffer; cdecl; overload;
function put(index: Integer; b: Byte): JByteBuffer; cdecl; overload;
function put(src: JByteBuffer): JByteBuffer; cdecl; overload;
function put(src: TJavaArray<Byte>; offset: Integer; length: Integer): JByteBuffer; cdecl; overload;
function put(src: TJavaArray<Byte>): JByteBuffer; cdecl; overload;
function putChar(value: Char): JByteBuffer; cdecl; overload;
function putChar(index: Integer; value: Char): JByteBuffer; cdecl; overload;
function putDouble(value: Double): JByteBuffer; cdecl; overload;
function putDouble(index: Integer; value: Double): JByteBuffer; cdecl; overload;
function putFloat(value: Single): JByteBuffer; cdecl; overload;
function putFloat(index: Integer; value: Single): JByteBuffer; cdecl; overload;
function putInt(value: Integer): JByteBuffer; cdecl; overload;
function putInt(index: Integer; value: Integer): JByteBuffer; cdecl; overload;
function putLong(value: Int64): JByteBuffer; cdecl; overload;
function putLong(index: Integer; value: Int64): JByteBuffer; cdecl; overload;
function putShort(value: SmallInt): JByteBuffer; cdecl; overload;
function putShort(index: Integer; value: SmallInt): JByteBuffer; cdecl; overload;
function slice: JByteBuffer; cdecl;
function toString: JString; cdecl;
end;
TJByteBuffer = class(TJavaGenericImport<JByteBufferClass, JByteBuffer>) end;
JByteOrderClass = interface(JObjectClass)
['{254AAEC7-B381-4D22-89B2-D2BB46C88689}']
{class} function _GetBIG_ENDIAN: JByteOrder; cdecl;
{class} function _GetLITTLE_ENDIAN: JByteOrder; cdecl;
{class} function nativeOrder: JByteOrder; cdecl;
{class}
{class}
end;
[JavaSignature('java/nio/ByteOrder')]
JByteOrder = interface(JObject)
['{70FDB472-70CD-4FB1-B5FC-D6442C186BD2}']
function toString: JString; cdecl;
end;
TJByteOrder = class(TJavaGenericImport<JByteOrderClass, JByteOrder>) end;
JCharBufferClass = interface(JBufferClass)
['{E542BA92-3ABD-4A87-9D97-65DD774C716C}']
{class} function allocate(capacity: Integer): JCharBuffer; cdecl;
{class} function wrap(array_: TJavaArray<Char>; offset: Integer; length: Integer): JCharBuffer; cdecl; overload;
{class} function wrap(array_: TJavaArray<Char>): JCharBuffer; cdecl; overload;
{class} function wrap(csq: JCharSequence; start: Integer; end_: Integer): JCharBuffer; cdecl; overload;
{class} function wrap(csq: JCharSequence): JCharBuffer; cdecl; overload;
end;
[JavaSignature('java/nio/CharBuffer')]
JCharBuffer = interface(JBuffer)
['{C499497D-72A7-49D7-AB4C-ADE9BBCAEA61}']
function append(csq: JCharSequence): JCharBuffer; cdecl; overload;
function append(csq: JCharSequence; start: Integer; end_: Integer): JCharBuffer; cdecl; overload;
function append(c: Char): JCharBuffer; cdecl; overload;
function &array: TJavaArray<Char>; cdecl;
function arrayOffset: Integer; cdecl;
function asReadOnlyBuffer: JCharBuffer; cdecl;
function charAt(index: Integer): Char; cdecl;
function chars: JIntStream; cdecl;
function compact: JCharBuffer; cdecl;
function compareTo(that: JCharBuffer): Integer; cdecl;
function duplicate: JCharBuffer; cdecl;
function equals(ob: JObject): Boolean; cdecl;
function &get: Char; cdecl; overload;
function &get(index: Integer): Char; cdecl; overload;
function &get(dst: TJavaArray<Char>; offset: Integer; length: Integer): JCharBuffer; cdecl; overload;
function &get(dst: TJavaArray<Char>): JCharBuffer; cdecl; overload;
function hasArray: Boolean; cdecl;
function hashCode: Integer; cdecl;
function isDirect: Boolean; cdecl;
function length: Integer; cdecl;
function order: JByteOrder; cdecl;
function put(c: Char): JCharBuffer; cdecl; overload;
function put(index: Integer; c: Char): JCharBuffer; cdecl; overload;
function put(src: JCharBuffer): JCharBuffer; cdecl; overload;
function put(src: TJavaArray<Char>; offset: Integer; length: Integer): JCharBuffer; cdecl; overload;
function put(src: TJavaArray<Char>): JCharBuffer; cdecl; overload;
function put(src: JString; start: Integer; end_: Integer): JCharBuffer; cdecl; overload;
function put(src: JString): JCharBuffer; cdecl; overload;
function read(target: JCharBuffer): Integer; cdecl;
function slice: JCharBuffer; cdecl;
function subSequence(start: Integer; end_: Integer): JCharBuffer; cdecl;
function toString: JString; cdecl;
end;
TJCharBuffer = class(TJavaGenericImport<JCharBufferClass, JCharBuffer>) end;
JDoubleBufferClass = interface(JBufferClass)
['{05DB46C4-1C05-4F67-AE29-98B4A2703C63}']
{class} function allocate(capacity: Integer): JDoubleBuffer; cdecl;
{class} function wrap(array_: TJavaArray<Double>; offset: Integer; length: Integer): JDoubleBuffer; cdecl; overload;
{class} function wrap(array_: TJavaArray<Double>): JDoubleBuffer; cdecl; overload;
end;
[JavaSignature('java/nio/DoubleBuffer')]
JDoubleBuffer = interface(JBuffer)
['{1A1190DA-622D-48E4-A9D4-675ABCFACDCD}']
function &array: TJavaArray<Double>; cdecl;
function arrayOffset: Integer; cdecl;
function asReadOnlyBuffer: JDoubleBuffer; cdecl;
function compact: JDoubleBuffer; cdecl;
function compareTo(that: JDoubleBuffer): Integer; cdecl;
function duplicate: JDoubleBuffer; cdecl;
function equals(ob: JObject): Boolean; cdecl;
function &get: Double; cdecl; overload;
function &get(index: Integer): Double; cdecl; overload;
function &get(dst: TJavaArray<Double>; offset: Integer; length: Integer): JDoubleBuffer; cdecl; overload;
function &get(dst: TJavaArray<Double>): JDoubleBuffer; cdecl; overload;
function hasArray: Boolean; cdecl;
function hashCode: Integer; cdecl;
function isDirect: Boolean; cdecl;
function order: JByteOrder; cdecl;
function put(d: Double): JDoubleBuffer; cdecl; overload;
function put(index: Integer; d: Double): JDoubleBuffer; cdecl; overload;
function put(src: JDoubleBuffer): JDoubleBuffer; cdecl; overload;
function put(src: TJavaArray<Double>; offset: Integer; length: Integer): JDoubleBuffer; cdecl; overload;
function put(src: TJavaArray<Double>): JDoubleBuffer; cdecl; overload;
function slice: JDoubleBuffer; cdecl;
function toString: JString; cdecl;
end;
TJDoubleBuffer = class(TJavaGenericImport<JDoubleBufferClass, JDoubleBuffer>) end;
JFloatBufferClass = interface(JBufferClass)
['{A60ABCB4-E169-4F72-B24F-991D48A476C4}']
{class} function allocate(capacity: Integer): JFloatBuffer; cdecl;
{class} function wrap(array_: TJavaArray<Single>; offset: Integer; length: Integer): JFloatBuffer; cdecl; overload;
{class} function wrap(array_: TJavaArray<Single>): JFloatBuffer; cdecl; overload;
end;
[JavaSignature('java/nio/FloatBuffer')]
JFloatBuffer = interface(JBuffer)
['{E416608F-FCBC-4B4E-B43B-E2C4794C95A6}']
function &array: TJavaArray<Single>; cdecl;
function arrayOffset: Integer; cdecl;
function asReadOnlyBuffer: JFloatBuffer; cdecl;
function compact: JFloatBuffer; cdecl;
function compareTo(that: JFloatBuffer): Integer; cdecl;
function duplicate: JFloatBuffer; cdecl;
function equals(ob: JObject): Boolean; cdecl;
function &get: Single; cdecl; overload;
function &get(index: Integer): Single; cdecl; overload;
function &get(dst: TJavaArray<Single>; offset: Integer; length: Integer): JFloatBuffer; cdecl; overload;
function &get(dst: TJavaArray<Single>): JFloatBuffer; cdecl; overload;
function hasArray: Boolean; cdecl;
function hashCode: Integer; cdecl;
function isDirect: Boolean; cdecl;
function order: JByteOrder; cdecl;
function put(f: Single): JFloatBuffer; cdecl; overload;
function put(index: Integer; f: Single): JFloatBuffer; cdecl; overload;
function put(src: JFloatBuffer): JFloatBuffer; cdecl; overload;
function put(src: TJavaArray<Single>; offset: Integer; length: Integer): JFloatBuffer; cdecl; overload;
function put(src: TJavaArray<Single>): JFloatBuffer; cdecl; overload;
function slice: JFloatBuffer; cdecl;
function toString: JString; cdecl;
end;
TJFloatBuffer = class(TJavaGenericImport<JFloatBufferClass, JFloatBuffer>) end;
JIntBufferClass = interface(JBufferClass)
['{23604D5E-E540-41E0-8E8C-F43F7B4DA36F}']
{class} function allocate(capacity: Integer): JIntBuffer; cdecl;
{class} function wrap(array_: TJavaArray<Integer>; offset: Integer; length: Integer): JIntBuffer; cdecl; overload;
{class} function wrap(array_: TJavaArray<Integer>): JIntBuffer; cdecl; overload;
end;
[JavaSignature('java/nio/IntBuffer')]
JIntBuffer = interface(JBuffer)
['{18A20B5E-DB12-4AE4-B1C8-EDAE822D4438}']
function &array: TJavaArray<Integer>; cdecl;
function arrayOffset: Integer; cdecl;
function asReadOnlyBuffer: JIntBuffer; cdecl;
function compact: JIntBuffer; cdecl;
function compareTo(that: JIntBuffer): Integer; cdecl;
function duplicate: JIntBuffer; cdecl;
function equals(ob: JObject): Boolean; cdecl;
function &get: Integer; cdecl; overload;
function &get(index: Integer): Integer; cdecl; overload;
function &get(dst: TJavaArray<Integer>; offset: Integer; length: Integer): JIntBuffer; cdecl; overload;
function &get(dst: TJavaArray<Integer>): JIntBuffer; cdecl; overload;
function hasArray: Boolean; cdecl;
function hashCode: Integer; cdecl;
function isDirect: Boolean; cdecl;
function order: JByteOrder; cdecl;
function put(i: Integer): JIntBuffer; cdecl; overload;
function put(index: Integer; i: Integer): JIntBuffer; cdecl; overload;
function put(src: JIntBuffer): JIntBuffer; cdecl; overload;
function put(src: TJavaArray<Integer>; offset: Integer; length: Integer): JIntBuffer; cdecl; overload;
function put(src: TJavaArray<Integer>): JIntBuffer; cdecl; overload;
function slice: JIntBuffer; cdecl;
function toString: JString; cdecl;
end;
TJIntBuffer = class(TJavaGenericImport<JIntBufferClass, JIntBuffer>) end;
JLongBufferClass = interface(JBufferClass)
['{2DD88EBD-4825-41DD-81D4-547FE1186E0F}']
{class} function allocate(capacity: Integer): JLongBuffer; cdecl;
{class} function wrap(array_: TJavaArray<Int64>; offset: Integer; length: Integer): JLongBuffer; cdecl; overload;
{class} function wrap(array_: TJavaArray<Int64>): JLongBuffer; cdecl; overload;
end;
[JavaSignature('java/nio/LongBuffer')]
JLongBuffer = interface(JBuffer)
['{C28DFBB8-1B26-447C-944E-74C879A70A89}']
function &array: TJavaArray<Int64>; cdecl;
function arrayOffset: Integer; cdecl;
function asReadOnlyBuffer: JLongBuffer; cdecl;
function compact: JLongBuffer; cdecl;
function compareTo(that: JLongBuffer): Integer; cdecl;
function duplicate: JLongBuffer; cdecl;
function equals(ob: JObject): Boolean; cdecl;
function &get: Int64; cdecl; overload;
function &get(index: Integer): Int64; cdecl; overload;
function &get(dst: TJavaArray<Int64>; offset: Integer; length: Integer): JLongBuffer; cdecl; overload;
function &get(dst: TJavaArray<Int64>): JLongBuffer; cdecl; overload;
function hasArray: Boolean; cdecl;
function hashCode: Integer; cdecl;
function isDirect: Boolean; cdecl;
function order: JByteOrder; cdecl;
function put(l: Int64): JLongBuffer; cdecl; overload;
function put(index: Integer; l: Int64): JLongBuffer; cdecl; overload;
function put(src: JLongBuffer): JLongBuffer; cdecl; overload;
function put(src: TJavaArray<Int64>; offset: Integer; length: Integer): JLongBuffer; cdecl; overload;
function put(src: TJavaArray<Int64>): JLongBuffer; cdecl; overload;
function slice: JLongBuffer; cdecl;
function toString: JString; cdecl;
end;
TJLongBuffer = class(TJavaGenericImport<JLongBufferClass, JLongBuffer>) end;
JMappedByteBufferClass = interface(JByteBufferClass)
['{8319CCA3-84E6-4EF9-9891-40E4EAF11FE0}']
end;
[JavaSignature('java/nio/MappedByteBuffer')]
JMappedByteBuffer = interface(JByteBuffer)
['{744B5B84-744A-436D-ABFB-DC3EB2C9022A}']
function force: JMappedByteBuffer; cdecl;
function isLoaded: Boolean; cdecl;
function load: JMappedByteBuffer; cdecl;
end;
TJMappedByteBuffer = class(TJavaGenericImport<JMappedByteBufferClass, JMappedByteBuffer>) end;
JShortBufferClass = interface(JBufferClass)
['{7F52529D-4DFE-4414-B069-986D89949E27}']
{class} function allocate(capacity: Integer): JShortBuffer; cdecl;
{class} function wrap(array_: TJavaArray<SmallInt>; offset: Integer; length: Integer): JShortBuffer; cdecl; overload;
{class} function wrap(array_: TJavaArray<SmallInt>): JShortBuffer; cdecl; overload;
end;
[JavaSignature('java/nio/ShortBuffer')]
JShortBuffer = interface(JBuffer)
['{37B8425A-8596-4CA0-966F-629D0F25C8E9}']
function &array: TJavaArray<SmallInt>; cdecl;
function arrayOffset: Integer; cdecl;
function asReadOnlyBuffer: JShortBuffer; cdecl;
function compact: JShortBuffer; cdecl;
function compareTo(that: JShortBuffer): Integer; cdecl;
function duplicate: JShortBuffer; cdecl;
function equals(ob: JObject): Boolean; cdecl;
function &get: SmallInt; cdecl; overload;
function &get(index: Integer): SmallInt; cdecl; overload;
function &get(dst: TJavaArray<SmallInt>; offset: Integer; length: Integer): JShortBuffer; cdecl; overload;
function &get(dst: TJavaArray<SmallInt>): JShortBuffer; cdecl; overload;
function hasArray: Boolean; cdecl;
function hashCode: Integer; cdecl;
function isDirect: Boolean; cdecl;
function order: JByteOrder; cdecl;
function put(s: SmallInt): JShortBuffer; cdecl; overload;
function put(index: Integer; s: SmallInt): JShortBuffer; cdecl; overload;
function put(src: JShortBuffer): JShortBuffer; cdecl; overload;
function put(src: TJavaArray<SmallInt>; offset: Integer; length: Integer): JShortBuffer; cdecl; overload;
function put(src: TJavaArray<SmallInt>): JShortBuffer; cdecl; overload;
function slice: JShortBuffer; cdecl;
function toString: JString; cdecl;
end;
TJShortBuffer = class(TJavaGenericImport<JShortBufferClass, JShortBuffer>) end;
JAsynchronousFileChannelClass = interface(JObjectClass)
['{3FF811CE-7537-46C1-888F-6C1B2DC3E348}']
end;
[JavaSignature('java/nio/channels/AsynchronousFileChannel')]
JAsynchronousFileChannel = interface(JObject)
['{75859ED6-C6B8-4AD2-A87E-D2494E409383}']
procedure force(metaData: Boolean); cdecl;
procedure lock(position: Int64; size: Int64; shared: Boolean; attachment: JObject; handler: JCompletionHandler); cdecl; overload;
procedure lock(attachment: JObject; handler: JCompletionHandler); cdecl; overload;
function lock(position: Int64; size: Int64; shared: Boolean): JFuture; cdecl; overload;
function lock: JFuture; cdecl; overload;
procedure read(dst: JByteBuffer; position: Int64; attachment: JObject; handler: JCompletionHandler); cdecl; overload;
function read(dst: JByteBuffer; position: Int64): JFuture; cdecl; overload;
function size: Int64; cdecl;
function truncate(size: Int64): JAsynchronousFileChannel; cdecl;
function tryLock(position: Int64; size: Int64; shared: Boolean): JFileLock; cdecl; overload;
function tryLock: JFileLock; cdecl; overload;
procedure write(src: JByteBuffer; position: Int64; attachment: JObject; handler: JCompletionHandler); cdecl; overload;
function write(src: JByteBuffer; position: Int64): JFuture; cdecl; overload;
end;
TJAsynchronousFileChannel = class(TJavaGenericImport<JAsynchronousFileChannelClass, JAsynchronousFileChannel>) end;
JChannelClass = interface(JCloseableClass)
['{0902E632-8B6C-4FCD-9C18-C69A76F11C8B}']
end;
[JavaSignature('java/nio/channels/Channel')]
JChannel = interface(JCloseable)
['{34601709-0C2E-4791-BFBD-703EE16A9203}']
procedure close; cdecl;
function isOpen: Boolean; cdecl;
end;
TJChannel = class(TJavaGenericImport<JChannelClass, JChannel>) end;
JReadableByteChannelClass = interface(JChannelClass)
['{3B4589E7-BD37-4B54-AC98-44050F3AE209}']
end;
[JavaSignature('java/nio/channels/ReadableByteChannel')]
JReadableByteChannel = interface(JChannel)
['{D6B0CB63-51D0-48C6-882A-A44D30FD7521}']
function read(dst: JByteBuffer): Integer; cdecl;
end;
TJReadableByteChannel = class(TJavaGenericImport<JReadableByteChannelClass, JReadableByteChannel>) end;
JByteChannelClass = interface(JReadableByteChannelClass)
['{6343504F-BBAC-463E-B4DD-06D01C7FA81C}']
end;
[JavaSignature('java/nio/channels/ByteChannel')]
JByteChannel = interface(JReadableByteChannel)
['{9C81B103-74C3-4CD1-B7D0-47CFD215C8D2}']
end;
TJByteChannel = class(TJavaGenericImport<JByteChannelClass, JByteChannel>) end;
JCompletionHandlerClass = interface(IJavaClass)
['{6AFDC8A0-EA8A-449E-ACC6-C714253E7A87}']
end;
[JavaSignature('java/nio/channels/CompletionHandler')]
JCompletionHandler = interface(IJavaInstance)
['{385389E3-D8BC-496F-8664-2BEBE4FE0528}']
procedure completed(result: JObject; attachment: JObject); cdecl;
procedure failed(exc: JThrowable; attachment: JObject); cdecl;
end;
TJCompletionHandler = class(TJavaGenericImport<JCompletionHandlerClass, JCompletionHandler>) end;
JAbstractInterruptibleChannelClass = interface(JObjectClass)
['{D731C7B5-9CD9-4511-9F57-5CD66940B97E}']
end;
[JavaSignature('java/nio/channels/spi/AbstractInterruptibleChannel')]
JAbstractInterruptibleChannel = interface(JObject)
['{DD7C42BD-DAA0-4134-A220-0DFAE23964AF}']
procedure close; cdecl;
function isOpen: Boolean; cdecl;
end;
TJAbstractInterruptibleChannel = class(TJavaGenericImport<JAbstractInterruptibleChannelClass, JAbstractInterruptibleChannel>) end;
JSelectableChannelClass = interface(JAbstractInterruptibleChannelClass)
['{F0A109A2-C857-4C0B-91FC-DC9E4EA0D1F5}']
end;
[JavaSignature('java/nio/channels/SelectableChannel')]
JSelectableChannel = interface(JAbstractInterruptibleChannel)
['{539916DF-2B5B-4EBC-B849-666F3DD4FF0C}']
function blockingLock: JObject; cdecl;
function configureBlocking(block: Boolean): JSelectableChannel; cdecl;
function isBlocking: Boolean; cdecl;
function isRegistered: Boolean; cdecl;
function keyFor(sel: JSelector): JSelectionKey; cdecl;
function provider: JSelectorProvider; cdecl;
function register(sel: JSelector; ops: Integer; att: JObject): JSelectionKey; cdecl; overload;
function register(sel: JSelector; ops: Integer): JSelectionKey; cdecl; overload;
function validOps: Integer; cdecl;
end;
TJSelectableChannel = class(TJavaGenericImport<JSelectableChannelClass, JSelectableChannel>) end;
JAbstractSelectableChannelClass = interface(JSelectableChannelClass)
['{37576352-D59D-443D-AF66-1C3123236500}']
end;
[JavaSignature('java/nio/channels/spi/AbstractSelectableChannel')]
JAbstractSelectableChannel = interface(JSelectableChannel)
['{28EB411A-49FE-4194-9591-CC8E2349B35A}']
function blockingLock: JObject; cdecl;
function configureBlocking(block: Boolean): JSelectableChannel; cdecl;
function isBlocking: Boolean; cdecl;
function isRegistered: Boolean; cdecl;
function keyFor(sel: JSelector): JSelectionKey; cdecl;
function provider: JSelectorProvider; cdecl;
function register(sel: JSelector; ops: Integer; att: JObject): JSelectionKey; cdecl;
end;
TJAbstractSelectableChannel = class(TJavaGenericImport<JAbstractSelectableChannelClass, JAbstractSelectableChannel>) end;
JDatagramChannelClass = interface(JAbstractSelectableChannelClass)
['{39ACC9DA-3833-4EAA-ABDA-904EBB9D1D82}']
{class} function open: JDatagramChannel; cdecl; overload;
{class} //function open(family: JProtocolFamily): JDatagramChannel; cdecl; overload;
end;
[JavaSignature('java/nio/channels/DatagramChannel')]
JDatagramChannel = interface(JAbstractSelectableChannel)
['{90205C70-B349-480B-BEFA-1B850C27F130}']
//function bind(local: JSocketAddress): JDatagramChannel; cdecl;
//function connect(remote: JSocketAddress): JDatagramChannel; cdecl;
function disconnect: JDatagramChannel; cdecl;
//function getLocalAddress: JSocketAddress; cdecl;
//function getRemoteAddress: JSocketAddress; cdecl;
function isConnected: Boolean; cdecl;
function read(dst: JByteBuffer): Integer; cdecl; overload;
function read(dsts: TJavaObjectArray<JByteBuffer>; offset: Integer; length: Integer): Int64; cdecl; overload;
function read(dsts: TJavaObjectArray<JByteBuffer>): Int64; cdecl; overload;
//function receive(dst: JByteBuffer): JSocketAddress; cdecl;
//function send(src: JByteBuffer; target: JSocketAddress): Integer; cdecl;
//function setOption(name: JSocketOption; value: JObject): JDatagramChannel; cdecl;
//function socket: JDatagramSocket; cdecl;
function validOps: Integer; cdecl;
function write(src: JByteBuffer): Integer; cdecl; overload;
function write(srcs: TJavaObjectArray<JByteBuffer>; offset: Integer; length: Integer): Int64; cdecl; overload;
function write(srcs: TJavaObjectArray<JByteBuffer>): Int64; cdecl; overload;
end;
TJDatagramChannel = class(TJavaGenericImport<JDatagramChannelClass, JDatagramChannel>) end;
JFileChannelClass = interface(JAbstractInterruptibleChannelClass)
['{35072FC4-075A-45BF-99F9-E2ED20581B95}']
end;
[JavaSignature('java/nio/channels/FileChannel')]
JFileChannel = interface(JAbstractInterruptibleChannel)
['{DD170413-4811-4479-96FD-C32E336E8FA9}']
procedure force(metaData: Boolean); cdecl;
function lock(position: Int64; size: Int64; shared: Boolean): JFileLock; cdecl; overload;
function lock: JFileLock; cdecl; overload;
function map(mode: JFileChannel_MapMode; position: Int64; size: Int64): JMappedByteBuffer; cdecl;
function position: Int64; cdecl; overload;
function position(newPosition: Int64): JFileChannel; cdecl; overload;
function read(dst: JByteBuffer): Integer; cdecl; overload;
function read(dsts: TJavaObjectArray<JByteBuffer>; offset: Integer; length: Integer): Int64; cdecl; overload;
function read(dsts: TJavaObjectArray<JByteBuffer>): Int64; cdecl; overload;
function read(dst: JByteBuffer; position: Int64): Integer; cdecl; overload;
function size: Int64; cdecl;
function transferFrom(src: JReadableByteChannel; position: Int64; count: Int64): Int64; cdecl;
function transferTo(position: Int64; count: Int64; target: JWritableByteChannel): Int64; cdecl;
function truncate(size: Int64): JFileChannel; cdecl;
function tryLock(position: Int64; size: Int64; shared: Boolean): JFileLock; cdecl; overload;
function tryLock: JFileLock; cdecl; overload;
function write(src: JByteBuffer): Integer; cdecl; overload;
function write(srcs: TJavaObjectArray<JByteBuffer>; offset: Integer; length: Integer): Int64; cdecl; overload;
function write(srcs: TJavaObjectArray<JByteBuffer>): Int64; cdecl; overload;
function write(src: JByteBuffer; position: Int64): Integer; cdecl; overload;
end;
TJFileChannel = class(TJavaGenericImport<JFileChannelClass, JFileChannel>) end;
JFileChannel_MapModeClass = interface(JObjectClass)
['{428D8B72-313B-49EE-AC4B-6DD16908BBA5}']
{class} function _GetPRIVATE: JFileChannel_MapMode; cdecl;
{class} function _GetREAD_ONLY: JFileChannel_MapMode; cdecl;
{class} function _GetREAD_WRITE: JFileChannel_MapMode; cdecl;
{class} property &PRIVATE: JFileChannel_MapMode read _GetPRIVATE;
{class} property READ_ONLY: JFileChannel_MapMode read _GetREAD_ONLY;
{class} property READ_WRITE: JFileChannel_MapMode read _GetREAD_WRITE;
end;
[JavaSignature('java/nio/channels/FileChannel$MapMode')]
JFileChannel_MapMode = interface(JObject)
['{15CFAED9-B5FC-454D-9463-507D14032869}']
function toString: JString; cdecl;
end;
TJFileChannel_MapMode = class(TJavaGenericImport<JFileChannel_MapModeClass, JFileChannel_MapMode>) end;
JFileLockClass = interface(JObjectClass)
['{5E237114-5198-4D43-8490-313B47A05E81}']
end;
[JavaSignature('java/nio/channels/FileLock')]
JFileLock = interface(JObject)
['{03C7F0F6-5A57-4A51-A083-43258AA01093}']
function acquiredBy: JChannel; cdecl;
function channel: JFileChannel; cdecl;
procedure close; cdecl;
function isShared: Boolean; cdecl;
function isValid: Boolean; cdecl;
function overlaps(position: Int64; size: Int64): Boolean; cdecl;
function position: Int64; cdecl;
procedure release; cdecl;
function size: Int64; cdecl;
function toString: JString; cdecl;
end;
TJFileLock = class(TJavaGenericImport<JFileLockClass, JFileLock>) end;
JPipeClass = interface(JObjectClass)
['{27E376BA-2D69-474C-AE28-C30BC063BEC0}']
{class} function open: JPipe; cdecl;
end;
[JavaSignature('java/nio/channels/Pipe')]
JPipe = interface(JObject)
['{E872278A-401B-414F-9AEF-3D9DC22CD9E9}']
function sink: JPipe_SinkChannel; cdecl;
function source: JPipe_SourceChannel; cdecl;
end;
TJPipe = class(TJavaGenericImport<JPipeClass, JPipe>) end;
JPipe_SinkChannelClass = interface(JAbstractSelectableChannelClass)
['{F48BD363-BB19-4354-AFA3-45E78FE4C3FC}']
end;
[JavaSignature('java/nio/channels/Pipe$SinkChannel')]
JPipe_SinkChannel = interface(JAbstractSelectableChannel)
['{53C39991-334C-48BF-85B4-7DDFD5859755}']
function validOps: Integer; cdecl;
end;
TJPipe_SinkChannel = class(TJavaGenericImport<JPipe_SinkChannelClass, JPipe_SinkChannel>) end;
JPipe_SourceChannelClass = interface(JAbstractSelectableChannelClass)
['{EFD0625C-C800-4F5A-9A61-9E30291FA04F}']
end;
[JavaSignature('java/nio/channels/Pipe$SourceChannel')]
JPipe_SourceChannel = interface(JAbstractSelectableChannel)
['{256FD88E-5BBC-41E2-97DC-4546CF1220FD}']
function validOps: Integer; cdecl;
end;
TJPipe_SourceChannel = class(TJavaGenericImport<JPipe_SourceChannelClass, JPipe_SourceChannel>) end;
JSeekableByteChannelClass = interface(JByteChannelClass)
['{7609D629-7064-4919-85EA-9757D4EB8933}']
end;
[JavaSignature('java/nio/channels/SeekableByteChannel')]
JSeekableByteChannel = interface(JByteChannel)
['{A0A27EA8-D623-409D-A9EE-AA4C3EEFBBB0}']
function position: Int64; cdecl; overload;
function position(newPosition: Int64): JSeekableByteChannel; cdecl; overload;
function read(dst: JByteBuffer): Integer; cdecl;
function size: Int64; cdecl;
function truncate(size: Int64): JSeekableByteChannel; cdecl;
function write(src: JByteBuffer): Integer; cdecl;
end;
TJSeekableByteChannel = class(TJavaGenericImport<JSeekableByteChannelClass, JSeekableByteChannel>) end;
JSelectionKeyClass = interface(JObjectClass)
['{718617CF-8E56-41EF-982B-1DE5540C7639}']
{class} function _GetOP_ACCEPT: Integer; cdecl;
{class} function _GetOP_CONNECT: Integer; cdecl;
{class} function _GetOP_READ: Integer; cdecl;
{class} function _GetOP_WRITE: Integer; cdecl;
{class} property OP_ACCEPT: Integer read _GetOP_ACCEPT;
{class} property OP_CONNECT: Integer read _GetOP_CONNECT;
{class} property OP_READ: Integer read _GetOP_READ;
{class} property OP_WRITE: Integer read _GetOP_WRITE;
end;
[JavaSignature('java/nio/channels/SelectionKey')]
JSelectionKey = interface(JObject)
['{22CE5584-F7C1-41E4-BA87-008827EFEEAA}']
function attach(ob: JObject): JObject; cdecl;
function attachment: JObject; cdecl;
procedure cancel; cdecl;
function channel: JSelectableChannel; cdecl;
function interestOps: Integer; cdecl; overload;
function interestOps(ops: Integer): JSelectionKey; cdecl; overload;
function isAcceptable: Boolean; cdecl;
function isConnectable: Boolean; cdecl;
function isReadable: Boolean; cdecl;
function isValid: Boolean; cdecl;
function isWritable: Boolean; cdecl;
function readyOps: Integer; cdecl;
function selector: JSelector; cdecl;
end;
TJSelectionKey = class(TJavaGenericImport<JSelectionKeyClass, JSelectionKey>) end;
JSelectorClass = interface(JObjectClass)
['{E1CC5599-DD36-4998-A426-92BE0A6B5DC9}']
{class} function open: JSelector; cdecl;
end;
[JavaSignature('java/nio/channels/Selector')]
JSelector = interface(JObject)
['{0E8BCD73-DAF7-420A-8891-835ED1EC82BF}']
procedure close; cdecl;
function isOpen: Boolean; cdecl;
function keys: JSet; cdecl;
function provider: JSelectorProvider; cdecl;
function select(timeout: Int64): Integer; cdecl; overload;
function select: Integer; cdecl; overload;
function selectNow: Integer; cdecl;
function selectedKeys: JSet; cdecl;
function wakeup: JSelector; cdecl;
end;
TJSelector = class(TJavaGenericImport<JSelectorClass, JSelector>) end;
JServerSocketChannelClass = interface(JAbstractSelectableChannelClass)
['{D5B3AB40-C62C-4B8B-A579-A8B73DFCA5F8}']
{class} function open: JServerSocketChannel; cdecl;
end;
[JavaSignature('java/nio/channels/ServerSocketChannel')]
JServerSocketChannel = interface(JAbstractSelectableChannel)
['{5485D000-B8EE-4DCE-9DBE-8A094441F255}']
function accept: JSocketChannel; cdecl;
//function bind(local: JSocketAddress): JServerSocketChannel; cdecl; overload;
//function bind(local: JSocketAddress; backlog: Integer): JServerSocketChannel; cdecl; overload;
//function getLocalAddress: JSocketAddress; cdecl;
//function setOption(name: JSocketOption; value: JObject): JServerSocketChannel; cdecl;
//function socket: JServerSocket; cdecl;
function validOps: Integer; cdecl;
end;
TJServerSocketChannel = class(TJavaGenericImport<JServerSocketChannelClass, JServerSocketChannel>) end;
JSocketChannelClass = interface(JAbstractSelectableChannelClass)
['{AC06A3C8-B76A-45CD-9CAA-C03E931A3828}']
{class} function open: JSocketChannel; cdecl; overload;
{class} //function open(remote: JSocketAddress): JSocketChannel; cdecl; overload;
end;
[JavaSignature('java/nio/channels/SocketChannel')]
JSocketChannel = interface(JAbstractSelectableChannel)
['{04388B66-A713-4476-98A7-A20D99310947}']
//function bind(local: JSocketAddress): JSocketChannel; cdecl;
//function connect(remote: JSocketAddress): Boolean; cdecl;
function finishConnect: Boolean; cdecl;
//function getLocalAddress: JSocketAddress; cdecl;
//function getRemoteAddress: JSocketAddress; cdecl;
function isConnected: Boolean; cdecl;
function isConnectionPending: Boolean; cdecl;
function read(dst: JByteBuffer): Integer; cdecl; overload;
function read(dsts: TJavaObjectArray<JByteBuffer>; offset: Integer; length: Integer): Int64; cdecl; overload;
function read(dsts: TJavaObjectArray<JByteBuffer>): Int64; cdecl; overload;
//function setOption(name: JSocketOption; value: JObject): JSocketChannel; cdecl;
function shutdownInput: JSocketChannel; cdecl;
function shutdownOutput: JSocketChannel; cdecl;
//function socket: JSocket; cdecl;
function validOps: Integer; cdecl;
function write(src: JByteBuffer): Integer; cdecl; overload;
function write(srcs: TJavaObjectArray<JByteBuffer>; offset: Integer; length: Integer): Int64; cdecl; overload;
function write(srcs: TJavaObjectArray<JByteBuffer>): Int64; cdecl; overload;
end;
TJSocketChannel = class(TJavaGenericImport<JSocketChannelClass, JSocketChannel>) end;
JWritableByteChannelClass = interface(JChannelClass)
['{C4B313F1-68CA-4254-A782-3473DAD7E786}']
end;
[JavaSignature('java/nio/channels/WritableByteChannel')]
JWritableByteChannel = interface(JChannel)
['{58ABD8D1-20A0-4022-8CDE-C68B6A032191}']
function write(src: JByteBuffer): Integer; cdecl;
end;
TJWritableByteChannel = class(TJavaGenericImport<JWritableByteChannelClass, JWritableByteChannel>) end;
JAbstractSelectorClass = interface(JSelectorClass)
['{EF1FBF60-D39E-48AF-9326-CD3B500AFA56}']
end;
[JavaSignature('java/nio/channels/spi/AbstractSelector')]
JAbstractSelector = interface(JSelector)
['{1583A67A-8E15-44A0-8943-EE898E4216F9}']
procedure close; cdecl;
function isOpen: Boolean; cdecl;
function provider: JSelectorProvider; cdecl;
end;
TJAbstractSelector = class(TJavaGenericImport<JAbstractSelectorClass, JAbstractSelector>) end;
JSelectorProviderClass = interface(JObjectClass)
['{52BA6B52-FF27-4051-B86B-4465C88E8830}']
{class} function provider: JSelectorProvider; cdecl;
end;
[JavaSignature('java/nio/channels/spi/SelectorProvider')]
JSelectorProvider = interface(JObject)
['{2217E1DD-E7B2-44E1-B932-E01CAAFF013A}']
function inheritedChannel: JChannel; cdecl;
function openDatagramChannel: JDatagramChannel; cdecl; overload;
//function openDatagramChannel(family: JProtocolFamily): JDatagramChannel; cdecl; overload;
function openPipe: JPipe; cdecl;
function openSelector: JAbstractSelector; cdecl;
function openServerSocketChannel: JServerSocketChannel; cdecl;
function openSocketChannel: JSocketChannel; cdecl;
end;
TJSelectorProvider = class(TJavaGenericImport<JSelectorProviderClass, JSelectorProvider>) end;
JCharsetClass = interface(JObjectClass)
['{8BBFEE2C-642D-4F32-8839-0C459948A70A}']
{class} function availableCharsets: JSortedMap; cdecl;
{class} function defaultCharset: JCharset; cdecl;
{class} function forName(charsetName: JString): JCharset; cdecl;
{class} function isSupported(charsetName: JString): Boolean; cdecl;
end;
[JavaSignature('java/nio/charset/Charset')]
JCharset = interface(JObject)
['{0B41CD4C-80D6-45E5-997E-B83EF313AB67}']
function aliases: JSet; cdecl;
function canEncode: Boolean; cdecl;
function compareTo(that: JCharset): Integer; cdecl;
function &contains(cs: JCharset): Boolean; cdecl;
function decode(bb: JByteBuffer): JCharBuffer; cdecl;
function displayName: JString; cdecl; overload;
function displayName(locale: JLocale): JString; cdecl; overload;
function encode(cb: JCharBuffer): JByteBuffer; cdecl; overload;
function encode(str: JString): JByteBuffer; cdecl; overload;
function equals(ob: JObject): Boolean; cdecl;
function hashCode: Integer; cdecl;
function isRegistered: Boolean; cdecl;
function name: JString; cdecl;
function newDecoder: JCharsetDecoder; cdecl;
function newEncoder: JCharsetEncoder; cdecl;
function toString: JString; cdecl;
end;
TJCharset = class(TJavaGenericImport<JCharsetClass, JCharset>) end;
JCharsetDecoderClass = interface(JObjectClass)
['{2F0FAD80-3FFC-419C-AD52-28071482CCA1}']
end;
[JavaSignature('java/nio/charset/CharsetDecoder')]
JCharsetDecoder = interface(JObject)
['{F7AFF095-6D34-470F-B2C6-B68F75C40D26}']
function averageCharsPerByte: Single; cdecl;
function charset: JCharset; cdecl;
function decode(in_: JByteBuffer; out_: JCharBuffer; endOfInput: Boolean): JCoderResult; cdecl; overload;
function decode(in_: JByteBuffer): JCharBuffer; cdecl; overload;
function detectedCharset: JCharset; cdecl;
function flush(out_: JCharBuffer): JCoderResult; cdecl;
function isAutoDetecting: Boolean; cdecl;
function isCharsetDetected: Boolean; cdecl;
function malformedInputAction: JCodingErrorAction; cdecl;
function maxCharsPerByte: Single; cdecl;
function onMalformedInput(newAction: JCodingErrorAction): JCharsetDecoder; cdecl;
function onUnmappableCharacter(newAction: JCodingErrorAction): JCharsetDecoder; cdecl;
function replaceWith(newReplacement: JString): JCharsetDecoder; cdecl;
function replacement: JString; cdecl;
function reset: JCharsetDecoder; cdecl;
function unmappableCharacterAction: JCodingErrorAction; cdecl;
end;
TJCharsetDecoder = class(TJavaGenericImport<JCharsetDecoderClass, JCharsetDecoder>) end;
JCharsetEncoderClass = interface(JObjectClass)
['{F107BD1C-B97C-4163-BFAC-1F620CC30D02}']
end;
[JavaSignature('java/nio/charset/CharsetEncoder')]
JCharsetEncoder = interface(JObject)
['{6126DFBE-1E4C-4F67-8F42-A2B312E6CE96}']
function averageBytesPerChar: Single; cdecl;
function canEncode(c: Char): Boolean; cdecl; overload;
function canEncode(cs: JCharSequence): Boolean; cdecl; overload;
function charset: JCharset; cdecl;
function encode(in_: JCharBuffer; out_: JByteBuffer; endOfInput: Boolean): JCoderResult; cdecl; overload;
function encode(in_: JCharBuffer): JByteBuffer; cdecl; overload;
function flush(out_: JByteBuffer): JCoderResult; cdecl;
function isLegalReplacement(repl: TJavaArray<Byte>): Boolean; cdecl;
function malformedInputAction: JCodingErrorAction; cdecl;
function maxBytesPerChar: Single; cdecl;
function onMalformedInput(newAction: JCodingErrorAction): JCharsetEncoder; cdecl;
function onUnmappableCharacter(newAction: JCodingErrorAction): JCharsetEncoder; cdecl;
function replaceWith(newReplacement: TJavaArray<Byte>): JCharsetEncoder; cdecl;
function replacement: TJavaArray<Byte>; cdecl;
function reset: JCharsetEncoder; cdecl;
function unmappableCharacterAction: JCodingErrorAction; cdecl;
end;
TJCharsetEncoder = class(TJavaGenericImport<JCharsetEncoderClass, JCharsetEncoder>) end;
JCoderResultClass = interface(JObjectClass)
['{FDEBE443-A1F2-4DCF-9AA7-5D674CE88E70}']
{class} function _GetOVERFLOW: JCoderResult; cdecl;
{class} function _GetUNDERFLOW: JCoderResult; cdecl;
{class} function malformedForLength(length: Integer): JCoderResult; cdecl;
{class} function unmappableForLength(length: Integer): JCoderResult; cdecl;
{class} property OVERFLOW: JCoderResult read _GetOVERFLOW;
{class} property UNDERFLOW: JCoderResult read _GetUNDERFLOW;
end;
[JavaSignature('java/nio/charset/CoderResult')]
JCoderResult = interface(JObject)
['{2107C07D-63CF-408D-AAA0-8E36DDD4484C}']
function isError: Boolean; cdecl;
function isMalformed: Boolean; cdecl;
function isOverflow: Boolean; cdecl;
function isUnderflow: Boolean; cdecl;
function isUnmappable: Boolean; cdecl;
function length: Integer; cdecl;
procedure throwException; cdecl;
function toString: JString; cdecl;
end;
TJCoderResult = class(TJavaGenericImport<JCoderResultClass, JCoderResult>) end;
JCodingErrorActionClass = interface(JObjectClass)
['{8E806C03-E513-41D4-AA2E-8E0A38670EF9}']
{class} function _GetIGNORE: JCodingErrorAction; cdecl;
{class} function _GetREPLACE: JCodingErrorAction; cdecl;
{class} function _GetREPORT: JCodingErrorAction; cdecl;
{class} property IGNORE: JCodingErrorAction read _GetIGNORE;
{class} property REPLACE: JCodingErrorAction read _GetREPLACE;
{class} property REPORT: JCodingErrorAction read _GetREPORT;
end;
[JavaSignature('java/nio/charset/CodingErrorAction')]
JCodingErrorAction = interface(JObject)
['{46131CDD-61F4-4F10-8DC3-449D297DF12E}']
function toString: JString; cdecl;
end;
TJCodingErrorAction = class(TJavaGenericImport<JCodingErrorActionClass, JCodingErrorAction>) end;
JAccessModeClass = interface(JEnumClass)
['{359AA90C-FFE5-4D77-BD13-A579C5F98F98}']
{class} function _GetEXECUTE: JAccessMode; cdecl;
{class} function _GetREAD: JAccessMode; cdecl;
{class} function _GetWRITE: JAccessMode; cdecl;
{class} function valueOf(name: JString): JAccessMode; cdecl;
{class} function values: TJavaObjectArray<JAccessMode>; cdecl;
{class} property EXECUTE: JAccessMode read _GetEXECUTE;
{class} property READ: JAccessMode read _GetREAD;
{class} property WRITE: JAccessMode read _GetWRITE;
end;
[JavaSignature('java/nio/file/AccessMode')]
JAccessMode = interface(JEnum)
['{06F1012F-147D-4D87-B04F-745978902672}']
end;
TJAccessMode = class(TJavaGenericImport<JAccessModeClass, JAccessMode>) end;
JCopyOptionClass = interface(IJavaClass)
['{3C30C593-9D1E-4963-AEEA-F3F500507850}']
end;
[JavaSignature('java/nio/file/CopyOption')]
JCopyOption = interface(IJavaInstance)
['{38C62D62-5CF9-4AA0-93A4-703E5E9AD61F}']
end;
TJCopyOption = class(TJavaGenericImport<JCopyOptionClass, JCopyOption>) end;
JDirectoryStreamClass = interface(JCloseableClass)
['{FAA128E2-295A-47DD-85B8-B0719825E5D4}']
end;
[JavaSignature('java/nio/file/DirectoryStream')]
JDirectoryStream = interface(JCloseable)
['{B67FFFED-1A33-4809-A711-ABE5A8CC9CB8}']
function iterator: JIterator; cdecl;
end;
TJDirectoryStream = class(TJavaGenericImport<JDirectoryStreamClass, JDirectoryStream>) end;
JDirectoryStream_FilterClass = interface(IJavaClass)
['{4A6453E2-ADA7-45D7-8D59-7D1E75051901}']
end;
[JavaSignature('java/nio/file/DirectoryStream$Filter')]
JDirectoryStream_Filter = interface(IJavaInstance)
['{13307FEB-7B35-447D-9820-25DD120F66C5}']
function accept(entry: JObject): Boolean; cdecl;
end;
TJDirectoryStream_Filter = class(TJavaGenericImport<JDirectoryStream_FilterClass, JDirectoryStream_Filter>) end;
JFileStoreClass = interface(JObjectClass)
['{257755A9-B23C-4F74-ADCB-BCC9F7B903B5}']
end;
[JavaSignature('java/nio/file/FileStore')]
JFileStore = interface(JObject)
['{828937A9-B1C9-4C6B-8007-40E6DEA8474C}']
function getAttribute(attribute: JString): JObject; cdecl;
function getFileStoreAttributeView(type_: Jlang_Class): JFileStoreAttributeView; cdecl;
function getTotalSpace: Int64; cdecl;
function getUnallocatedSpace: Int64; cdecl;
function getUsableSpace: Int64; cdecl;
function isReadOnly: Boolean; cdecl;
function name: JString; cdecl;
function supportsFileAttributeView(type_: Jlang_Class): Boolean; cdecl; overload;
function supportsFileAttributeView(name: JString): Boolean; cdecl; overload;
function &type: JString; cdecl;
end;
TJFileStore = class(TJavaGenericImport<JFileStoreClass, JFileStore>) end;
JFileSystemClass = interface(JObjectClass)
['{368BB60D-66F2-4C9F-805E-5754CD6B2417}']
end;
[JavaSignature('java/nio/file/FileSystem')]
JFileSystem = interface(JObject)
['{5B239AC2-540A-4290-B23C-86E1EDB7BCC6}']
procedure close; cdecl;
function getFileStores: JIterable; cdecl;
function getPathMatcher(syntaxAndPattern: JString): JPathMatcher; cdecl;
function getRootDirectories: JIterable; cdecl;
function getSeparator: JString; cdecl;
function getUserPrincipalLookupService: JUserPrincipalLookupService; cdecl;
function isOpen: Boolean; cdecl;
function isReadOnly: Boolean; cdecl;
function newWatchService: JWatchService; cdecl;
function provider: JFileSystemProvider; cdecl;
function supportedFileAttributeViews: JSet; cdecl;
end;
TJFileSystem = class(TJavaGenericImport<JFileSystemClass, JFileSystem>) end;
JLinkOptionClass = interface(JEnumClass)
['{A2300811-0A02-4512-98DB-35E023A89464}']
{class} function _GetNOFOLLOW_LINKS: JLinkOption; cdecl;
{class} function valueOf(name: JString): JLinkOption; cdecl;
{class} function values: TJavaObjectArray<JLinkOption>; cdecl;
{class} property NOFOLLOW_LINKS: JLinkOption read _GetNOFOLLOW_LINKS;
end;
[JavaSignature('java/nio/file/LinkOption')]
JLinkOption = interface(JEnum)
['{8515A9DE-C8C2-4B0D-873A-899A239D7FA1}']
end;
TJLinkOption = class(TJavaGenericImport<JLinkOptionClass, JLinkOption>) end;
JOpenOptionClass = interface(IJavaClass)
['{C69FF94F-9424-409C-8002-5FD88B7C1E80}']
end;
[JavaSignature('java/nio/file/OpenOption')]
JOpenOption = interface(IJavaInstance)
['{7FAD82D2-3D60-4AFF-8A36-FFCBD5692A6F}']
end;
TJOpenOption = class(TJavaGenericImport<JOpenOptionClass, JOpenOption>) end;
Jfile_PathClass = interface(JComparableClass)
['{C7F07FCD-7195-455B-A38B-FC3DDB7C7CEB}']
end;
[JavaSignature('java/nio/file/Path')]
Jfile_Path = interface(JComparable)
['{0AD66A9F-A263-42BD-B098-028D385F79B8}']
function compareTo(other: Jfile_Path): Integer; cdecl;
function endsWith(other: Jfile_Path): Boolean; cdecl; overload;
function endsWith(other: JString): Boolean; cdecl; overload;
function equals(other: JObject): Boolean; cdecl;
function getFileName: Jfile_Path; cdecl;
function getFileSystem: JFileSystem; cdecl;
function getName(index: Integer): Jfile_Path; cdecl;
function getNameCount: Integer; cdecl;
function getParent: Jfile_Path; cdecl;
function getRoot: Jfile_Path; cdecl;
function hashCode: Integer; cdecl;
function isAbsolute: Boolean; cdecl;
function iterator: JIterator; cdecl;
function normalize: Jfile_Path; cdecl;
function relativize(other: Jfile_Path): Jfile_Path; cdecl;
function resolve(other: Jfile_Path): Jfile_Path; cdecl; overload;
function resolve(other: JString): Jfile_Path; cdecl; overload;
function resolveSibling(other: Jfile_Path): Jfile_Path; cdecl; overload;
function resolveSibling(other: JString): Jfile_Path; cdecl; overload;
function startsWith(other: Jfile_Path): Boolean; cdecl; overload;
function startsWith(other: JString): Boolean; cdecl; overload;
function subpath(beginIndex: Integer; endIndex: Integer): Jfile_Path; cdecl;
function toAbsolutePath: Jfile_Path; cdecl;
function toFile: JFile; cdecl;
function toString: JString; cdecl;
//function toUri: JURI; cdecl;
end;
TJfile_Path = class(TJavaGenericImport<Jfile_PathClass, Jfile_Path>) end;
JPathMatcherClass = interface(IJavaClass)
['{940B0CAD-33F9-4C87-868E-6D4BF2EB1C3B}']
end;
[JavaSignature('java/nio/file/PathMatcher')]
JPathMatcher = interface(IJavaInstance)
['{0B8D485E-168A-4CAE-92CA-7DD9C770ED5D}']
function matches(path: Jfile_Path): Boolean; cdecl;
end;
TJPathMatcher = class(TJavaGenericImport<JPathMatcherClass, JPathMatcher>) end;
JWatchEvent_KindClass = interface(IJavaClass)
['{D57483F4-42A0-4F4F-8394-ACDC1A156748}']
end;
[JavaSignature('java/nio/file/WatchEvent$Kind')]
JWatchEvent_Kind = interface(IJavaInstance)
['{B7E6034C-BFE8-414A-997E-BE8F5430473F}']
function name: JString; cdecl;
function &type: Jlang_Class; cdecl;
end;
TJWatchEvent_Kind = class(TJavaGenericImport<JWatchEvent_KindClass, JWatchEvent_Kind>) end;
JWatchEvent_ModifierClass = interface(IJavaClass)
['{009D6EFF-C4B5-4616-BB7B-A502998590DB}']
end;
[JavaSignature('java/nio/file/WatchEvent$Modifier')]
JWatchEvent_Modifier = interface(IJavaInstance)
['{457EE6CB-758D-4659-880C-BD5689021CE5}']
function name: JString; cdecl;
end;
TJWatchEvent_Modifier = class(TJavaGenericImport<JWatchEvent_ModifierClass, JWatchEvent_Modifier>) end;
JWatchKeyClass = interface(IJavaClass)
['{746EBF40-933E-420F-98D1-C82BE8319A77}']
end;
[JavaSignature('java/nio/file/WatchKey')]
JWatchKey = interface(IJavaInstance)
['{E87F3CDF-A34A-4DD6-9338-B42D87A3F810}']
procedure cancel; cdecl;
function isValid: Boolean; cdecl;
function pollEvents: JList; cdecl;
function reset: Boolean; cdecl;
function watchable: JWatchable; cdecl;
end;
TJWatchKey = class(TJavaGenericImport<JWatchKeyClass, JWatchKey>) end;
JWatchServiceClass = interface(JCloseableClass)
['{865CBFEE-ED2E-4F04-A1DC-ECD854337C97}']
end;
[JavaSignature('java/nio/file/WatchService')]
JWatchService = interface(JCloseable)
['{CD96788C-4D94-499F-893D-569F418AD0AD}']
procedure close; cdecl;
function poll: JWatchKey; cdecl; overload;
function poll(timeout: Int64; unit_: JTimeUnit): JWatchKey; cdecl; overload;
function take: JWatchKey; cdecl;
end;
TJWatchService = class(TJavaGenericImport<JWatchServiceClass, JWatchService>) end;
JWatchableClass = interface(IJavaClass)
['{A8223BCE-0FF0-479A-B91D-9197692347A1}']
end;
[JavaSignature('java/nio/file/Watchable')]
JWatchable = interface(IJavaInstance)
['{DCBB9154-B301-4BF2-A63D-3BB93A5D2048}']
end;
TJWatchable = class(TJavaGenericImport<JWatchableClass, JWatchable>) end;
JAttributeViewClass = interface(IJavaClass)
['{AD295236-5FC4-43EE-96E8-252F9A78E53E}']
end;
[JavaSignature('java/nio/file/attribute/AttributeView')]
JAttributeView = interface(IJavaInstance)
['{B5173328-7EC7-440A-82CC-B28BA1F3DE0F}']
function name: JString; cdecl;
end;
TJAttributeView = class(TJavaGenericImport<JAttributeViewClass, JAttributeView>) end;
JBasicFileAttributesClass = interface(IJavaClass)
['{0CF0EB31-0130-4BAB-BF10-4244D9AE93AD}']
end;
[JavaSignature('java/nio/file/attribute/BasicFileAttributes')]
JBasicFileAttributes = interface(IJavaInstance)
['{ACE5A4C6-30F2-4668-888E-34A8482BFDBB}']
function creationTime: JFileTime; cdecl;
function fileKey: JObject; cdecl;
function isDirectory: Boolean; cdecl;
function isOther: Boolean; cdecl;
function isRegularFile: Boolean; cdecl;
function isSymbolicLink: Boolean; cdecl;
function lastAccessTime: JFileTime; cdecl;
function lastModifiedTime: JFileTime; cdecl;
function size: Int64; cdecl;
end;
TJBasicFileAttributes = class(TJavaGenericImport<JBasicFileAttributesClass, JBasicFileAttributes>) end;
JFileAttributeClass = interface(IJavaClass)
['{F377FE80-B20C-4D49-90C9-591D75814EAE}']
end;
[JavaSignature('java/nio/file/attribute/FileAttribute')]
JFileAttribute = interface(IJavaInstance)
['{4E01F49B-ACE2-4322-B250-0826C7713C71}']
function name: JString; cdecl;
function value: JObject; cdecl;
end;
TJFileAttribute = class(TJavaGenericImport<JFileAttributeClass, JFileAttribute>) end;
JFileAttributeViewClass = interface(JAttributeViewClass)
['{DAEE7CE5-149E-4557-A3EE-FFE24DC29521}']
end;
[JavaSignature('java/nio/file/attribute/FileAttributeView')]
JFileAttributeView = interface(JAttributeView)
['{4F594D60-4B12-44A1-843E-0A14F301D823}']
end;
TJFileAttributeView = class(TJavaGenericImport<JFileAttributeViewClass, JFileAttributeView>) end;
JFileStoreAttributeViewClass = interface(JAttributeViewClass)
['{C015741A-8EFB-4CF9-A3B8-3998722E1CF8}']
end;
[JavaSignature('java/nio/file/attribute/FileStoreAttributeView')]
JFileStoreAttributeView = interface(JAttributeView)
['{0F03442B-3203-4685-B196-5E3EB36A9039}']
end;
TJFileStoreAttributeView = class(TJavaGenericImport<JFileStoreAttributeViewClass, JFileStoreAttributeView>) end;
JFileTimeClass = interface(JObjectClass)
['{F53DC135-D2F3-4DC1-A52E-CA0335E1EB5E}']
{class} function from(value: Int64; unit_: JTimeUnit): JFileTime; cdecl; overload;
{class} function from(instant: JInstant): JFileTime; cdecl; overload;
{class} function fromMillis(value: Int64): JFileTime; cdecl;
end;
[JavaSignature('java/nio/file/attribute/FileTime')]
JFileTime = interface(JObject)
['{B8DDA58E-F438-4032-AC74-0CE24FEB5425}']
function compareTo(other: JFileTime): Integer; cdecl;
function equals(obj: JObject): Boolean; cdecl;
function hashCode: Integer; cdecl;
function &to(unit_: JTimeUnit): Int64; cdecl;
function toInstant: JInstant; cdecl;
function toMillis: Int64; cdecl;
function toString: JString; cdecl;
end;
TJFileTime = class(TJavaGenericImport<JFileTimeClass, JFileTime>) end;
// java.nio.file.attribute.UserPrincipal
// java.nio.file.attribute.GroupPrincipal
JUserPrincipalLookupServiceClass = interface(JObjectClass)
['{04C1CEF3-0DF3-4A57-943C-B697AA9DB7FC}']
end;
[JavaSignature('java/nio/file/attribute/UserPrincipalLookupService')]
JUserPrincipalLookupService = interface(JObject)
['{B0360D15-070D-44D5-89C3-73CC53B215A0}']
//function lookupPrincipalByGroupName(group: JString): JGroupPrincipal; cdecl;
//function lookupPrincipalByName(name: JString): JUserPrincipal; cdecl;
end;
TJUserPrincipalLookupService = class(TJavaGenericImport<JUserPrincipalLookupServiceClass, JUserPrincipalLookupService>) end;
JFileSystemProviderClass = interface(JObjectClass)
['{FA011CCC-4B9B-4622-BE07-7E0E3C5B0FF2}']
{class} function installedProviders: JList; cdecl;
end;
[JavaSignature('java/nio/file/spi/FileSystemProvider')]
JFileSystemProvider = interface(JObject)
['{188F7D06-9FF8-4AF5-92F7-AF4A3168F7FE}']
procedure createLink(link: Jfile_Path; existing: Jfile_Path); cdecl;
procedure delete(path: Jfile_Path); cdecl;
function deleteIfExists(path: Jfile_Path): Boolean; cdecl;
function getFileStore(path: Jfile_Path): JFileStore; cdecl;
//function getFileSystem(uri: JURI): JFileSystem; cdecl;
//function getPath(uri: JURI): Jfile_Path; cdecl;
function getScheme: JString; cdecl;
function isHidden(path: Jfile_Path): Boolean; cdecl;
function isSameFile(path: Jfile_Path; path2: Jfile_Path): Boolean; cdecl;
function newDirectoryStream(dir: Jfile_Path; filter: JDirectoryStream_Filter): JDirectoryStream; cdecl;
//function newFileSystem(uri: JURI; env: JMap): JFileSystem; cdecl; overload;
function newFileSystem(path: Jfile_Path; env: JMap): JFileSystem; cdecl; overload;
function readSymbolicLink(link: Jfile_Path): Jfile_Path; cdecl;
end;
TJFileSystemProvider = class(TJavaGenericImport<JFileSystemProviderClass, JFileSystemProvider>) end;
JCharacterIteratorClass = interface(JCloneableClass)
['{1E5C976F-2309-499B-8A65-FEC351115AEE}']
{class} function _GetDONE: Char; cdecl;
{class} property DONE: Char read _GetDONE;
end;
[JavaSignature('java/text/CharacterIterator')]
JCharacterIterator = interface(JCloneable)
['{E5B9E473-76E7-4041-97A5-A1642D9010AF}']
function clone: JObject; cdecl;
function current: Char; cdecl;
function first: Char; cdecl;
function getBeginIndex: Integer; cdecl;
function getEndIndex: Integer; cdecl;
function getIndex: Integer; cdecl;
function last: Char; cdecl;
function next: Char; cdecl;
function previous: Char; cdecl;
function setIndex(position: Integer): Char; cdecl;
end;
TJCharacterIterator = class(TJavaGenericImport<JCharacterIteratorClass, JCharacterIterator>) end;
JAttributedCharacterIteratorClass = interface(JCharacterIteratorClass)
['{6594E2E5-2893-4511-92FE-65045681414C}']
end;
[JavaSignature('java/text/AttributedCharacterIterator')]
JAttributedCharacterIterator = interface(JCharacterIterator)
['{CAC4C1F7-69A7-4AF1-85CF-28B7AC6C174E}']
function getAllAttributeKeys: JSet; cdecl;
function getAttribute(attribute: JAttributedCharacterIterator_Attribute): JObject; cdecl;
function getAttributes: JMap; cdecl;
function getRunLimit: Integer; cdecl; overload;
function getRunLimit(attribute: JAttributedCharacterIterator_Attribute): Integer; cdecl; overload;
function getRunLimit(attributes: JSet): Integer; cdecl; overload;
function getRunStart: Integer; cdecl; overload;
function getRunStart(attribute: JAttributedCharacterIterator_Attribute): Integer; cdecl; overload;
function getRunStart(attributes: JSet): Integer; cdecl; overload;
end;
TJAttributedCharacterIterator = class(TJavaGenericImport<JAttributedCharacterIteratorClass, JAttributedCharacterIterator>) end;
JAttributedCharacterIterator_AttributeClass = interface(JObjectClass)
['{2A4E44E3-1055-47D3-9D7C-306D8FC1B7B5}']
{class} function _GetINPUT_METHOD_SEGMENT: JAttributedCharacterIterator_Attribute; cdecl;
{class} function _GetLANGUAGE: JAttributedCharacterIterator_Attribute; cdecl;
{class} function _GetREADING: JAttributedCharacterIterator_Attribute; cdecl;
{class} property INPUT_METHOD_SEGMENT: JAttributedCharacterIterator_Attribute read _GetINPUT_METHOD_SEGMENT;
{class} property LANGUAGE: JAttributedCharacterIterator_Attribute read _GetLANGUAGE;
{class} property READING: JAttributedCharacterIterator_Attribute read _GetREADING;
end;
[JavaSignature('java/text/AttributedCharacterIterator$Attribute')]
JAttributedCharacterIterator_Attribute = interface(JObject)
['{18526153-8CA3-4BDA-AC30-F568F5361582}']
function equals(obj: JObject): Boolean; cdecl;
function hashCode: Integer; cdecl;
function toString: JString; cdecl;
end;
TJAttributedCharacterIterator_Attribute = class(TJavaGenericImport<JAttributedCharacterIterator_AttributeClass, JAttributedCharacterIterator_Attribute>) end;
JFieldPositionClass = interface(JObjectClass)
['{F58B6EC9-95AC-427C-9E49-18A65DCC6A3D}']
{class} function init(field: Integer): JFieldPosition; cdecl; overload;
{class} function init(attribute: JFormat_Field): JFieldPosition; cdecl; overload;
{class} function init(attribute: JFormat_Field; fieldID: Integer): JFieldPosition; cdecl; overload;
end;
[JavaSignature('java/text/FieldPosition')]
JFieldPosition = interface(JObject)
['{10819166-C974-4752-BD60-DC299ECF476E}']
function equals(obj: JObject): Boolean; cdecl;
function getBeginIndex: Integer; cdecl;
function getEndIndex: Integer; cdecl;
function getField: Integer; cdecl;
function getFieldAttribute: JFormat_Field; cdecl;
function hashCode: Integer; cdecl;
procedure setBeginIndex(bi: Integer); cdecl;
procedure setEndIndex(ei: Integer); cdecl;
function toString: JString; cdecl;
end;
TJFieldPosition = class(TJavaGenericImport<JFieldPositionClass, JFieldPosition>) end;
JFormatClass = interface(JObjectClass)
['{B3360D82-FFC6-472C-B0C7-DA4B605FA6C7}']
end;
[JavaSignature('java/text/Format')]
JFormat = interface(JObject)
['{621A5512-28D0-465D-A17C-D91BA62AC2BC}']
function clone: JObject; cdecl;
function format(obj: JObject): JString; cdecl; overload;
function format(obj: JObject; toAppendTo: JStringBuffer; pos: JFieldPosition): JStringBuffer; cdecl; overload;
function formatToCharacterIterator(obj: JObject): JAttributedCharacterIterator; cdecl;
function parseObject(source: JString; pos: JParsePosition): JObject; cdecl; overload;
function parseObject(source: JString): JObject; cdecl; overload;
end;
TJFormat = class(TJavaGenericImport<JFormatClass, JFormat>) end;
JFormat_FieldClass = interface(JAttributedCharacterIterator_AttributeClass)
['{5A479036-DED0-43F9-9F53-BFBA7EB3D38E}']
end;
[JavaSignature('java/text/Format$Field')]
JFormat_Field = interface(JAttributedCharacterIterator_Attribute)
['{B776B5A5-CA40-43FB-8222-CFBF9C422DF9}']
end;
TJFormat_Field = class(TJavaGenericImport<JFormat_FieldClass, JFormat_Field>) end;
JParsePositionClass = interface(JObjectClass)
['{0724101A-25F5-4AC4-BD4D-261CAD09EEB7}']
{class} function init(index: Integer): JParsePosition; cdecl;
end;
[JavaSignature('java/text/ParsePosition')]
JParsePosition = interface(JObject)
['{A9807DE3-9CD3-4E13-8AAC-C04A36AD7FBD}']
function equals(obj: JObject): Boolean; cdecl;
function getErrorIndex: Integer; cdecl;
function getIndex: Integer; cdecl;
function hashCode: Integer; cdecl;
procedure setErrorIndex(ei: Integer); cdecl;
procedure setIndex(index: Integer); cdecl;
function toString: JString; cdecl;
end;
TJParsePosition = class(TJavaGenericImport<JParsePositionClass, JParsePosition>) end;
JClockClass = interface(JObjectClass)
['{BE2ADFA2-61A1-43E7-B76E-1E4B70683C21}']
{class} function fixed(fixedInstant: JInstant; zone: JZoneId): JClock; cdecl;
{class} function offset(baseClock: JClock; offsetDuration: Jtime_Duration): JClock; cdecl;
{class} function system(zone: JZoneId): JClock; cdecl;
{class} function systemDefaultZone: JClock; cdecl;
{class} function systemUTC: JClock; cdecl;
{class} function tick(baseClock: JClock; tickDuration: Jtime_Duration): JClock; cdecl;
{class} function tickMinutes(zone: JZoneId): JClock; cdecl;
{class} function tickSeconds(zone: JZoneId): JClock; cdecl;
end;
[JavaSignature('java/time/Clock')]
JClock = interface(JObject)
['{5098054D-7C8E-4EAD-A5A9-EFBD0F010B04}']
function equals(obj: JObject): Boolean; cdecl;
function getZone: JZoneId; cdecl;
function hashCode: Integer; cdecl;
function instant: JInstant; cdecl;
function millis: Int64; cdecl;
function withZone(zone: JZoneId): JClock; cdecl;
end;
TJClock = class(TJavaGenericImport<JClockClass, JClock>) end;
JDayOfWeekClass = interface(JEnumClass)
['{3385BD9F-F681-47A1-AD40-DF9628BB2656}']
{class} function _GetFRIDAY: JDayOfWeek; cdecl;
{class} function _GetMONDAY: JDayOfWeek; cdecl;
{class} function _GetSATURDAY: JDayOfWeek; cdecl;
{class} function _GetSUNDAY: JDayOfWeek; cdecl;
{class} function _GetTHURSDAY: JDayOfWeek; cdecl;
{class} function _GetTUESDAY: JDayOfWeek; cdecl;
{class} function _GetWEDNESDAY: JDayOfWeek; cdecl;
{class} function from(temporal: JTemporalAccessor): JDayOfWeek; cdecl;
{class} function &of(dayOfWeek: Integer): JDayOfWeek; cdecl;
{class} function valueOf(name: JString): JDayOfWeek; cdecl;
{class} function values: TJavaObjectArray<JDayOfWeek>; cdecl;
{class} property FRIDAY: JDayOfWeek read _GetFRIDAY;
{class} property MONDAY: JDayOfWeek read _GetMONDAY;
{class} property SATURDAY: JDayOfWeek read _GetSATURDAY;
{class} property SUNDAY: JDayOfWeek read _GetSUNDAY;
{class} property THURSDAY: JDayOfWeek read _GetTHURSDAY;
{class} property TUESDAY: JDayOfWeek read _GetTUESDAY;
{class} property WEDNESDAY: JDayOfWeek read _GetWEDNESDAY;
end;
[JavaSignature('java/time/DayOfWeek')]
JDayOfWeek = interface(JEnum)
['{D6FD6BEF-2368-4F24-9DEA-A1927EF1C3FC}']
function adjustInto(temporal: JTemporal): JTemporal; cdecl;
function &get(field: JTemporalField): Integer; cdecl;
function getDisplayName(style: JTextStyle; locale: JLocale): JString; cdecl;
function getLong(field: JTemporalField): Int64; cdecl;
function getValue: Integer; cdecl;
function isSupported(field: JTemporalField): Boolean; cdecl;
function minus(days: Int64): JDayOfWeek; cdecl;
function plus(days: Int64): JDayOfWeek; cdecl;
function query(query: JTemporalQuery): JObject; cdecl;
function range(field: JTemporalField): JValueRange; cdecl;
end;
TJDayOfWeek = class(TJavaGenericImport<JDayOfWeekClass, JDayOfWeek>) end;
Jtime_DurationClass = interface(JObjectClass)
['{4BB29ECC-A65F-43E2-9085-76E96ECCAEB2}']
{class} function _GetZERO: Jtime_Duration; cdecl;
{class} function between(startInclusive: JTemporal; endExclusive: JTemporal): Jtime_Duration; cdecl;
{class} function from(amount: JTemporalAmount): Jtime_Duration; cdecl;
{class} function &of(amount: Int64; unit_: JTemporalUnit): Jtime_Duration; cdecl;
{class} function ofDays(days: Int64): Jtime_Duration; cdecl;
{class} function ofHours(hours: Int64): Jtime_Duration; cdecl;
{class} function ofMillis(millis: Int64): Jtime_Duration; cdecl;
{class} function ofMinutes(minutes: Int64): Jtime_Duration; cdecl;
{class} function ofNanos(nanos: Int64): Jtime_Duration; cdecl;
{class} function ofSeconds(seconds: Int64): Jtime_Duration; cdecl; overload;
{class} function ofSeconds(seconds: Int64; nanoAdjustment: Int64): Jtime_Duration; cdecl; overload;
{class} function parse(text: JCharSequence): Jtime_Duration; cdecl;
{class} property ZERO: Jtime_Duration read _GetZERO;
end;
[JavaSignature('java/time/Duration')]
Jtime_Duration = interface(JObject)
['{7DCBB469-642B-45CD-ADE5-DA2F7CA08D72}']
function abs: Jtime_Duration; cdecl;
function addTo(temporal: JTemporal): JTemporal; cdecl;
function compareTo(otherDuration: Jtime_Duration): Integer; cdecl;
function dividedBy(divisor: Int64): Jtime_Duration; cdecl;
function equals(otherDuration: JObject): Boolean; cdecl;
function &get(unit_: JTemporalUnit): Int64; cdecl;
function getNano: Integer; cdecl;
function getSeconds: Int64; cdecl;
function getUnits: JList; cdecl;
function hashCode: Integer; cdecl;
function isNegative: Boolean; cdecl;
function isZero: Boolean; cdecl;
function minus(duration: Jtime_Duration): Jtime_Duration; cdecl; overload;
function minus(amountToSubtract: Int64; unit_: JTemporalUnit): Jtime_Duration; cdecl; overload;
function minusDays(daysToSubtract: Int64): Jtime_Duration; cdecl;
function minusHours(hoursToSubtract: Int64): Jtime_Duration; cdecl;
function minusMillis(millisToSubtract: Int64): Jtime_Duration; cdecl;
function minusMinutes(minutesToSubtract: Int64): Jtime_Duration; cdecl;
function minusNanos(nanosToSubtract: Int64): Jtime_Duration; cdecl;
function minusSeconds(secondsToSubtract: Int64): Jtime_Duration; cdecl;
function multipliedBy(multiplicand: Int64): Jtime_Duration; cdecl;
function negated: Jtime_Duration; cdecl;
function plus(duration: Jtime_Duration): Jtime_Duration; cdecl; overload;
function plus(amountToAdd: Int64; unit_: JTemporalUnit): Jtime_Duration; cdecl; overload;
function plusDays(daysToAdd: Int64): Jtime_Duration; cdecl;
function plusHours(hoursToAdd: Int64): Jtime_Duration; cdecl;
function plusMillis(millisToAdd: Int64): Jtime_Duration; cdecl;
function plusMinutes(minutesToAdd: Int64): Jtime_Duration; cdecl;
function plusNanos(nanosToAdd: Int64): Jtime_Duration; cdecl;
function plusSeconds(secondsToAdd: Int64): Jtime_Duration; cdecl;
function subtractFrom(temporal: JTemporal): JTemporal; cdecl;
function toDays: Int64; cdecl;
function toHours: Int64; cdecl;
function toMillis: Int64; cdecl;
function toMinutes: Int64; cdecl;
function toNanos: Int64; cdecl;
function toString: JString; cdecl;
function withNanos(nanoOfSecond: Integer): Jtime_Duration; cdecl;
function withSeconds(seconds: Int64): Jtime_Duration; cdecl;
end;
TJtime_Duration = class(TJavaGenericImport<Jtime_DurationClass, Jtime_Duration>) end;
JInstantClass = interface(JObjectClass)
['{CEC50A54-F3AE-452B-908E-1A78F3C56DE3}']
{class} function _GetEPOCH: JInstant; cdecl;
{class} function _GetMAX: JInstant; cdecl;
{class} function _GetMIN: JInstant; cdecl;
{class} function from(temporal: JTemporalAccessor): JInstant; cdecl;
{class} function now: JInstant; cdecl; overload;
{class} function now(clock: JClock): JInstant; cdecl; overload;
{class} function ofEpochMilli(epochMilli: Int64): JInstant; cdecl;
{class} function ofEpochSecond(epochSecond: Int64): JInstant; cdecl; overload;
{class} function ofEpochSecond(epochSecond: Int64; nanoAdjustment: Int64): JInstant; cdecl; overload;
{class} function parse(text: JCharSequence): JInstant; cdecl;
{class} property EPOCH: JInstant read _GetEPOCH;
{class} property MAX: JInstant read _GetMAX;
{class} property MIN: JInstant read _GetMIN;
end;
[JavaSignature('java/time/Instant')]
JInstant = interface(JObject)
['{64439F72-48D1-41FC-806D-E9FB1C806F6B}']
function adjustInto(temporal: JTemporal): JTemporal; cdecl;
function atOffset(offset: JZoneOffset): JOffsetDateTime; cdecl;
function atZone(zone: JZoneId): JZonedDateTime; cdecl;
function compareTo(otherInstant: JInstant): Integer; cdecl;
function equals(otherInstant: JObject): Boolean; cdecl;
function &get(field: JTemporalField): Integer; cdecl;
function getEpochSecond: Int64; cdecl;
function getLong(field: JTemporalField): Int64; cdecl;
function getNano: Integer; cdecl;
function hashCode: Integer; cdecl;
function isAfter(otherInstant: JInstant): Boolean; cdecl;
function isBefore(otherInstant: JInstant): Boolean; cdecl;
function isSupported(field: JTemporalField): Boolean; cdecl; overload;
function isSupported(unit_: JTemporalUnit): Boolean; cdecl; overload;
function minus(amountToSubtract: JTemporalAmount): JInstant; cdecl; overload;
function minus(amountToSubtract: Int64; unit_: JTemporalUnit): JInstant; cdecl; overload;
function minusMillis(millisToSubtract: Int64): JInstant; cdecl;
function minusNanos(nanosToSubtract: Int64): JInstant; cdecl;
function minusSeconds(secondsToSubtract: Int64): JInstant; cdecl;
function plus(amountToAdd: JTemporalAmount): JInstant; cdecl; overload;
function plus(amountToAdd: Int64; unit_: JTemporalUnit): JInstant; cdecl; overload;
function plusMillis(millisToAdd: Int64): JInstant; cdecl;
function plusNanos(nanosToAdd: Int64): JInstant; cdecl;
function plusSeconds(secondsToAdd: Int64): JInstant; cdecl;
function query(query: JTemporalQuery): JObject; cdecl;
function range(field: JTemporalField): JValueRange; cdecl;
function toEpochMilli: Int64; cdecl;
function toString: JString; cdecl;
function truncatedTo(unit_: JTemporalUnit): JInstant; cdecl;
function &until(endExclusive: JTemporal; unit_: JTemporalUnit): Int64; cdecl;
function &with(adjuster: JTemporalAdjuster): JInstant; cdecl; overload;
function &with(field: JTemporalField; newValue: Int64): JInstant; cdecl; overload;
end;
TJInstant = class(TJavaGenericImport<JInstantClass, JInstant>) end;
JLocalDateClass = interface(JObjectClass)
['{0298591F-E2AF-4F53-B9C9-8598FAA7651A}']
{class} function _GetMAX: JLocalDate; cdecl;
{class} function _GetMIN: JLocalDate; cdecl;
{class} function from(temporal: JTemporalAccessor): JLocalDate; cdecl;
{class} function now: JLocalDate; cdecl; overload;
{class} function now(zone: JZoneId): JLocalDate; cdecl; overload;
{class} function now(clock: JClock): JLocalDate; cdecl; overload;
{class} function &of(year: Integer; month: JMonth; dayOfMonth: Integer): JLocalDate; cdecl; overload;
{class} function &of(year: Integer; month: Integer; dayOfMonth: Integer): JLocalDate; cdecl; overload;
{class} function ofEpochDay(epochDay: Int64): JLocalDate; cdecl;
{class} function ofYearDay(year: Integer; dayOfYear: Integer): JLocalDate; cdecl;
{class} function parse(text: JCharSequence): JLocalDate; cdecl; overload;
{class} function parse(text: JCharSequence; formatter: JDateTimeFormatter): JLocalDate; cdecl; overload;
{class} property MAX: JLocalDate read _GetMAX;
{class} property MIN: JLocalDate read _GetMIN;
end;
[JavaSignature('java/time/LocalDate')]
JLocalDate = interface(JObject)
['{A47DE364-3856-4262-928B-6E03C355D18B}']
function adjustInto(temporal: JTemporal): JTemporal; cdecl;
function atStartOfDay: JLocalDateTime; cdecl; overload;
function atStartOfDay(zone: JZoneId): JZonedDateTime; cdecl; overload;
function atTime(time: JLocalTime): JLocalDateTime; cdecl; overload;
function atTime(hour: Integer; minute: Integer): JLocalDateTime; cdecl; overload;
function atTime(hour: Integer; minute: Integer; second: Integer): JLocalDateTime; cdecl; overload;
function atTime(hour: Integer; minute: Integer; second: Integer; nanoOfSecond: Integer): JLocalDateTime; cdecl; overload;
function atTime(time: JOffsetTime): JOffsetDateTime; cdecl; overload;
function compareTo(other: JChronoLocalDate): Integer; cdecl;
function equals(obj: JObject): Boolean; cdecl;
function format(formatter: JDateTimeFormatter): JString; cdecl;
function &get(field: JTemporalField): Integer; cdecl;
function getChronology: JIsoChronology; cdecl;
function getDayOfMonth: Integer; cdecl;
function getDayOfWeek: JDayOfWeek; cdecl;
function getDayOfYear: Integer; cdecl;
function getEra: JEra; cdecl;
function getLong(field: JTemporalField): Int64; cdecl;
function getMonth: JMonth; cdecl;
function getMonthValue: Integer; cdecl;
function getYear: Integer; cdecl;
function hashCode: Integer; cdecl;
function isAfter(other: JChronoLocalDate): Boolean; cdecl;
function isBefore(other: JChronoLocalDate): Boolean; cdecl;
function isEqual(other: JChronoLocalDate): Boolean; cdecl;
function isLeapYear: Boolean; cdecl;
function isSupported(field: JTemporalField): Boolean; cdecl; overload;
function isSupported(unit_: JTemporalUnit): Boolean; cdecl; overload;
function lengthOfMonth: Integer; cdecl;
function lengthOfYear: Integer; cdecl;
function minus(amountToSubtract: JTemporalAmount): JLocalDate; cdecl; overload;
function minus(amountToSubtract: Int64; unit_: JTemporalUnit): JLocalDate; cdecl; overload;
function minusDays(daysToSubtract: Int64): JLocalDate; cdecl;
function minusMonths(monthsToSubtract: Int64): JLocalDate; cdecl;
function minusWeeks(weeksToSubtract: Int64): JLocalDate; cdecl;
function minusYears(yearsToSubtract: Int64): JLocalDate; cdecl;
function plus(amountToAdd: JTemporalAmount): JLocalDate; cdecl; overload;
function plus(amountToAdd: Int64; unit_: JTemporalUnit): JLocalDate; cdecl; overload;
function plusDays(daysToAdd: Int64): JLocalDate; cdecl;
function plusMonths(monthsToAdd: Int64): JLocalDate; cdecl;
function plusWeeks(weeksToAdd: Int64): JLocalDate; cdecl;
function plusYears(yearsToAdd: Int64): JLocalDate; cdecl;
function query(query: JTemporalQuery): JObject; cdecl;
function range(field: JTemporalField): JValueRange; cdecl;
function toEpochDay: Int64; cdecl;
function toString: JString; cdecl;
function &until(endExclusive: JTemporal; unit_: JTemporalUnit): Int64; cdecl; overload;
function &until(endDateExclusive: JChronoLocalDate): JPeriod; cdecl; overload;
function &with(adjuster: JTemporalAdjuster): JLocalDate; cdecl; overload;
function &with(field: JTemporalField; newValue: Int64): JLocalDate; cdecl; overload;
function withDayOfMonth(dayOfMonth: Integer): JLocalDate; cdecl;
function withDayOfYear(dayOfYear: Integer): JLocalDate; cdecl;
function withMonth(month: Integer): JLocalDate; cdecl;
function withYear(year: Integer): JLocalDate; cdecl;
end;
TJLocalDate = class(TJavaGenericImport<JLocalDateClass, JLocalDate>) end;
JLocalDateTimeClass = interface(JObjectClass)
['{66493F01-1AEA-4E54-9F21-D6AA04D39D54}']
{class} function _GetMAX: JLocalDateTime; cdecl;
{class} function _GetMIN: JLocalDateTime; cdecl;
{class} function from(temporal: JTemporalAccessor): JLocalDateTime; cdecl;
{class} function now: JLocalDateTime; cdecl; overload;
{class} function now(zone: JZoneId): JLocalDateTime; cdecl; overload;
{class} function now(clock: JClock): JLocalDateTime; cdecl; overload;
{class} function &of(year: Integer; month: JMonth; dayOfMonth: Integer; hour: Integer; minute: Integer): JLocalDateTime; cdecl; overload;
{class} function &of(year: Integer; month: JMonth; dayOfMonth: Integer; hour: Integer; minute: Integer; second: Integer): JLocalDateTime; cdecl; overload;
{class} function &of(year: Integer; month: JMonth; dayOfMonth: Integer; hour: Integer; minute: Integer; second: Integer; nanoOfSecond: Integer): JLocalDateTime; cdecl; overload;
{class} function &of(year: Integer; month: Integer; dayOfMonth: Integer; hour: Integer; minute: Integer): JLocalDateTime; cdecl; overload;
{class} function &of(year: Integer; month: Integer; dayOfMonth: Integer; hour: Integer; minute: Integer; second: Integer): JLocalDateTime; cdecl; overload;
{class} function &of(year: Integer; month: Integer; dayOfMonth: Integer; hour: Integer; minute: Integer; second: Integer; nanoOfSecond: Integer): JLocalDateTime; cdecl; overload;
{class} function &of(date: JLocalDate; time: JLocalTime): JLocalDateTime; cdecl; overload;
{class} function ofEpochSecond(epochSecond: Int64; nanoOfSecond: Integer; offset: JZoneOffset): JLocalDateTime; cdecl;
{class} function ofInstant(instant: JInstant; zone: JZoneId): JLocalDateTime; cdecl;
{class} function parse(text: JCharSequence): JLocalDateTime; cdecl; overload;
{class} function parse(text: JCharSequence; formatter: JDateTimeFormatter): JLocalDateTime; cdecl; overload;
{class} property MAX: JLocalDateTime read _GetMAX;
{class} property MIN: JLocalDateTime read _GetMIN;
end;
[JavaSignature('java/time/LocalDateTime')]
JLocalDateTime = interface(JObject)
['{628942E7-1397-4058-A923-66F0A9D5576E}']
function adjustInto(temporal: JTemporal): JTemporal; cdecl;
function atOffset(offset: JZoneOffset): JOffsetDateTime; cdecl;
function atZone(zone: JZoneId): JZonedDateTime; cdecl;
function compareTo(other: JChronoLocalDateTime): Integer; cdecl;
function equals(obj: JObject): Boolean; cdecl;
function format(formatter: JDateTimeFormatter): JString; cdecl;
function &get(field: JTemporalField): Integer; cdecl;
function getDayOfMonth: Integer; cdecl;
function getDayOfWeek: JDayOfWeek; cdecl;
function getDayOfYear: Integer; cdecl;
function getHour: Integer; cdecl;
function getLong(field: JTemporalField): Int64; cdecl;
function getMinute: Integer; cdecl;
function getMonth: JMonth; cdecl;
function getMonthValue: Integer; cdecl;
function getNano: Integer; cdecl;
function getSecond: Integer; cdecl;
function getYear: Integer; cdecl;
function hashCode: Integer; cdecl;
function isAfter(other: JChronoLocalDateTime): Boolean; cdecl;
function isBefore(other: JChronoLocalDateTime): Boolean; cdecl;
function isEqual(other: JChronoLocalDateTime): Boolean; cdecl;
function isSupported(field: JTemporalField): Boolean; cdecl; overload;
function isSupported(unit_: JTemporalUnit): Boolean; cdecl; overload;
function minus(amountToSubtract: JTemporalAmount): JLocalDateTime; cdecl; overload;
function minus(amountToSubtract: Int64; unit_: JTemporalUnit): JLocalDateTime; cdecl; overload;
function minusDays(days: Int64): JLocalDateTime; cdecl;
function minusHours(hours: Int64): JLocalDateTime; cdecl;
function minusMinutes(minutes: Int64): JLocalDateTime; cdecl;
function minusMonths(months: Int64): JLocalDateTime; cdecl;
function minusNanos(nanos: Int64): JLocalDateTime; cdecl;
function minusSeconds(seconds: Int64): JLocalDateTime; cdecl;
function minusWeeks(weeks: Int64): JLocalDateTime; cdecl;
function minusYears(years: Int64): JLocalDateTime; cdecl;
function plus(amountToAdd: JTemporalAmount): JLocalDateTime; cdecl; overload;
function plus(amountToAdd: Int64; unit_: JTemporalUnit): JLocalDateTime; cdecl; overload;
function plusDays(days: Int64): JLocalDateTime; cdecl;
function plusHours(hours: Int64): JLocalDateTime; cdecl;
function plusMinutes(minutes: Int64): JLocalDateTime; cdecl;
function plusMonths(months: Int64): JLocalDateTime; cdecl;
function plusNanos(nanos: Int64): JLocalDateTime; cdecl;
function plusSeconds(seconds: Int64): JLocalDateTime; cdecl;
function plusWeeks(weeks: Int64): JLocalDateTime; cdecl;
function plusYears(years: Int64): JLocalDateTime; cdecl;
function query(query: JTemporalQuery): JObject; cdecl;
function range(field: JTemporalField): JValueRange; cdecl;
function toLocalDate: JLocalDate; cdecl;
function toLocalTime: JLocalTime; cdecl;
function toString: JString; cdecl;
function truncatedTo(unit_: JTemporalUnit): JLocalDateTime; cdecl;
function &until(endExclusive: JTemporal; unit_: JTemporalUnit): Int64; cdecl;
function &with(adjuster: JTemporalAdjuster): JLocalDateTime; cdecl; overload;
function &with(field: JTemporalField; newValue: Int64): JLocalDateTime; cdecl; overload;
function withDayOfMonth(dayOfMonth: Integer): JLocalDateTime; cdecl;
function withDayOfYear(dayOfYear: Integer): JLocalDateTime; cdecl;
function withHour(hour: Integer): JLocalDateTime; cdecl;
function withMinute(minute: Integer): JLocalDateTime; cdecl;
function withMonth(month: Integer): JLocalDateTime; cdecl;
function withNano(nanoOfSecond: Integer): JLocalDateTime; cdecl;
function withSecond(second: Integer): JLocalDateTime; cdecl;
function withYear(year: Integer): JLocalDateTime; cdecl;
end;
TJLocalDateTime = class(TJavaGenericImport<JLocalDateTimeClass, JLocalDateTime>) end;
JLocalTimeClass = interface(JObjectClass)
['{C62B039B-151C-4C8D-B9B5-CE7F5A99F523}']
{class} function _GetMAX: JLocalTime; cdecl;
{class} function _GetMIDNIGHT: JLocalTime; cdecl;
{class} function _GetMIN: JLocalTime; cdecl;
{class} function _GetNOON: JLocalTime; cdecl;
{class} function from(temporal: JTemporalAccessor): JLocalTime; cdecl;
{class} function now: JLocalTime; cdecl; overload;
{class} function now(zone: JZoneId): JLocalTime; cdecl; overload;
{class} function now(clock: JClock): JLocalTime; cdecl; overload;
{class} function &of(hour: Integer; minute: Integer): JLocalTime; cdecl; overload;
{class} function &of(hour: Integer; minute: Integer; second: Integer): JLocalTime; cdecl; overload;
{class} function &of(hour: Integer; minute: Integer; second: Integer; nanoOfSecond: Integer): JLocalTime; cdecl; overload;
{class} function ofNanoOfDay(nanoOfDay: Int64): JLocalTime; cdecl;
{class} function ofSecondOfDay(secondOfDay: Int64): JLocalTime; cdecl;
{class} function parse(text: JCharSequence): JLocalTime; cdecl; overload;
{class} function parse(text: JCharSequence; formatter: JDateTimeFormatter): JLocalTime; cdecl; overload;
{class} property MAX: JLocalTime read _GetMAX;
{class} property MIDNIGHT: JLocalTime read _GetMIDNIGHT;
{class} property MIN: JLocalTime read _GetMIN;
{class} property NOON: JLocalTime read _GetNOON;
end;
[JavaSignature('java/time/LocalTime')]
JLocalTime = interface(JObject)
['{2405545A-289F-4EB3-A3A2-938F52BC0B0D}']
function adjustInto(temporal: JTemporal): JTemporal; cdecl;
function atDate(date: JLocalDate): JLocalDateTime; cdecl;
function atOffset(offset: JZoneOffset): JOffsetTime; cdecl;
function compareTo(other: JLocalTime): Integer; cdecl;
function equals(obj: JObject): Boolean; cdecl;
function format(formatter: JDateTimeFormatter): JString; cdecl;
function &get(field: JTemporalField): Integer; cdecl;
function getHour: Integer; cdecl;
function getLong(field: JTemporalField): Int64; cdecl;
function getMinute: Integer; cdecl;
function getNano: Integer; cdecl;
function getSecond: Integer; cdecl;
function hashCode: Integer; cdecl;
function isAfter(other: JLocalTime): Boolean; cdecl;
function isBefore(other: JLocalTime): Boolean; cdecl;
function isSupported(field: JTemporalField): Boolean; cdecl; overload;
function isSupported(unit_: JTemporalUnit): Boolean; cdecl; overload;
function minus(amountToSubtract: JTemporalAmount): JLocalTime; cdecl; overload;
function minus(amountToSubtract: Int64; unit_: JTemporalUnit): JLocalTime; cdecl; overload;
function minusHours(hoursToSubtract: Int64): JLocalTime; cdecl;
function minusMinutes(minutesToSubtract: Int64): JLocalTime; cdecl;
function minusNanos(nanosToSubtract: Int64): JLocalTime; cdecl;
function minusSeconds(secondsToSubtract: Int64): JLocalTime; cdecl;
function plus(amountToAdd: JTemporalAmount): JLocalTime; cdecl; overload;
function plus(amountToAdd: Int64; unit_: JTemporalUnit): JLocalTime; cdecl; overload;
function plusHours(hoursToAdd: Int64): JLocalTime; cdecl;
function plusMinutes(minutesToAdd: Int64): JLocalTime; cdecl;
function plusNanos(nanosToAdd: Int64): JLocalTime; cdecl;
function plusSeconds(secondstoAdd: Int64): JLocalTime; cdecl;
function query(query: JTemporalQuery): JObject; cdecl;
function range(field: JTemporalField): JValueRange; cdecl;
function toNanoOfDay: Int64; cdecl;
function toSecondOfDay: Integer; cdecl;
function toString: JString; cdecl;
function truncatedTo(unit_: JTemporalUnit): JLocalTime; cdecl;
function &until(endExclusive: JTemporal; unit_: JTemporalUnit): Int64; cdecl;
function &with(adjuster: JTemporalAdjuster): JLocalTime; cdecl; overload;
function &with(field: JTemporalField; newValue: Int64): JLocalTime; cdecl; overload;
function withHour(hour: Integer): JLocalTime; cdecl;
function withMinute(minute: Integer): JLocalTime; cdecl;
function withNano(nanoOfSecond: Integer): JLocalTime; cdecl;
function withSecond(second: Integer): JLocalTime; cdecl;
end;
TJLocalTime = class(TJavaGenericImport<JLocalTimeClass, JLocalTime>) end;
JMonthClass = interface(JEnumClass)
['{7888C319-AE17-4499-8E13-2B6468B6BA6C}']
{class} function _GetAPRIL: JMonth; cdecl;
{class} function _GetAUGUST: JMonth; cdecl;
{class} function _GetDECEMBER: JMonth; cdecl;
{class} function _GetFEBRUARY: JMonth; cdecl;
{class} function _GetJANUARY: JMonth; cdecl;
{class} function _GetJULY: JMonth; cdecl;
{class} function _GetJUNE: JMonth; cdecl;
{class} function _GetMARCH: JMonth; cdecl;
{class} function _GetMAY: JMonth; cdecl;
{class} function _GetNOVEMBER: JMonth; cdecl;
{class} function _GetOCTOBER: JMonth; cdecl;
{class} function _GetSEPTEMBER: JMonth; cdecl;
{class} function from(temporal: JTemporalAccessor): JMonth; cdecl;
{class} function &of(month: Integer): JMonth; cdecl;
{class} function valueOf(name: JString): JMonth; cdecl;
{class} function values: TJavaObjectArray<JMonth>; cdecl;
{class} property APRIL: JMonth read _GetAPRIL;
{class} property AUGUST: JMonth read _GetAUGUST;
{class} property DECEMBER: JMonth read _GetDECEMBER;
{class} property FEBRUARY: JMonth read _GetFEBRUARY;
{class} property JANUARY: JMonth read _GetJANUARY;
{class} property JULY: JMonth read _GetJULY;
{class} property JUNE: JMonth read _GetJUNE;
{class} property MARCH: JMonth read _GetMARCH;
{class} property MAY: JMonth read _GetMAY;
{class} property NOVEMBER: JMonth read _GetNOVEMBER;
{class} property OCTOBER: JMonth read _GetOCTOBER;
{class} property SEPTEMBER: JMonth read _GetSEPTEMBER;
end;
[JavaSignature('java/time/Month')]
JMonth = interface(JEnum)
['{31D6AE11-DA20-45F3-AE42-49C020750FD2}']
function adjustInto(temporal: JTemporal): JTemporal; cdecl;
function firstDayOfYear(leapYear: Boolean): Integer; cdecl;
function firstMonthOfQuarter: JMonth; cdecl;
function &get(field: JTemporalField): Integer; cdecl;
function getDisplayName(style: JTextStyle; locale: JLocale): JString; cdecl;
function getLong(field: JTemporalField): Int64; cdecl;
function getValue: Integer; cdecl;
function isSupported(field: JTemporalField): Boolean; cdecl;
function length(leapYear: Boolean): Integer; cdecl;
function maxLength: Integer; cdecl;
function minLength: Integer; cdecl;
function minus(months: Int64): JMonth; cdecl;
function plus(months: Int64): JMonth; cdecl;
function query(query: JTemporalQuery): JObject; cdecl;
function range(field: JTemporalField): JValueRange; cdecl;
end;
TJMonth = class(TJavaGenericImport<JMonthClass, JMonth>) end;
JOffsetDateTimeClass = interface(JObjectClass)
['{3915F653-D047-4752-B63B-2B99F20C1BFF}']
{class} function _GetMAX: JOffsetDateTime; cdecl;
{class} function _GetMIN: JOffsetDateTime; cdecl;
{class} function from(temporal: JTemporalAccessor): JOffsetDateTime; cdecl;
{class} function now: JOffsetDateTime; cdecl; overload;
{class} function now(zone: JZoneId): JOffsetDateTime; cdecl; overload;
{class} function now(clock: JClock): JOffsetDateTime; cdecl; overload;
{class} function &of(date: JLocalDate; time: JLocalTime; offset: JZoneOffset): JOffsetDateTime; cdecl; overload;
{class} function &of(dateTime: JLocalDateTime; offset: JZoneOffset): JOffsetDateTime; cdecl; overload;
{class} function &of(year: Integer; month: Integer; dayOfMonth: Integer; hour: Integer; minute: Integer; second: Integer; nanoOfSecond: Integer; offset: JZoneOffset): JOffsetDateTime; cdecl; overload;
{class} function ofInstant(instant: JInstant; zone: JZoneId): JOffsetDateTime; cdecl;
{class} function parse(text: JCharSequence): JOffsetDateTime; cdecl; overload;
{class} function parse(text: JCharSequence; formatter: JDateTimeFormatter): JOffsetDateTime; cdecl; overload;
{class} function timeLineOrder: JComparator; cdecl;
{class} property MAX: JOffsetDateTime read _GetMAX;
{class} property MIN: JOffsetDateTime read _GetMIN;
end;
[JavaSignature('java/time/OffsetDateTime')]
JOffsetDateTime = interface(JObject)
['{4BD67AA9-A558-4EAC-B9F3-C089BFB1D8E5}']
function adjustInto(temporal: JTemporal): JTemporal; cdecl;
function atZoneSameInstant(zone: JZoneId): JZonedDateTime; cdecl;
function atZoneSimilarLocal(zone: JZoneId): JZonedDateTime; cdecl;
function compareTo(other: JOffsetDateTime): Integer; cdecl;
function equals(obj: JObject): Boolean; cdecl;
function format(formatter: JDateTimeFormatter): JString; cdecl;
function &get(field: JTemporalField): Integer; cdecl;
function getDayOfMonth: Integer; cdecl;
function getDayOfWeek: JDayOfWeek; cdecl;
function getDayOfYear: Integer; cdecl;
function getHour: Integer; cdecl;
function getLong(field: JTemporalField): Int64; cdecl;
function getMinute: Integer; cdecl;
function getMonth: JMonth; cdecl;
function getMonthValue: Integer; cdecl;
function getNano: Integer; cdecl;
function getOffset: JZoneOffset; cdecl;
function getSecond: Integer; cdecl;
function getYear: Integer; cdecl;
function hashCode: Integer; cdecl;
function isAfter(other: JOffsetDateTime): Boolean; cdecl;
function isBefore(other: JOffsetDateTime): Boolean; cdecl;
function isEqual(other: JOffsetDateTime): Boolean; cdecl;
function isSupported(field: JTemporalField): Boolean; cdecl; overload;
function isSupported(unit_: JTemporalUnit): Boolean; cdecl; overload;
function minus(amountToSubtract: JTemporalAmount): JOffsetDateTime; cdecl; overload;
function minus(amountToSubtract: Int64; unit_: JTemporalUnit): JOffsetDateTime; cdecl; overload;
function minusDays(days: Int64): JOffsetDateTime; cdecl;
function minusHours(hours: Int64): JOffsetDateTime; cdecl;
function minusMinutes(minutes: Int64): JOffsetDateTime; cdecl;
function minusMonths(months: Int64): JOffsetDateTime; cdecl;
function minusNanos(nanos: Int64): JOffsetDateTime; cdecl;
function minusSeconds(seconds: Int64): JOffsetDateTime; cdecl;
function minusWeeks(weeks: Int64): JOffsetDateTime; cdecl;
function minusYears(years: Int64): JOffsetDateTime; cdecl;
function plus(amountToAdd: JTemporalAmount): JOffsetDateTime; cdecl; overload;
function plus(amountToAdd: Int64; unit_: JTemporalUnit): JOffsetDateTime; cdecl; overload;
function plusDays(days: Int64): JOffsetDateTime; cdecl;
function plusHours(hours: Int64): JOffsetDateTime; cdecl;
function plusMinutes(minutes: Int64): JOffsetDateTime; cdecl;
function plusMonths(months: Int64): JOffsetDateTime; cdecl;
function plusNanos(nanos: Int64): JOffsetDateTime; cdecl;
function plusSeconds(seconds: Int64): JOffsetDateTime; cdecl;
function plusWeeks(weeks: Int64): JOffsetDateTime; cdecl;
function plusYears(years: Int64): JOffsetDateTime; cdecl;
function query(query: JTemporalQuery): JObject; cdecl;
function range(field: JTemporalField): JValueRange; cdecl;
function toEpochSecond: Int64; cdecl;
function toInstant: JInstant; cdecl;
function toLocalDate: JLocalDate; cdecl;
function toLocalDateTime: JLocalDateTime; cdecl;
function toLocalTime: JLocalTime; cdecl;
function toOffsetTime: JOffsetTime; cdecl;
function toString: JString; cdecl;
function toZonedDateTime: JZonedDateTime; cdecl;
function truncatedTo(unit_: JTemporalUnit): JOffsetDateTime; cdecl;
function &until(endExclusive: JTemporal; unit_: JTemporalUnit): Int64; cdecl;
function &with(adjuster: JTemporalAdjuster): JOffsetDateTime; cdecl; overload;
function &with(field: JTemporalField; newValue: Int64): JOffsetDateTime; cdecl; overload;
function withDayOfMonth(dayOfMonth: Integer): JOffsetDateTime; cdecl;
function withDayOfYear(dayOfYear: Integer): JOffsetDateTime; cdecl;
function withHour(hour: Integer): JOffsetDateTime; cdecl;
function withMinute(minute: Integer): JOffsetDateTime; cdecl;
function withMonth(month: Integer): JOffsetDateTime; cdecl;
function withNano(nanoOfSecond: Integer): JOffsetDateTime; cdecl;
function withOffsetSameInstant(offset: JZoneOffset): JOffsetDateTime; cdecl;
function withOffsetSameLocal(offset: JZoneOffset): JOffsetDateTime; cdecl;
function withSecond(second: Integer): JOffsetDateTime; cdecl;
function withYear(year: Integer): JOffsetDateTime; cdecl;
end;
TJOffsetDateTime = class(TJavaGenericImport<JOffsetDateTimeClass, JOffsetDateTime>) end;
JOffsetTimeClass = interface(JObjectClass)
['{D68E7A75-3F64-4A99-B12C-F2BE0F3BDF2D}']
{class} function _GetMAX: JOffsetTime; cdecl;
{class} function _GetMIN: JOffsetTime; cdecl;
{class} function from(temporal: JTemporalAccessor): JOffsetTime; cdecl;
{class} function now: JOffsetTime; cdecl; overload;
{class} function now(zone: JZoneId): JOffsetTime; cdecl; overload;
{class} function now(clock: JClock): JOffsetTime; cdecl; overload;
{class} function &of(time: JLocalTime; offset: JZoneOffset): JOffsetTime; cdecl; overload;
{class} function &of(hour: Integer; minute: Integer; second: Integer; nanoOfSecond: Integer; offset: JZoneOffset): JOffsetTime; cdecl; overload;
{class} function ofInstant(instant: JInstant; zone: JZoneId): JOffsetTime; cdecl;
{class} function parse(text: JCharSequence): JOffsetTime; cdecl; overload;
{class} function parse(text: JCharSequence; formatter: JDateTimeFormatter): JOffsetTime; cdecl; overload;
{class} property MAX: JOffsetTime read _GetMAX;
{class} property MIN: JOffsetTime read _GetMIN;
end;
[JavaSignature('java/time/OffsetTime')]
JOffsetTime = interface(JObject)
['{C984267C-64F5-4E7D-812E-B41300987338}']
function adjustInto(temporal: JTemporal): JTemporal; cdecl;
function atDate(date: JLocalDate): JOffsetDateTime; cdecl;
function compareTo(other: JOffsetTime): Integer; cdecl;
function equals(obj: JObject): Boolean; cdecl;
function format(formatter: JDateTimeFormatter): JString; cdecl;
function &get(field: JTemporalField): Integer; cdecl;
function getHour: Integer; cdecl;
function getLong(field: JTemporalField): Int64; cdecl;
function getMinute: Integer; cdecl;
function getNano: Integer; cdecl;
function getOffset: JZoneOffset; cdecl;
function getSecond: Integer; cdecl;
function hashCode: Integer; cdecl;
function isAfter(other: JOffsetTime): Boolean; cdecl;
function isBefore(other: JOffsetTime): Boolean; cdecl;
function isEqual(other: JOffsetTime): Boolean; cdecl;
function isSupported(field: JTemporalField): Boolean; cdecl; overload;
function isSupported(unit_: JTemporalUnit): Boolean; cdecl; overload;
function minus(amountToSubtract: JTemporalAmount): JOffsetTime; cdecl; overload;
function minus(amountToSubtract: Int64; unit_: JTemporalUnit): JOffsetTime; cdecl; overload;
function minusHours(hours: Int64): JOffsetTime; cdecl;
function minusMinutes(minutes: Int64): JOffsetTime; cdecl;
function minusNanos(nanos: Int64): JOffsetTime; cdecl;
function minusSeconds(seconds: Int64): JOffsetTime; cdecl;
function plus(amountToAdd: JTemporalAmount): JOffsetTime; cdecl; overload;
function plus(amountToAdd: Int64; unit_: JTemporalUnit): JOffsetTime; cdecl; overload;
function plusHours(hours: Int64): JOffsetTime; cdecl;
function plusMinutes(minutes: Int64): JOffsetTime; cdecl;
function plusNanos(nanos: Int64): JOffsetTime; cdecl;
function plusSeconds(seconds: Int64): JOffsetTime; cdecl;
function query(query: JTemporalQuery): JObject; cdecl;
function range(field: JTemporalField): JValueRange; cdecl;
function toLocalTime: JLocalTime; cdecl;
function toString: JString; cdecl;
function truncatedTo(unit_: JTemporalUnit): JOffsetTime; cdecl;
function &until(endExclusive: JTemporal; unit_: JTemporalUnit): Int64; cdecl;
function &with(adjuster: JTemporalAdjuster): JOffsetTime; cdecl; overload;
function &with(field: JTemporalField; newValue: Int64): JOffsetTime; cdecl; overload;
function withHour(hour: Integer): JOffsetTime; cdecl;
function withMinute(minute: Integer): JOffsetTime; cdecl;
function withNano(nanoOfSecond: Integer): JOffsetTime; cdecl;
function withOffsetSameInstant(offset: JZoneOffset): JOffsetTime; cdecl;
function withOffsetSameLocal(offset: JZoneOffset): JOffsetTime; cdecl;
function withSecond(second: Integer): JOffsetTime; cdecl;
end;
TJOffsetTime = class(TJavaGenericImport<JOffsetTimeClass, JOffsetTime>) end;
JPeriodClass = interface(JObjectClass)
['{8E30B7C3-6FE7-45A0-82D3-8E3B6971E653}']
{class} function _GetZERO: JPeriod; cdecl;
{class} function between(startDateInclusive: JLocalDate; endDateExclusive: JLocalDate): JPeriod; cdecl;
{class} function from(amount: JTemporalAmount): JPeriod; cdecl;
{class} function &of(years: Integer; months: Integer; days: Integer): JPeriod; cdecl;
{class} function ofDays(days: Integer): JPeriod; cdecl;
{class} function ofMonths(months: Integer): JPeriod; cdecl;
{class} function ofWeeks(weeks: Integer): JPeriod; cdecl;
{class} function ofYears(years: Integer): JPeriod; cdecl;
{class} function parse(text: JCharSequence): JPeriod; cdecl;
{class} property ZERO: JPeriod read _GetZERO;
end;
[JavaSignature('java/time/Period')]
JPeriod = interface(JObject)
['{73A08CE4-1E78-463F-8428-E92D1220CB95}']
function addTo(temporal: JTemporal): JTemporal; cdecl;
function equals(obj: JObject): Boolean; cdecl;
function &get(unit_: JTemporalUnit): Int64; cdecl;
function getChronology: JIsoChronology; cdecl;
function getDays: Integer; cdecl;
function getMonths: Integer; cdecl;
function getUnits: JList; cdecl;
function getYears: Integer; cdecl;
function hashCode: Integer; cdecl;
function isNegative: Boolean; cdecl;
function isZero: Boolean; cdecl;
function minus(amountToSubtract: JTemporalAmount): JPeriod; cdecl;
function minusDays(daysToSubtract: Int64): JPeriod; cdecl;
function minusMonths(monthsToSubtract: Int64): JPeriod; cdecl;
function minusYears(yearsToSubtract: Int64): JPeriod; cdecl;
function multipliedBy(scalar: Integer): JPeriod; cdecl;
function negated: JPeriod; cdecl;
function normalized: JPeriod; cdecl;
function plus(amountToAdd: JTemporalAmount): JPeriod; cdecl;
function plusDays(daysToAdd: Int64): JPeriod; cdecl;
function plusMonths(monthsToAdd: Int64): JPeriod; cdecl;
function plusYears(yearsToAdd: Int64): JPeriod; cdecl;
function subtractFrom(temporal: JTemporal): JTemporal; cdecl;
function toString: JString; cdecl;
function toTotalMonths: Int64; cdecl;
function withDays(days: Integer): JPeriod; cdecl;
function withMonths(months: Integer): JPeriod; cdecl;
function withYears(years: Integer): JPeriod; cdecl;
end;
TJPeriod = class(TJavaGenericImport<JPeriodClass, JPeriod>) end;
JZoneIdClass = interface(JObjectClass)
['{E52F2721-449C-41F1-AB54-08AF52419012}']
{class} function _GetSHORT_IDS: JMap; cdecl;
{class} function from(temporal: JTemporalAccessor): JZoneId; cdecl;
{class} function getAvailableZoneIds: JSet; cdecl;
{class} function &of(zoneId: JString; aliasMap: JMap): JZoneId; cdecl; overload;
{class} function &of(zoneId: JString): JZoneId; cdecl; overload;
{class} function ofOffset(prefix: JString; offset: JZoneOffset): JZoneId; cdecl;
{class} function systemDefault: JZoneId; cdecl;
{class} property SHORT_IDS: JMap read _GetSHORT_IDS;
end;
[JavaSignature('java/time/ZoneId')]
JZoneId = interface(JObject)
['{52C6249F-8F81-4BC3-917E-D9A7EE283A43}']
function equals(obj: JObject): Boolean; cdecl;
function getDisplayName(style: JTextStyle; locale: JLocale): JString; cdecl;
function getId: JString; cdecl;
function getRules: JZoneRules; cdecl;
function hashCode: Integer; cdecl;
function normalized: JZoneId; cdecl;
function toString: JString; cdecl;
end;
TJZoneId = class(TJavaGenericImport<JZoneIdClass, JZoneId>) end;
JZoneOffsetClass = interface(JZoneIdClass)
['{AE51E1AF-54C6-4EF2-8517-D3EEE4EFB63F}']
{class} function _GetMAX: JZoneOffset; cdecl;
{class} function _GetMIN: JZoneOffset; cdecl;
{class} function _GetUTC: JZoneOffset; cdecl;
{class} function from(temporal: JTemporalAccessor): JZoneOffset; cdecl;
{class} function &of(offsetId: JString): JZoneOffset; cdecl;
{class} function ofHours(hours: Integer): JZoneOffset; cdecl;
{class} function ofHoursMinutes(hours: Integer; minutes: Integer): JZoneOffset; cdecl;
{class} function ofHoursMinutesSeconds(hours: Integer; minutes: Integer; seconds: Integer): JZoneOffset; cdecl;
{class} function ofTotalSeconds(totalSeconds: Integer): JZoneOffset; cdecl;
{class} property MAX: JZoneOffset read _GetMAX;
{class} property MIN: JZoneOffset read _GetMIN;
{class} property UTC: JZoneOffset read _GetUTC;
end;
[JavaSignature('java/time/ZoneOffset')]
JZoneOffset = interface(JZoneId)
['{4E862086-3310-4348-84AF-1D4B2B697F50}']
function adjustInto(temporal: JTemporal): JTemporal; cdecl;
function compareTo(other: JZoneOffset): Integer; cdecl;
function equals(obj: JObject): Boolean; cdecl;
function &get(field: JTemporalField): Integer; cdecl;
function getId: JString; cdecl;
function getLong(field: JTemporalField): Int64; cdecl;
function getRules: JZoneRules; cdecl;
function getTotalSeconds: Integer; cdecl;
function hashCode: Integer; cdecl;
function isSupported(field: JTemporalField): Boolean; cdecl;
function query(query: JTemporalQuery): JObject; cdecl;
function range(field: JTemporalField): JValueRange; cdecl;
function toString: JString; cdecl;
end;
TJZoneOffset = class(TJavaGenericImport<JZoneOffsetClass, JZoneOffset>) end;
JZonedDateTimeClass = interface(JObjectClass)
['{37DB99E6-7A08-4861-A349-B79831E8612F}']
{class} function from(temporal: JTemporalAccessor): JZonedDateTime; cdecl;
{class} function now: JZonedDateTime; cdecl; overload;
{class} function now(zone: JZoneId): JZonedDateTime; cdecl; overload;
{class} function now(clock: JClock): JZonedDateTime; cdecl; overload;
{class} function &of(date: JLocalDate; time: JLocalTime; zone: JZoneId): JZonedDateTime; cdecl; overload;
{class} function &of(localDateTime: JLocalDateTime; zone: JZoneId): JZonedDateTime; cdecl; overload;
{class} function &of(year: Integer; month: Integer; dayOfMonth: Integer; hour: Integer; minute: Integer; second: Integer; nanoOfSecond: Integer; zone: JZoneId): JZonedDateTime; cdecl; overload;
{class} function ofInstant(instant: JInstant; zone: JZoneId): JZonedDateTime; cdecl; overload;
{class} function ofInstant(localDateTime: JLocalDateTime; offset: JZoneOffset; zone: JZoneId): JZonedDateTime; cdecl; overload;
{class} function ofLocal(localDateTime: JLocalDateTime; zone: JZoneId; preferredOffset: JZoneOffset): JZonedDateTime; cdecl;
{class} function ofStrict(localDateTime: JLocalDateTime; offset: JZoneOffset; zone: JZoneId): JZonedDateTime; cdecl;
{class} function parse(text: JCharSequence): JZonedDateTime; cdecl; overload;
{class} function parse(text: JCharSequence; formatter: JDateTimeFormatter): JZonedDateTime; cdecl; overload;
end;
[JavaSignature('java/time/ZonedDateTime')]
JZonedDateTime = interface(JObject)
['{D680CDE8-3B08-42DD-9557-3AC4DFA78DC5}']
function equals(obj: JObject): Boolean; cdecl;
function format(formatter: JDateTimeFormatter): JString; cdecl;
function &get(field: JTemporalField): Integer; cdecl;
function getDayOfMonth: Integer; cdecl;
function getDayOfWeek: JDayOfWeek; cdecl;
function getDayOfYear: Integer; cdecl;
function getHour: Integer; cdecl;
function getLong(field: JTemporalField): Int64; cdecl;
function getMinute: Integer; cdecl;
function getMonth: JMonth; cdecl;
function getMonthValue: Integer; cdecl;
function getNano: Integer; cdecl;
function getOffset: JZoneOffset; cdecl;
function getSecond: Integer; cdecl;
function getYear: Integer; cdecl;
function getZone: JZoneId; cdecl;
function hashCode: Integer; cdecl;
function isSupported(field: JTemporalField): Boolean; cdecl; overload;
function isSupported(unit_: JTemporalUnit): Boolean; cdecl; overload;
function minus(amountToSubtract: JTemporalAmount): JZonedDateTime; cdecl; overload;
function minus(amountToSubtract: Int64; unit_: JTemporalUnit): JZonedDateTime; cdecl; overload;
function minusDays(days: Int64): JZonedDateTime; cdecl;
function minusHours(hours: Int64): JZonedDateTime; cdecl;
function minusMinutes(minutes: Int64): JZonedDateTime; cdecl;
function minusMonths(months: Int64): JZonedDateTime; cdecl;
function minusNanos(nanos: Int64): JZonedDateTime; cdecl;
function minusSeconds(seconds: Int64): JZonedDateTime; cdecl;
function minusWeeks(weeks: Int64): JZonedDateTime; cdecl;
function minusYears(years: Int64): JZonedDateTime; cdecl;
function plus(amountToAdd: JTemporalAmount): JZonedDateTime; cdecl; overload;
function plus(amountToAdd: Int64; unit_: JTemporalUnit): JZonedDateTime; cdecl; overload;
function plusDays(days: Int64): JZonedDateTime; cdecl;
function plusHours(hours: Int64): JZonedDateTime; cdecl;
function plusMinutes(minutes: Int64): JZonedDateTime; cdecl;
function plusMonths(months: Int64): JZonedDateTime; cdecl;
function plusNanos(nanos: Int64): JZonedDateTime; cdecl;
function plusSeconds(seconds: Int64): JZonedDateTime; cdecl;
function plusWeeks(weeks: Int64): JZonedDateTime; cdecl;
function plusYears(years: Int64): JZonedDateTime; cdecl;
function query(query: JTemporalQuery): JObject; cdecl;
function range(field: JTemporalField): JValueRange; cdecl;
function toLocalDate: JLocalDate; cdecl;
function toLocalDateTime: JLocalDateTime; cdecl;
function toLocalTime: JLocalTime; cdecl;
function toOffsetDateTime: JOffsetDateTime; cdecl;
function toString: JString; cdecl;
function truncatedTo(unit_: JTemporalUnit): JZonedDateTime; cdecl;
function &until(endExclusive: JTemporal; unit_: JTemporalUnit): Int64; cdecl;
function &with(adjuster: JTemporalAdjuster): JZonedDateTime; cdecl; overload;
function &with(field: JTemporalField; newValue: Int64): JZonedDateTime; cdecl; overload;
function withDayOfMonth(dayOfMonth: Integer): JZonedDateTime; cdecl;
function withDayOfYear(dayOfYear: Integer): JZonedDateTime; cdecl;
function withEarlierOffsetAtOverlap: JZonedDateTime; cdecl;
function withFixedOffsetZone: JZonedDateTime; cdecl;
function withHour(hour: Integer): JZonedDateTime; cdecl;
function withLaterOffsetAtOverlap: JZonedDateTime; cdecl;
function withMinute(minute: Integer): JZonedDateTime; cdecl;
function withMonth(month: Integer): JZonedDateTime; cdecl;
function withNano(nanoOfSecond: Integer): JZonedDateTime; cdecl;
function withSecond(second: Integer): JZonedDateTime; cdecl;
function withYear(year: Integer): JZonedDateTime; cdecl;
function withZoneSameInstant(zone: JZoneId): JZonedDateTime; cdecl;
function withZoneSameLocal(zone: JZoneId): JZonedDateTime; cdecl;
end;
TJZonedDateTime = class(TJavaGenericImport<JZonedDateTimeClass, JZonedDateTime>) end;
JAbstractChronologyClass = interface(JObjectClass)
['{0932F028-38D2-4B1D-B2C9-B0F327A1F95C}']
end;
[JavaSignature('java/time/chrono/AbstractChronology')]
JAbstractChronology = interface(JObject)
['{19AB65DD-A526-4B9B-ADE3-46CE54059DF2}']
function compareTo(other: JChronology): Integer; cdecl;
function equals(obj: JObject): Boolean; cdecl;
function hashCode: Integer; cdecl;
function resolveDate(fieldValues: JMap; resolverStyle: JResolverStyle): JChronoLocalDate; cdecl;
function toString: JString; cdecl;
end;
TJAbstractChronology = class(TJavaGenericImport<JAbstractChronologyClass, JAbstractChronology>) end;
JChronoLocalDateClass = interface(JComparableClass)
['{74C058D3-6D21-49C4-82AF-FC7103251820}']
{class} function from(temporal: JTemporalAccessor): JChronoLocalDate; cdecl;
{class} function timeLineOrder: JComparator; cdecl;
end;
[JavaSignature('java/time/chrono/ChronoLocalDate')]
JChronoLocalDate = interface(JComparable)
['{47BEFEF4-2F51-4213-8297-12AE37E35A37}']
function adjustInto(temporal: JTemporal): JTemporal; cdecl;
function atTime(localTime: JLocalTime): JChronoLocalDateTime; cdecl;
function compareTo(other: JChronoLocalDate): Integer; cdecl;
function equals(obj: JObject): Boolean; cdecl;
function format(formatter: JDateTimeFormatter): JString; cdecl;
function getChronology: JChronology; cdecl;
function getEra: JEra; cdecl;
function hashCode: Integer; cdecl;
function isAfter(other: JChronoLocalDate): Boolean; cdecl;
function isBefore(other: JChronoLocalDate): Boolean; cdecl;
function isEqual(other: JChronoLocalDate): Boolean; cdecl;
function isLeapYear: Boolean; cdecl;
function isSupported(field: JTemporalField): Boolean; cdecl; overload;
function isSupported(unit_: JTemporalUnit): Boolean; cdecl; overload;
function lengthOfMonth: Integer; cdecl;
function lengthOfYear: Integer; cdecl;
function minus(amount: JTemporalAmount): JChronoLocalDate; cdecl; overload;
function minus(amountToSubtract: Int64; unit_: JTemporalUnit): JChronoLocalDate; cdecl; overload;
function plus(amount: JTemporalAmount): JChronoLocalDate; cdecl; overload;
function plus(amountToAdd: Int64; unit_: JTemporalUnit): JChronoLocalDate; cdecl; overload;
function query(query: JTemporalQuery): JObject; cdecl;
function toEpochDay: Int64; cdecl;
function toString: JString; cdecl;
function &until(endExclusive: JTemporal; unit_: JTemporalUnit): Int64; cdecl; overload;
function &until(endDateExclusive: JChronoLocalDate): JChronoPeriod; cdecl; overload;
function &with(adjuster: JTemporalAdjuster): JChronoLocalDate; cdecl; overload;
function &with(field: JTemporalField; newValue: Int64): JChronoLocalDate; cdecl; overload;
end;
TJChronoLocalDate = class(TJavaGenericImport<JChronoLocalDateClass, JChronoLocalDate>) end;
JChronoLocalDateTimeClass = interface(JComparableClass)
['{EEB50850-FAEA-4889-8B6A-68314F1F3987}']
{class} function from(temporal: JTemporalAccessor): JChronoLocalDateTime; cdecl;
{class} function timeLineOrder: JComparator; cdecl;
end;
[JavaSignature('java/time/chrono/ChronoLocalDateTime')]
JChronoLocalDateTime = interface(JComparable)
['{E53A49C9-142A-4A5C-B61D-18DC861738A6}']
function adjustInto(temporal: JTemporal): JTemporal; cdecl;
function atZone(zone: JZoneId): JChronoZonedDateTime; cdecl;
function compareTo(other: JChronoLocalDateTime): Integer; cdecl;
function equals(obj: JObject): Boolean; cdecl;
function format(formatter: JDateTimeFormatter): JString; cdecl;
function getChronology: JChronology; cdecl;
function hashCode: Integer; cdecl;
function isAfter(other: JChronoLocalDateTime): Boolean; cdecl;
function isBefore(other: JChronoLocalDateTime): Boolean; cdecl;
function isEqual(other: JChronoLocalDateTime): Boolean; cdecl;
function isSupported(field: JTemporalField): Boolean; cdecl; overload;
function isSupported(unit_: JTemporalUnit): Boolean; cdecl; overload;
function minus(amount: JTemporalAmount): JChronoLocalDateTime; cdecl; overload;
function minus(amountToSubtract: Int64; unit_: JTemporalUnit): JChronoLocalDateTime; cdecl; overload;
function plus(amount: JTemporalAmount): JChronoLocalDateTime; cdecl; overload;
function plus(amountToAdd: Int64; unit_: JTemporalUnit): JChronoLocalDateTime; cdecl; overload;
function query(query: JTemporalQuery): JObject; cdecl;
function toEpochSecond(offset: JZoneOffset): Int64; cdecl;
function toInstant(offset: JZoneOffset): JInstant; cdecl;
function toLocalDate: JChronoLocalDate; cdecl;
function toLocalTime: JLocalTime; cdecl;
function toString: JString; cdecl;
function &with(adjuster: JTemporalAdjuster): JChronoLocalDateTime; cdecl; overload;
function &with(field: JTemporalField; newValue: Int64): JChronoLocalDateTime; cdecl; overload;
end;
TJChronoLocalDateTime = class(TJavaGenericImport<JChronoLocalDateTimeClass, JChronoLocalDateTime>) end;
JTemporalAmountClass = interface(IJavaClass)
['{6A70967E-6B81-4267-9285-0461B547C9C4}']
end;
[JavaSignature('java/time/temporal/TemporalAmount')]
JTemporalAmount = interface(IJavaInstance)
['{DDF92685-8B5C-4752-846A-CED6398D7E27}']
function addTo(temporal: JTemporal): JTemporal; cdecl;
function &get(unit_: JTemporalUnit): Int64; cdecl;
function getUnits: JList; cdecl;
function subtractFrom(temporal: JTemporal): JTemporal; cdecl;
end;
TJTemporalAmount = class(TJavaGenericImport<JTemporalAmountClass, JTemporalAmount>) end;
JChronoPeriodClass = interface(JTemporalAmountClass)
['{E0FA34AC-EFA9-4572-87D2-1EEEA5CE167F}']
{class} function between(startDateInclusive: JChronoLocalDate; endDateExclusive: JChronoLocalDate): JChronoPeriod; cdecl;
end;
[JavaSignature('java/time/chrono/ChronoPeriod')]
JChronoPeriod = interface(JTemporalAmount)
['{B4A47071-AFCC-4BD7-A8EA-A35ABBAC22B1}']
function addTo(temporal: JTemporal): JTemporal; cdecl;
function equals(obj: JObject): Boolean; cdecl;
function &get(unit_: JTemporalUnit): Int64; cdecl;
function getChronology: JChronology; cdecl;
function getUnits: JList; cdecl;
function hashCode: Integer; cdecl;
function isNegative: Boolean; cdecl;
function isZero: Boolean; cdecl;
function minus(amountToSubtract: JTemporalAmount): JChronoPeriod; cdecl;
function multipliedBy(scalar: Integer): JChronoPeriod; cdecl;
function negated: JChronoPeriod; cdecl;
function normalized: JChronoPeriod; cdecl;
function plus(amountToAdd: JTemporalAmount): JChronoPeriod; cdecl;
function subtractFrom(temporal: JTemporal): JTemporal; cdecl;
function toString: JString; cdecl;
end;
TJChronoPeriod = class(TJavaGenericImport<JChronoPeriodClass, JChronoPeriod>) end;
JChronoZonedDateTimeClass = interface(JComparableClass)
['{059ABCFD-AB2D-4326-8103-85D2B7FEFBBE}']
{class} function from(temporal: JTemporalAccessor): JChronoZonedDateTime; cdecl;
{class} function timeLineOrder: JComparator; cdecl;
end;
[JavaSignature('java/time/chrono/ChronoZonedDateTime')]
JChronoZonedDateTime = interface(JComparable)
['{6B6FFF58-A785-4D73-854F-BAEE4588EE5C}']
function compareTo(other: JChronoZonedDateTime): Integer; cdecl;
function equals(obj: JObject): Boolean; cdecl;
function format(formatter: JDateTimeFormatter): JString; cdecl;
function &get(field: JTemporalField): Integer; cdecl;
function getChronology: JChronology; cdecl;
function getLong(field: JTemporalField): Int64; cdecl;
function getOffset: JZoneOffset; cdecl;
function getZone: JZoneId; cdecl;
function hashCode: Integer; cdecl;
function isAfter(other: JChronoZonedDateTime): Boolean; cdecl;
function isBefore(other: JChronoZonedDateTime): Boolean; cdecl;
function isEqual(other: JChronoZonedDateTime): Boolean; cdecl;
function isSupported(field: JTemporalField): Boolean; cdecl; overload;
function isSupported(unit_: JTemporalUnit): Boolean; cdecl; overload;
function minus(amount: JTemporalAmount): JChronoZonedDateTime; cdecl; overload;
function minus(amountToSubtract: Int64; unit_: JTemporalUnit): JChronoZonedDateTime; cdecl; overload;
function plus(amount: JTemporalAmount): JChronoZonedDateTime; cdecl; overload;
function plus(amountToAdd: Int64; unit_: JTemporalUnit): JChronoZonedDateTime; cdecl; overload;
function query(query: JTemporalQuery): JObject; cdecl;
function range(field: JTemporalField): JValueRange; cdecl;
function toEpochSecond: Int64; cdecl;
function toInstant: JInstant; cdecl;
function toLocalDate: JChronoLocalDate; cdecl;
function toLocalDateTime: JChronoLocalDateTime; cdecl;
function toLocalTime: JLocalTime; cdecl;
function toString: JString; cdecl;
function &with(adjuster: JTemporalAdjuster): JChronoZonedDateTime; cdecl; overload;
function &with(field: JTemporalField; newValue: Int64): JChronoZonedDateTime; cdecl; overload;
function withEarlierOffsetAtOverlap: JChronoZonedDateTime; cdecl;
function withLaterOffsetAtOverlap: JChronoZonedDateTime; cdecl;
function withZoneSameInstant(zone: JZoneId): JChronoZonedDateTime; cdecl;
function withZoneSameLocal(zone: JZoneId): JChronoZonedDateTime; cdecl;
end;
TJChronoZonedDateTime = class(TJavaGenericImport<JChronoZonedDateTimeClass, JChronoZonedDateTime>) end;
JChronologyClass = interface(JComparableClass)
['{D41BF08B-953F-4F20-BB9C-7C686ECA03C2}']
{class} function from(temporal: JTemporalAccessor): JChronology; cdecl;
{class} function getAvailableChronologies: JSet; cdecl;
{class} function &of(id: JString): JChronology; cdecl;
{class} function ofLocale(locale: JLocale): JChronology; cdecl;
end;
[JavaSignature('java/time/chrono/Chronology')]
JChronology = interface(JComparable)
['{3946B1A9-D169-4894-948F-106B086F481E}']
function compareTo(other: JChronology): Integer; cdecl;
function date(era: JEra; yearOfEra: Integer; month: Integer; dayOfMonth: Integer): JChronoLocalDate; cdecl; overload;
function date(prolepticYear: Integer; month: Integer; dayOfMonth: Integer): JChronoLocalDate; cdecl; overload;
function date(temporal: JTemporalAccessor): JChronoLocalDate; cdecl; overload;
function dateEpochDay(epochDay: Int64): JChronoLocalDate; cdecl;
function dateNow: JChronoLocalDate; cdecl; overload;
function dateNow(zone: JZoneId): JChronoLocalDate; cdecl; overload;
function dateNow(clock: JClock): JChronoLocalDate; cdecl; overload;
function dateYearDay(era: JEra; yearOfEra: Integer; dayOfYear: Integer): JChronoLocalDate; cdecl; overload;
function dateYearDay(prolepticYear: Integer; dayOfYear: Integer): JChronoLocalDate; cdecl; overload;
function equals(obj: JObject): Boolean; cdecl;
function eraOf(eraValue: Integer): JEra; cdecl;
function eras: JList; cdecl;
function getCalendarType: JString; cdecl;
function getDisplayName(style: JTextStyle; locale: JLocale): JString; cdecl;
function getId: JString; cdecl;
function hashCode: Integer; cdecl;
function isLeapYear(prolepticYear: Int64): Boolean; cdecl;
function localDateTime(temporal: JTemporalAccessor): JChronoLocalDateTime; cdecl;
function period(years: Integer; months: Integer; days: Integer): JChronoPeriod; cdecl;
function prolepticYear(era: JEra; yearOfEra: Integer): Integer; cdecl;
function range(field: JChronoField): JValueRange; cdecl;
function resolveDate(fieldValues: JMap; resolverStyle: JResolverStyle): JChronoLocalDate; cdecl;
function toString: JString; cdecl;
function zonedDateTime(temporal: JTemporalAccessor): JChronoZonedDateTime; cdecl; overload;
function zonedDateTime(instant: JInstant; zone: JZoneId): JChronoZonedDateTime; cdecl; overload;
end;
TJChronology = class(TJavaGenericImport<JChronologyClass, JChronology>) end;
JTemporalAccessorClass = interface(IJavaClass)
['{7B245385-F9E9-4B63-ACA8-F3F5D73F1C01}']
end;
[JavaSignature('java/time/temporal/TemporalAccessor')]
JTemporalAccessor = interface(IJavaInstance)
['{0421DC83-A9DB-4889-87FC-7619678B99A4}']
function &get(field: JTemporalField): Integer; cdecl;
function getLong(field: JTemporalField): Int64; cdecl;
function isSupported(field: JTemporalField): Boolean; cdecl;
function query(query: JTemporalQuery): JObject; cdecl;
function range(field: JTemporalField): JValueRange; cdecl;
end;
TJTemporalAccessor = class(TJavaGenericImport<JTemporalAccessorClass, JTemporalAccessor>) end;
JEraClass = interface(JTemporalAccessorClass)
['{49E6F614-3CC8-41C1-9B71-CC2858002452}']
end;
[JavaSignature('java/time/chrono/Era')]
JEra = interface(JTemporalAccessor)
['{0C3B0785-4DB1-433F-A813-ACF3B9E88462}']
function adjustInto(temporal: JTemporal): JTemporal; cdecl;
function &get(field: JTemporalField): Integer; cdecl;
function getDisplayName(style: JTextStyle; locale: JLocale): JString; cdecl;
function getLong(field: JTemporalField): Int64; cdecl;
function getValue: Integer; cdecl;
function isSupported(field: JTemporalField): Boolean; cdecl;
function query(query: JTemporalQuery): JObject; cdecl;
function range(field: JTemporalField): JValueRange; cdecl;
end;
TJEra = class(TJavaGenericImport<JEraClass, JEra>) end;
JIsoChronologyClass = interface(JAbstractChronologyClass)
['{D90C5996-F97B-444C-B6F4-0A68D40A54DE}']
{class} function _GetINSTANCE: JIsoChronology; cdecl;
{class} property INSTANCE: JIsoChronology read _GetINSTANCE;
end;
[JavaSignature('java/time/chrono/IsoChronology')]
JIsoChronology = interface(JAbstractChronology)
['{8EFD7590-60D2-41CA-AF0C-619649365169}']
function date(era: JEra; yearOfEra: Integer; month: Integer; dayOfMonth: Integer): JLocalDate; cdecl; overload;
function date(prolepticYear: Integer; month: Integer; dayOfMonth: Integer): JLocalDate; cdecl; overload;
function date(temporal: JTemporalAccessor): JLocalDate; cdecl; overload;
function dateEpochDay(epochDay: Int64): JLocalDate; cdecl;
function dateNow: JLocalDate; cdecl; overload;
function dateNow(zone: JZoneId): JLocalDate; cdecl; overload;
function dateNow(clock: JClock): JLocalDate; cdecl; overload;
function dateYearDay(era: JEra; yearOfEra: Integer; dayOfYear: Integer): JLocalDate; cdecl; overload;
function dateYearDay(prolepticYear: Integer; dayOfYear: Integer): JLocalDate; cdecl; overload;
function eraOf(eraValue: Integer): JIsoEra; cdecl;
function eras: JList; cdecl;
function getCalendarType: JString; cdecl;
function getId: JString; cdecl;
function isLeapYear(prolepticYear: Int64): Boolean; cdecl;
function localDateTime(temporal: JTemporalAccessor): JLocalDateTime; cdecl;
function period(years: Integer; months: Integer; days: Integer): JPeriod; cdecl;
function prolepticYear(era: JEra; yearOfEra: Integer): Integer; cdecl;
function range(field: JChronoField): JValueRange; cdecl;
function resolveDate(fieldValues: JMap; resolverStyle: JResolverStyle): JLocalDate; cdecl;
function zonedDateTime(temporal: JTemporalAccessor): JZonedDateTime; cdecl; overload;
function zonedDateTime(instant: JInstant; zone: JZoneId): JZonedDateTime; cdecl; overload;
end;
TJIsoChronology = class(TJavaGenericImport<JIsoChronologyClass, JIsoChronology>) end;
JIsoEraClass = interface(JEnumClass)
['{295EE426-29D7-4C76-97A2-B6EFFFCD3724}']
{class} function _GetBCE: JIsoEra; cdecl;
{class} function _GetCE: JIsoEra; cdecl;
{class} function &of(isoEra: Integer): JIsoEra; cdecl;
{class} function valueOf(name: JString): JIsoEra; cdecl;
{class} function values: TJavaObjectArray<JIsoEra>; cdecl;
{class} property BCE: JIsoEra read _GetBCE;
{class} property CE: JIsoEra read _GetCE;
end;
[JavaSignature('java/time/chrono/IsoEra')]
JIsoEra = interface(JEnum)
['{98E1F19A-BDE2-4211-AB25-DB7A6BDA8E9C}']
function getValue: Integer; cdecl;
end;
TJIsoEra = class(TJavaGenericImport<JIsoEraClass, JIsoEra>) end;
JDateTimeFormatterClass = interface(JObjectClass)
['{BDA56E1C-FD32-4DF9-B1A7-40F92547C095}']
{class} function _GetBASIC_ISO_DATE: JDateTimeFormatter; cdecl;
{class} function _GetISO_DATE: JDateTimeFormatter; cdecl;
{class} function _GetISO_DATE_TIME: JDateTimeFormatter; cdecl;
{class} function _GetISO_INSTANT: JDateTimeFormatter; cdecl;
{class} function _GetISO_LOCAL_DATE: JDateTimeFormatter; cdecl;
{class} function _GetISO_LOCAL_DATE_TIME: JDateTimeFormatter; cdecl;
{class} function _GetISO_LOCAL_TIME: JDateTimeFormatter; cdecl;
{class} function _GetISO_OFFSET_DATE: JDateTimeFormatter; cdecl;
{class} function _GetISO_OFFSET_DATE_TIME: JDateTimeFormatter; cdecl;
{class} function _GetISO_OFFSET_TIME: JDateTimeFormatter; cdecl;
{class} function _GetISO_ORDINAL_DATE: JDateTimeFormatter; cdecl;
{class} function _GetISO_TIME: JDateTimeFormatter; cdecl;
{class} function _GetISO_WEEK_DATE: JDateTimeFormatter; cdecl;
{class} function _GetISO_ZONED_DATE_TIME: JDateTimeFormatter; cdecl;
{class} function _GetRFC_1123_DATE_TIME: JDateTimeFormatter; cdecl;
{class} function ofLocalizedDate(dateStyle: JFormatStyle): JDateTimeFormatter; cdecl;
{class} function ofLocalizedDateTime(dateTimeStyle: JFormatStyle): JDateTimeFormatter; cdecl; overload;
{class} function ofLocalizedDateTime(dateStyle: JFormatStyle; timeStyle: JFormatStyle): JDateTimeFormatter; cdecl; overload;
{class} function ofLocalizedTime(timeStyle: JFormatStyle): JDateTimeFormatter; cdecl;
{class} function ofPattern(pattern: JString): JDateTimeFormatter; cdecl; overload;
{class} function ofPattern(pattern: JString; locale: JLocale): JDateTimeFormatter; cdecl; overload;
{class} function parsedExcessDays: JTemporalQuery; cdecl;
{class} function parsedLeapSecond: JTemporalQuery; cdecl;
{class} property BASIC_ISO_DATE: JDateTimeFormatter read _GetBASIC_ISO_DATE;
{class} property ISO_DATE: JDateTimeFormatter read _GetISO_DATE;
{class} property ISO_DATE_TIME: JDateTimeFormatter read _GetISO_DATE_TIME;
{class} property ISO_INSTANT: JDateTimeFormatter read _GetISO_INSTANT;
{class} property ISO_LOCAL_DATE: JDateTimeFormatter read _GetISO_LOCAL_DATE;
{class} property ISO_LOCAL_DATE_TIME: JDateTimeFormatter read _GetISO_LOCAL_DATE_TIME;
{class} property ISO_LOCAL_TIME: JDateTimeFormatter read _GetISO_LOCAL_TIME;
{class} property ISO_OFFSET_DATE: JDateTimeFormatter read _GetISO_OFFSET_DATE;
{class} property ISO_OFFSET_DATE_TIME: JDateTimeFormatter read _GetISO_OFFSET_DATE_TIME;
{class} property ISO_OFFSET_TIME: JDateTimeFormatter read _GetISO_OFFSET_TIME;
{class} property ISO_ORDINAL_DATE: JDateTimeFormatter read _GetISO_ORDINAL_DATE;
{class} property ISO_TIME: JDateTimeFormatter read _GetISO_TIME;
{class} property ISO_WEEK_DATE: JDateTimeFormatter read _GetISO_WEEK_DATE;
{class} property ISO_ZONED_DATE_TIME: JDateTimeFormatter read _GetISO_ZONED_DATE_TIME;
{class} property RFC_1123_DATE_TIME: JDateTimeFormatter read _GetRFC_1123_DATE_TIME;
end;
[JavaSignature('java/time/format/DateTimeFormatter')]
JDateTimeFormatter = interface(JObject)
['{29AA9616-FA0F-4373-B4CB-204FD3DA4A9A}']
function format(temporal: JTemporalAccessor): JString; cdecl;
procedure formatTo(temporal: JTemporalAccessor; appendable: JAppendable); cdecl;
function getChronology: JChronology; cdecl;
function getDecimalStyle: JDecimalStyle; cdecl;
function getLocale: JLocale; cdecl;
function getResolverFields: JSet; cdecl;
function getResolverStyle: JResolverStyle; cdecl;
function getZone: JZoneId; cdecl;
function parse(text: JCharSequence): JTemporalAccessor; cdecl; overload;
function parse(text: JCharSequence; position: JParsePosition): JTemporalAccessor; cdecl; overload;
function parse(text: JCharSequence; query: JTemporalQuery): JObject; cdecl; overload;
function parseUnresolved(text: JCharSequence; position: JParsePosition): JTemporalAccessor; cdecl;
function toFormat: JFormat; cdecl; overload;
function toFormat(parseQuery: JTemporalQuery): JFormat; cdecl; overload;
function toString: JString; cdecl;
function withChronology(chrono: JChronology): JDateTimeFormatter; cdecl;
function withDecimalStyle(decimalStyle: JDecimalStyle): JDateTimeFormatter; cdecl;
function withLocale(locale: JLocale): JDateTimeFormatter; cdecl;
function withResolverFields(resolverFields: JSet): JDateTimeFormatter; cdecl; overload;
function withResolverStyle(resolverStyle: JResolverStyle): JDateTimeFormatter; cdecl;
function withZone(zone: JZoneId): JDateTimeFormatter; cdecl;
end;
TJDateTimeFormatter = class(TJavaGenericImport<JDateTimeFormatterClass, JDateTimeFormatter>) end;
JDecimalStyleClass = interface(JObjectClass)
['{2DBE716F-960E-42FA-BB7E-45E620FD1600}']
{class} function _GetSTANDARD: JDecimalStyle; cdecl;
{class} function getAvailableLocales: JSet; cdecl;
{class} function &of(locale: JLocale): JDecimalStyle; cdecl;
{class} function ofDefaultLocale: JDecimalStyle; cdecl;
{class} property STANDARD: JDecimalStyle read _GetSTANDARD;
end;
[JavaSignature('java/time/format/DecimalStyle')]
JDecimalStyle = interface(JObject)
['{0E610382-E531-46E6-A94E-63D5FB74B0A8}']
function equals(obj: JObject): Boolean; cdecl;
function getDecimalSeparator: Char; cdecl;
function getNegativeSign: Char; cdecl;
function getPositiveSign: Char; cdecl;
function getZeroDigit: Char; cdecl;
function hashCode: Integer; cdecl;
function toString: JString; cdecl;
function withDecimalSeparator(decimalSeparator: Char): JDecimalStyle; cdecl;
function withNegativeSign(negativeSign: Char): JDecimalStyle; cdecl;
function withPositiveSign(positiveSign: Char): JDecimalStyle; cdecl;
function withZeroDigit(zeroDigit: Char): JDecimalStyle; cdecl;
end;
TJDecimalStyle = class(TJavaGenericImport<JDecimalStyleClass, JDecimalStyle>) end;
JFormatStyleClass = interface(JEnumClass)
['{A7C8A242-2E4C-46EA-A2F1-F3BE9FC0515D}']
{class} function _GetFULL: JFormatStyle; cdecl;
{class} function _GetLONG: JFormatStyle; cdecl;
{class} function _GetMEDIUM: JFormatStyle; cdecl;
{class} function _GetSHORT: JFormatStyle; cdecl;
{class} function valueOf(name: JString): JFormatStyle; cdecl;
{class} function values: TJavaObjectArray<JFormatStyle>; cdecl;
{class} property FULL: JFormatStyle read _GetFULL;
{class} property LONG: JFormatStyle read _GetLONG;
{class} property MEDIUM: JFormatStyle read _GetMEDIUM;
{class} property SHORT: JFormatStyle read _GetSHORT;
end;
[JavaSignature('java/time/format/FormatStyle')]
JFormatStyle = interface(JEnum)
['{1BCCCF8B-F5EB-4F35-A2F3-80D3E394AF97}']
end;
TJFormatStyle = class(TJavaGenericImport<JFormatStyleClass, JFormatStyle>) end;
JResolverStyleClass = interface(JEnumClass)
['{42EE3459-65A1-42AA-9056-CE171E9DDEDC}']
{class} function _GetLENIENT: JResolverStyle; cdecl;
{class} function _GetSMART: JResolverStyle; cdecl;
{class} function _GetSTRICT: JResolverStyle; cdecl;
{class} function valueOf(name: JString): JResolverStyle; cdecl;
{class} function values: TJavaObjectArray<JResolverStyle>; cdecl;
{class} property LENIENT: JResolverStyle read _GetLENIENT;
{class} property SMART: JResolverStyle read _GetSMART;
{class} property &STRICT: JResolverStyle read _GetSTRICT;
end;
[JavaSignature('java/time/format/ResolverStyle')]
JResolverStyle = interface(JEnum)
['{DE009868-567F-4BEE-9989-3BC6BB0D8ABA}']
end;
TJResolverStyle = class(TJavaGenericImport<JResolverStyleClass, JResolverStyle>) end;
JTextStyleClass = interface(JEnumClass)
['{10BE82A8-202D-46FB-A862-B1816144957F}']
{class} function _GetFULL: JTextStyle; cdecl;
{class} function _GetFULL_STANDALONE: JTextStyle; cdecl;
{class} function _GetNARROW: JTextStyle; cdecl;
{class} function _GetNARROW_STANDALONE: JTextStyle; cdecl;
{class} function _GetSHORT: JTextStyle; cdecl;
{class} function _GetSHORT_STANDALONE: JTextStyle; cdecl;
{class} function valueOf(name: JString): JTextStyle; cdecl;
{class} function values: TJavaObjectArray<JTextStyle>; cdecl;
{class} property FULL: JTextStyle read _GetFULL;
{class} property FULL_STANDALONE: JTextStyle read _GetFULL_STANDALONE;
{class} property NARROW: JTextStyle read _GetNARROW;
{class} property NARROW_STANDALONE: JTextStyle read _GetNARROW_STANDALONE;
{class} property SHORT: JTextStyle read _GetSHORT;
{class} property SHORT_STANDALONE: JTextStyle read _GetSHORT_STANDALONE;
end;
[JavaSignature('java/time/format/TextStyle')]
JTextStyle = interface(JEnum)
['{2B53FE7D-A7FA-469F-B350-564E01F7B0D6}']
function asNormal: JTextStyle; cdecl;
function asStandalone: JTextStyle; cdecl;
function isStandalone: Boolean; cdecl;
end;
TJTextStyle = class(TJavaGenericImport<JTextStyleClass, JTextStyle>) end;
JChronoFieldClass = interface(JEnumClass)
['{2D0A63E7-F3FA-4D1A-A631-A3CF58CFA52C}']
{class} function _GetALIGNED_DAY_OF_WEEK_IN_MONTH: JChronoField; cdecl;
{class} function _GetALIGNED_DAY_OF_WEEK_IN_YEAR: JChronoField; cdecl;
{class} function _GetALIGNED_WEEK_OF_MONTH: JChronoField; cdecl;
{class} function _GetALIGNED_WEEK_OF_YEAR: JChronoField; cdecl;
{class} function _GetAMPM_OF_DAY: JChronoField; cdecl;
{class} function _GetCLOCK_HOUR_OF_AMPM: JChronoField; cdecl;
{class} function _GetCLOCK_HOUR_OF_DAY: JChronoField; cdecl;
{class} function _GetDAY_OF_MONTH: JChronoField; cdecl;
{class} function _GetDAY_OF_WEEK: JChronoField; cdecl;
{class} function _GetDAY_OF_YEAR: JChronoField; cdecl;
{class} function _GetEPOCH_DAY: JChronoField; cdecl;
{class} function _GetERA: JChronoField; cdecl;
{class} function _GetHOUR_OF_AMPM: JChronoField; cdecl;
{class} function _GetHOUR_OF_DAY: JChronoField; cdecl;
{class} function _GetINSTANT_SECONDS: JChronoField; cdecl;
{class} function _GetMICRO_OF_DAY: JChronoField; cdecl;
{class} function _GetMICRO_OF_SECOND: JChronoField; cdecl;
{class} function _GetMILLI_OF_DAY: JChronoField; cdecl;
{class} function _GetMILLI_OF_SECOND: JChronoField; cdecl;
{class} function _GetMINUTE_OF_DAY: JChronoField; cdecl;
{class} function _GetMINUTE_OF_HOUR: JChronoField; cdecl;
{class} function _GetMONTH_OF_YEAR: JChronoField; cdecl;
{class} function _GetNANO_OF_DAY: JChronoField; cdecl;
{class} function _GetNANO_OF_SECOND: JChronoField; cdecl;
{class} function _GetOFFSET_SECONDS: JChronoField; cdecl;
{class} function _GetPROLEPTIC_MONTH: JChronoField; cdecl;
{class} function _GetSECOND_OF_DAY: JChronoField; cdecl;
{class} function _GetSECOND_OF_MINUTE: JChronoField; cdecl;
{class} function _GetYEAR: JChronoField; cdecl;
{class} function _GetYEAR_OF_ERA: JChronoField; cdecl;
{class} function valueOf(name: JString): JChronoField; cdecl;
{class} function values: TJavaObjectArray<JChronoField>; cdecl;
{class} property ALIGNED_DAY_OF_WEEK_IN_MONTH: JChronoField read _GetALIGNED_DAY_OF_WEEK_IN_MONTH;
{class} property ALIGNED_DAY_OF_WEEK_IN_YEAR: JChronoField read _GetALIGNED_DAY_OF_WEEK_IN_YEAR;
{class} property ALIGNED_WEEK_OF_MONTH: JChronoField read _GetALIGNED_WEEK_OF_MONTH;
{class} property ALIGNED_WEEK_OF_YEAR: JChronoField read _GetALIGNED_WEEK_OF_YEAR;
{class} property AMPM_OF_DAY: JChronoField read _GetAMPM_OF_DAY;
{class} property CLOCK_HOUR_OF_AMPM: JChronoField read _GetCLOCK_HOUR_OF_AMPM;
{class} property CLOCK_HOUR_OF_DAY: JChronoField read _GetCLOCK_HOUR_OF_DAY;
{class} property DAY_OF_MONTH: JChronoField read _GetDAY_OF_MONTH;
{class} property DAY_OF_WEEK: JChronoField read _GetDAY_OF_WEEK;
{class} property DAY_OF_YEAR: JChronoField read _GetDAY_OF_YEAR;
{class} property EPOCH_DAY: JChronoField read _GetEPOCH_DAY;
{class} property ERA: JChronoField read _GetERA;
{class} property HOUR_OF_AMPM: JChronoField read _GetHOUR_OF_AMPM;
{class} property HOUR_OF_DAY: JChronoField read _GetHOUR_OF_DAY;
{class} property INSTANT_SECONDS: JChronoField read _GetINSTANT_SECONDS;
{class} property MICRO_OF_DAY: JChronoField read _GetMICRO_OF_DAY;
{class} property MICRO_OF_SECOND: JChronoField read _GetMICRO_OF_SECOND;
{class} property MILLI_OF_DAY: JChronoField read _GetMILLI_OF_DAY;
{class} property MILLI_OF_SECOND: JChronoField read _GetMILLI_OF_SECOND;
{class} property MINUTE_OF_DAY: JChronoField read _GetMINUTE_OF_DAY;
{class} property MINUTE_OF_HOUR: JChronoField read _GetMINUTE_OF_HOUR;
{class} property MONTH_OF_YEAR: JChronoField read _GetMONTH_OF_YEAR;
{class} property NANO_OF_DAY: JChronoField read _GetNANO_OF_DAY;
{class} property NANO_OF_SECOND: JChronoField read _GetNANO_OF_SECOND;
{class} property OFFSET_SECONDS: JChronoField read _GetOFFSET_SECONDS;
{class} property PROLEPTIC_MONTH: JChronoField read _GetPROLEPTIC_MONTH;
{class} property SECOND_OF_DAY: JChronoField read _GetSECOND_OF_DAY;
{class} property SECOND_OF_MINUTE: JChronoField read _GetSECOND_OF_MINUTE;
{class} property YEAR: JChronoField read _GetYEAR;
{class} property YEAR_OF_ERA: JChronoField read _GetYEAR_OF_ERA;
end;
[JavaSignature('java/time/temporal/ChronoField')]
JChronoField = interface(JEnum)
['{15F403B8-5EA9-4D3D-BC93-D67416D8959C}']
function adjustInto(temporal: JTemporal; newValue: Int64): JTemporal; cdecl;
function checkValidIntValue(value: Int64): Integer; cdecl;
function checkValidValue(value: Int64): Int64; cdecl;
function getBaseUnit: JTemporalUnit; cdecl;
function getDisplayName(locale: JLocale): JString; cdecl;
function getFrom(temporal: JTemporalAccessor): Int64; cdecl;
function getRangeUnit: JTemporalUnit; cdecl;
function isDateBased: Boolean; cdecl;
function isSupportedBy(temporal: JTemporalAccessor): Boolean; cdecl;
function isTimeBased: Boolean; cdecl;
function range: JValueRange; cdecl;
function rangeRefinedBy(temporal: JTemporalAccessor): JValueRange; cdecl;
function toString: JString; cdecl;
end;
TJChronoField = class(TJavaGenericImport<JChronoFieldClass, JChronoField>) end;
JTemporalClass = interface(JTemporalAccessorClass)
['{1A85325F-BD90-4A29-899B-AC0BA01DB983}']
end;
[JavaSignature('java/time/temporal/Temporal')]
JTemporal = interface(JTemporalAccessor)
['{FA7289DB-4B0A-4A73-AEBD-B13E9C4D21CE}']
function isSupported(unit_: JTemporalUnit): Boolean; cdecl;
function minus(amount: JTemporalAmount): JTemporal; cdecl; overload;
function minus(amountToSubtract: Int64; unit_: JTemporalUnit): JTemporal; cdecl; overload;
function plus(amount: JTemporalAmount): JTemporal; cdecl; overload;
function plus(amountToAdd: Int64; unit_: JTemporalUnit): JTemporal; cdecl; overload;
function &until(endExclusive: JTemporal; unit_: JTemporalUnit): Int64; cdecl;
function &with(adjuster: JTemporalAdjuster): JTemporal; cdecl; overload;
function &with(field: JTemporalField; newValue: Int64): JTemporal; cdecl; overload;
end;
TJTemporal = class(TJavaGenericImport<JTemporalClass, JTemporal>) end;
JTemporalAdjusterClass = interface(IJavaClass)
['{42C7C64D-5B6C-49F6-8F0B-F3AF5F4C4331}']
end;
[JavaSignature('java/time/temporal/TemporalAdjuster')]
JTemporalAdjuster = interface(IJavaInstance)
['{18310EBC-FF7E-4FDC-8F75-D3DA123BC7D2}']
function adjustInto(temporal: JTemporal): JTemporal; cdecl;
end;
TJTemporalAdjuster = class(TJavaGenericImport<JTemporalAdjusterClass, JTemporalAdjuster>) end;
JTemporalFieldClass = interface(IJavaClass)
['{CA4D3C6A-588D-46E5-9AF4-7F57D2BB9FDB}']
end;
[JavaSignature('java/time/temporal/TemporalField')]
JTemporalField = interface(IJavaInstance)
['{EDAAA04C-7379-4F5F-9BF1-1BF06BF642A0}']
function adjustInto(temporal: JTemporal; newValue: Int64): JTemporal; cdecl;
function getBaseUnit: JTemporalUnit; cdecl;
function getDisplayName(locale: JLocale): JString; cdecl;
function getFrom(temporal: JTemporalAccessor): Int64; cdecl;
function getRangeUnit: JTemporalUnit; cdecl;
function isDateBased: Boolean; cdecl;
function isSupportedBy(temporal: JTemporalAccessor): Boolean; cdecl;
function isTimeBased: Boolean; cdecl;
function range: JValueRange; cdecl;
function rangeRefinedBy(temporal: JTemporalAccessor): JValueRange; cdecl;
function resolve(fieldValues: JMap; partialTemporal: JTemporalAccessor; resolverStyle: JResolverStyle): JTemporalAccessor; cdecl;
function toString: JString; cdecl;
end;
TJTemporalField = class(TJavaGenericImport<JTemporalFieldClass, JTemporalField>) end;
JTemporalQueryClass = interface(IJavaClass)
['{BD6D88B5-B213-4B55-B715-57B2A14CC328}']
end;
[JavaSignature('java/time/temporal/TemporalQuery')]
JTemporalQuery = interface(IJavaInstance)
['{9CA1A58F-9DE4-44FE-AC9A-9775BB389F8C}']
function queryFrom(temporal: JTemporalAccessor): JObject; cdecl;
end;
TJTemporalQuery = class(TJavaGenericImport<JTemporalQueryClass, JTemporalQuery>) end;
JTemporalUnitClass = interface(IJavaClass)
['{FF9EA5BA-C5A7-4F46-9553-AEFA88FBEC35}']
end;
[JavaSignature('java/time/temporal/TemporalUnit')]
JTemporalUnit = interface(IJavaInstance)
['{A356B0F1-6D31-44D1-95DA-C34E7526017F}']
function addTo(temporal: JTemporal; amount: Int64): JTemporal; cdecl;
function between(temporal1Inclusive: JTemporal; temporal2Exclusive: JTemporal): Int64; cdecl;
function getDuration: Jtime_Duration; cdecl;
function isDateBased: Boolean; cdecl;
function isDurationEstimated: Boolean; cdecl;
function isSupportedBy(temporal: JTemporal): Boolean; cdecl;
function isTimeBased: Boolean; cdecl;
function toString: JString; cdecl;
end;
TJTemporalUnit = class(TJavaGenericImport<JTemporalUnitClass, JTemporalUnit>) end;
JValueRangeClass = interface(JObjectClass)
['{394447EA-BF26-4286-8B15-13702C680670}']
{class} function &of(min: Int64; max: Int64): JValueRange; cdecl; overload;
{class} function &of(min: Int64; maxSmallest: Int64; maxLargest: Int64): JValueRange; cdecl; overload;
{class} function &of(minSmallest: Int64; minLargest: Int64; maxSmallest: Int64; maxLargest: Int64): JValueRange; cdecl; overload;
end;
[JavaSignature('java/time/temporal/ValueRange')]
JValueRange = interface(JObject)
['{C7045356-666D-484E-AA4F-062E90BFFB90}']
function checkValidIntValue(value: Int64; field: JTemporalField): Integer; cdecl;
function checkValidValue(value: Int64; field: JTemporalField): Int64; cdecl;
function equals(obj: JObject): Boolean; cdecl;
function getLargestMinimum: Int64; cdecl;
function getMaximum: Int64; cdecl;
function getMinimum: Int64; cdecl;
function getSmallestMaximum: Int64; cdecl;
function hashCode: Integer; cdecl;
function isFixed: Boolean; cdecl;
function isIntValue: Boolean; cdecl;
function isValidIntValue(value: Int64): Boolean; cdecl;
function isValidValue(value: Int64): Boolean; cdecl;
function toString: JString; cdecl;
end;
TJValueRange = class(TJavaGenericImport<JValueRangeClass, JValueRange>) end;
JZoneOffsetTransitionClass = interface(JObjectClass)
['{77618F07-7EEB-47C8-A607-0704A9B4FE15}']
{class} function &of(transition: JLocalDateTime; offsetBefore: JZoneOffset; offsetAfter: JZoneOffset): JZoneOffsetTransition; cdecl;
end;
[JavaSignature('java/time/zone/ZoneOffsetTransition')]
JZoneOffsetTransition = interface(JObject)
['{5E5D6A97-CC73-4FBB-BBEB-91B24D00E155}']
function compareTo(transition: JZoneOffsetTransition): Integer; cdecl;
function equals(other: JObject): Boolean; cdecl;
function getDateTimeAfter: JLocalDateTime; cdecl;
function getDateTimeBefore: JLocalDateTime; cdecl;
function getDuration: Jtime_Duration; cdecl;
function getInstant: JInstant; cdecl;
function getOffsetAfter: JZoneOffset; cdecl;
function getOffsetBefore: JZoneOffset; cdecl;
function hashCode: Integer; cdecl;
function isGap: Boolean; cdecl;
function isOverlap: Boolean; cdecl;
function isValidOffset(offset: JZoneOffset): Boolean; cdecl;
function toEpochSecond: Int64; cdecl;
function toString: JString; cdecl;
end;
TJZoneOffsetTransition = class(TJavaGenericImport<JZoneOffsetTransitionClass, JZoneOffsetTransition>) end;
JZoneRulesClass = interface(JObjectClass)
['{394567D5-7531-4461-8DCA-34FFFA25091D}']
{class} function &of(baseStandardOffset: JZoneOffset; baseWallOffset: JZoneOffset; standardOffsetTransitionList: JList; transitionList: JList; lastRules: JList): JZoneRules; cdecl; overload;
{class} function &of(offset: JZoneOffset): JZoneRules; cdecl; overload;
end;
[JavaSignature('java/time/zone/ZoneRules')]
JZoneRules = interface(JObject)
['{CC6C75EB-7BEF-465F-A492-BE172FA7AF28}']
function equals(otherRules: JObject): Boolean; cdecl;
function getDaylightSavings(instant: JInstant): Jtime_Duration; cdecl;
function getOffset(instant: JInstant): JZoneOffset; cdecl; overload;
function getOffset(localDateTime: JLocalDateTime): JZoneOffset; cdecl; overload;
function getStandardOffset(instant: JInstant): JZoneOffset; cdecl;
function getTransition(localDateTime: JLocalDateTime): JZoneOffsetTransition; cdecl;
function getTransitionRules: JList; cdecl;
function getTransitions: JList; cdecl;
function getValidOffsets(localDateTime: JLocalDateTime): JList; cdecl;
function hashCode: Integer; cdecl;
function isDaylightSavings(instant: JInstant): Boolean; cdecl;
function isFixedOffset: Boolean; cdecl;
function isValidOffset(localDateTime: JLocalDateTime; offset: JZoneOffset): Boolean; cdecl;
function nextTransition(instant: JInstant): JZoneOffsetTransition; cdecl;
function previousTransition(instant: JInstant): JZoneOffsetTransition; cdecl;
function toString: JString; cdecl;
end;
TJZoneRules = class(TJavaGenericImport<JZoneRulesClass, JZoneRules>) end;
JAbstractCollectionClass = interface(JObjectClass)
['{27541496-F538-45DB-BFC7-9ED05E5680C3}']
end;
[JavaSignature('java/util/AbstractCollection')]
JAbstractCollection = interface(JObject)
['{4A5BA15A-2B07-4768-AA91-4BA9C93882C1}']
function add(e: JObject): Boolean; cdecl;
function addAll(c: JCollection): Boolean; cdecl;
procedure clear; cdecl;
function &contains(o: JObject): Boolean; cdecl;
function containsAll(c: JCollection): Boolean; cdecl;
function isEmpty: Boolean; cdecl;
function iterator: JIterator; cdecl;
function remove(o: JObject): Boolean; cdecl;
function removeAll(c: JCollection): Boolean; cdecl;
function retainAll(c: JCollection): Boolean; cdecl;
function size: Integer; cdecl;
function toArray: TJavaObjectArray<JObject>; cdecl; overload;
function toArray(a: TJavaObjectArray<JObject>): TJavaObjectArray<JObject>; cdecl; overload;
function toString: JString; cdecl;
end;
TJAbstractCollection = class(TJavaGenericImport<JAbstractCollectionClass, JAbstractCollection>) end;
JAbstractListClass = interface(JAbstractCollectionClass)
['{4495F751-BABA-4349-8D4B-997761ED3876}']
end;
[JavaSignature('java/util/AbstractList')]
JAbstractList = interface(JAbstractCollection)
['{2E98325B-7293-4E06-A775-240FDD287E27}']
function add(e: JObject): Boolean; cdecl; overload;
procedure add(index: Integer; element: JObject); cdecl; overload;
function addAll(index: Integer; c: JCollection): Boolean; cdecl;
procedure clear; cdecl;
function equals(o: JObject): Boolean; cdecl;
function &get(index: Integer): JObject; cdecl;
function hashCode: Integer; cdecl;
function indexOf(o: JObject): Integer; cdecl;
function iterator: JIterator; cdecl;
function lastIndexOf(o: JObject): Integer; cdecl;
function listIterator: JListIterator; cdecl; overload;
function listIterator(index: Integer): JListIterator; cdecl; overload;
function remove(index: Integer): JObject; cdecl;
function &set(index: Integer; element: JObject): JObject; cdecl;
function subList(fromIndex: Integer; toIndex: Integer): JList; cdecl;
end;
TJAbstractList = class(TJavaGenericImport<JAbstractListClass, JAbstractList>) end;
JAbstractMapClass = interface(JObjectClass)
['{05119E45-9501-4270-B2BB-EE7E314695CB}']
end;
[JavaSignature('java/util/AbstractMap')]
JAbstractMap = interface(JObject)
['{63FD2094-7BFB-41B4-AED8-F781B97F6EB6}']
procedure clear; cdecl;
function containsKey(key: JObject): Boolean; cdecl;
function containsValue(value: JObject): Boolean; cdecl;
function entrySet: JSet; cdecl;
function equals(o: JObject): Boolean; cdecl;
function &get(key: JObject): JObject; cdecl;
function hashCode: Integer; cdecl;
function isEmpty: Boolean; cdecl;
function keySet: JSet; cdecl;
function put(key: JObject; value: JObject): JObject; cdecl;
procedure putAll(m: JMap); cdecl;
function remove(key: JObject): JObject; cdecl;
function size: Integer; cdecl;
function toString: JString; cdecl;
function values: JCollection; cdecl;
end;
TJAbstractMap = class(TJavaGenericImport<JAbstractMapClass, JAbstractMap>) end;
JAbstractSetClass = interface(JAbstractCollectionClass)
['{C8EA147C-D0DB-4E27-B8B5-77A04711A2F3}']
end;
[JavaSignature('java/util/AbstractSet')]
JAbstractSet = interface(JAbstractCollection)
['{A520B68E-843E-46B8-BBB3-1A40DE9E92CE}']
function equals(o: JObject): Boolean; cdecl;
function hashCode: Integer; cdecl;
function removeAll(c: JCollection): Boolean; cdecl;
end;
TJAbstractSet = class(TJavaGenericImport<JAbstractSetClass, JAbstractSet>) end;
JArrayListClass = interface(JAbstractListClass)
['{0CC7FC88-8B13-4F0A-9635-26FEEED49F94}']
{class} function init(initialCapacity: Integer): JArrayList; cdecl; overload;
{class} function init: JArrayList; cdecl; overload;
{class} function init(c: JCollection): JArrayList; cdecl; overload;
end;
[JavaSignature('java/util/ArrayList')]
JArrayList = interface(JAbstractList)
['{B1D54E97-F848-4301-BA5B-F32921164AFA}']
function add(e: JObject): Boolean; cdecl; overload;
procedure add(index: Integer; element: JObject); cdecl; overload;
function addAll(c: JCollection): Boolean; cdecl; overload;
function addAll(index: Integer; c: JCollection): Boolean; cdecl; overload;
procedure clear; cdecl;
function clone: JObject; cdecl;
function &contains(o: JObject): Boolean; cdecl;
procedure ensureCapacity(minCapacity: Integer); cdecl;
procedure forEach(action: JConsumer); cdecl;
function &get(index: Integer): JObject; cdecl;
function indexOf(o: JObject): Integer; cdecl;
function isEmpty: Boolean; cdecl;
function iterator: JIterator; cdecl;
function lastIndexOf(o: JObject): Integer; cdecl;
function listIterator(index: Integer): JListIterator; cdecl; overload;
function listIterator: JListIterator; cdecl; overload;
function remove(index: Integer): JObject; cdecl; overload;
function remove(o: JObject): Boolean; cdecl; overload;
function removeAll(c: JCollection): Boolean; cdecl;
function removeIf(filter: Jfunction_Predicate): Boolean; cdecl;
procedure replaceAll(operator: JUnaryOperator); cdecl;
function retainAll(c: JCollection): Boolean; cdecl;
function &set(index: Integer; element: JObject): JObject; cdecl;
function size: Integer; cdecl;
procedure sort(c: JComparator); cdecl;
function spliterator: JSpliterator; cdecl;
function subList(fromIndex: Integer; toIndex: Integer): JList; cdecl;
function toArray: TJavaObjectArray<JObject>; cdecl; overload;
function toArray(a: TJavaObjectArray<JObject>): TJavaObjectArray<JObject>; cdecl; overload;
procedure trimToSize; cdecl;
end;
TJArrayList = class(TJavaGenericImport<JArrayListClass, JArrayList>) end;
JBitSetClass = interface(JObjectClass)
['{1CB74061-9B52-4CCA-AB29-D87B5EE10BCB}']
{class} function init: JBitSet; cdecl; overload;
{class} function init(nbits: Integer): JBitSet; cdecl; overload;
{class} function valueOf(longs: TJavaArray<Int64>): JBitSet; cdecl; overload;
{class} function valueOf(lb: JLongBuffer): JBitSet; cdecl; overload;
{class} function valueOf(bytes: TJavaArray<Byte>): JBitSet; cdecl; overload;
{class} function valueOf(bb: JByteBuffer): JBitSet; cdecl; overload;
end;
[JavaSignature('java/util/BitSet')]
JBitSet = interface(JObject)
['{2FBDF9C9-FEEE-4377-B2A2-D557CF0BEC31}']
procedure &and(set_: JBitSet); cdecl;
procedure andNot(set_: JBitSet); cdecl;
function cardinality: Integer; cdecl;
procedure clear(bitIndex: Integer); cdecl; overload;
procedure clear(fromIndex: Integer; toIndex: Integer); cdecl; overload;
procedure clear; cdecl; overload;
function clone: JObject; cdecl;
function equals(obj: JObject): Boolean; cdecl;
procedure flip(bitIndex: Integer); cdecl; overload;
procedure flip(fromIndex: Integer; toIndex: Integer); cdecl; overload;
function &get(bitIndex: Integer): Boolean; cdecl; overload;
function &get(fromIndex: Integer; toIndex: Integer): JBitSet; cdecl; overload;
function hashCode: Integer; cdecl;
function intersects(set_: JBitSet): Boolean; cdecl;
function isEmpty: Boolean; cdecl;
function length: Integer; cdecl;
function nextClearBit(fromIndex: Integer): Integer; cdecl;
function nextSetBit(fromIndex: Integer): Integer; cdecl;
procedure &or(set_: JBitSet); cdecl;
function previousClearBit(fromIndex: Integer): Integer; cdecl;
function previousSetBit(fromIndex: Integer): Integer; cdecl;
procedure &set(bitIndex: Integer); cdecl; overload;
procedure &set(bitIndex: Integer; value: Boolean); cdecl; overload;
procedure &set(fromIndex: Integer; toIndex: Integer); cdecl; overload;
procedure &set(fromIndex: Integer; toIndex: Integer; value: Boolean); cdecl; overload;
function size: Integer; cdecl;
function stream: JIntStream; cdecl;
function toByteArray: TJavaArray<Byte>; cdecl;
function toLongArray: TJavaArray<Int64>; cdecl;
function toString: JString; cdecl;
procedure &xor(set_: JBitSet); cdecl;
end;
TJBitSet = class(TJavaGenericImport<JBitSetClass, JBitSet>) end;
JCalendarClass = interface(JObjectClass)
['{51237FAA-7CDF-4E7E-9AE8-282DC2A930A1}']
{class} function _GetALL_STYLES: Integer; cdecl;
{class} function _GetAM: Integer; cdecl;
{class} function _GetAM_PM: Integer; cdecl;
{class} function _GetAPRIL: Integer; cdecl;
{class} function _GetAUGUST: Integer; cdecl;
{class} function _GetDATE: Integer; cdecl;
{class} function _GetDAY_OF_MONTH: Integer; cdecl;
{class} function _GetDAY_OF_WEEK: Integer; cdecl;
{class} function _GetDAY_OF_WEEK_IN_MONTH: Integer; cdecl;
{class} function _GetDAY_OF_YEAR: Integer; cdecl;
{class} function _GetDECEMBER: Integer; cdecl;
{class} function _GetDST_OFFSET: Integer; cdecl;
{class} function _GetERA: Integer; cdecl;
{class} function _GetFEBRUARY: Integer; cdecl;
{class} function _GetFIELD_COUNT: Integer; cdecl;
{class} function _GetFRIDAY: Integer; cdecl;
{class} function _GetHOUR: Integer; cdecl;
{class} function _GetHOUR_OF_DAY: Integer; cdecl;
{class} function _GetJANUARY: Integer; cdecl;
{class} function _GetJULY: Integer; cdecl;
{class} function _GetJUNE: Integer; cdecl;
{class} function _GetLONG: Integer; cdecl;
{class} function _GetLONG_FORMAT: Integer; cdecl;
{class} function _GetLONG_STANDALONE: Integer; cdecl;
{class} function _GetMARCH: Integer; cdecl;
{class} function _GetMAY: Integer; cdecl;
{class} function _GetMILLISECOND: Integer; cdecl;
{class} function _GetMINUTE: Integer; cdecl;
{class} function _GetMONDAY: Integer; cdecl;
{class} function _GetMONTH: Integer; cdecl;
{class} function _GetNARROW_FORMAT: Integer; cdecl;
{class} function _GetNARROW_STANDALONE: Integer; cdecl;
{class} function _GetNOVEMBER: Integer; cdecl;
{class} function _GetOCTOBER: Integer; cdecl;
{class} function _GetPM: Integer; cdecl;
{class} function _GetSATURDAY: Integer; cdecl;
{class} function _GetSECOND: Integer; cdecl;
{class} function _GetSEPTEMBER: Integer; cdecl;
{class} function _GetSHORT: Integer; cdecl;
{class} function _GetSHORT_FORMAT: Integer; cdecl;
{class} function _GetSHORT_STANDALONE: Integer; cdecl;
{class} function _GetSUNDAY: Integer; cdecl;
{class} function _GetTHURSDAY: Integer; cdecl;
{class} function _GetTUESDAY: Integer; cdecl;
{class} function _GetUNDECIMBER: Integer; cdecl;
{class} function _GetWEDNESDAY: Integer; cdecl;
{class} function _GetWEEK_OF_MONTH: Integer; cdecl;
{class} function _GetWEEK_OF_YEAR: Integer; cdecl;
{class} function _GetYEAR: Integer; cdecl;
{class} function _GetZONE_OFFSET: Integer; cdecl;
{class} function getAvailableCalendarTypes: JSet; cdecl;
{class} function getAvailableLocales: TJavaObjectArray<JLocale>; cdecl;
{class} function getInstance: JCalendar; cdecl; overload;
{class} function getInstance(zone: JTimeZone): JCalendar; cdecl; overload;
{class} function getInstance(aLocale: JLocale): JCalendar; cdecl; overload;
{class} function getInstance(zone: JTimeZone; aLocale: JLocale): JCalendar; cdecl; overload;
{class} property ALL_STYLES: Integer read _GetALL_STYLES;
{class} property AM: Integer read _GetAM;
{class} property AM_PM: Integer read _GetAM_PM;
{class} property APRIL: Integer read _GetAPRIL;
{class} property AUGUST: Integer read _GetAUGUST;
{class} property DATE: Integer read _GetDATE;
{class} property DAY_OF_MONTH: Integer read _GetDAY_OF_MONTH;
{class} property DAY_OF_WEEK: Integer read _GetDAY_OF_WEEK;
{class} property DAY_OF_WEEK_IN_MONTH: Integer read _GetDAY_OF_WEEK_IN_MONTH;
{class} property DAY_OF_YEAR: Integer read _GetDAY_OF_YEAR;
{class} property DECEMBER: Integer read _GetDECEMBER;
{class} property DST_OFFSET: Integer read _GetDST_OFFSET;
{class} property ERA: Integer read _GetERA;
{class} property FEBRUARY: Integer read _GetFEBRUARY;
{class} property FIELD_COUNT: Integer read _GetFIELD_COUNT;
{class} property FRIDAY: Integer read _GetFRIDAY;
{class} property HOUR: Integer read _GetHOUR;
{class} property HOUR_OF_DAY: Integer read _GetHOUR_OF_DAY;
{class} property JANUARY: Integer read _GetJANUARY;
{class} property JULY: Integer read _GetJULY;
{class} property JUNE: Integer read _GetJUNE;
{class} property LONG: Integer read _GetLONG;
{class} property LONG_FORMAT: Integer read _GetLONG_FORMAT;
{class} property LONG_STANDALONE: Integer read _GetLONG_STANDALONE;
{class} property MARCH: Integer read _GetMARCH;
{class} property MAY: Integer read _GetMAY;
{class} property MILLISECOND: Integer read _GetMILLISECOND;
{class} property MINUTE: Integer read _GetMINUTE;
{class} property MONDAY: Integer read _GetMONDAY;
{class} property MONTH: Integer read _GetMONTH;
{class} property NARROW_FORMAT: Integer read _GetNARROW_FORMAT;
{class} property NARROW_STANDALONE: Integer read _GetNARROW_STANDALONE;
{class} property NOVEMBER: Integer read _GetNOVEMBER;
{class} property OCTOBER: Integer read _GetOCTOBER;
{class} property PM: Integer read _GetPM;
{class} property SATURDAY: Integer read _GetSATURDAY;
{class} property SECOND: Integer read _GetSECOND;
{class} property SEPTEMBER: Integer read _GetSEPTEMBER;
{class} property SHORT: Integer read _GetSHORT;
{class} property SHORT_FORMAT: Integer read _GetSHORT_FORMAT;
{class} property SHORT_STANDALONE: Integer read _GetSHORT_STANDALONE;
{class} property SUNDAY: Integer read _GetSUNDAY;
{class} property THURSDAY: Integer read _GetTHURSDAY;
{class} property TUESDAY: Integer read _GetTUESDAY;
{class} property UNDECIMBER: Integer read _GetUNDECIMBER;
{class} property WEDNESDAY: Integer read _GetWEDNESDAY;
{class} property WEEK_OF_MONTH: Integer read _GetWEEK_OF_MONTH;
{class} property WEEK_OF_YEAR: Integer read _GetWEEK_OF_YEAR;
{class} property YEAR: Integer read _GetYEAR;
{class} property ZONE_OFFSET: Integer read _GetZONE_OFFSET;
end;
[JavaSignature('java/util/Calendar')]
JCalendar = interface(JObject)
['{2C0409E5-97A4-47CA-9E75-6ACB1CA4515E}']
procedure add(field: Integer; amount: Integer); cdecl;
function after(when: JObject): Boolean; cdecl;
function before(when: JObject): Boolean; cdecl;
procedure clear; cdecl; overload;
procedure clear(field: Integer); cdecl; overload;
function clone: JObject; cdecl;
function compareTo(anotherCalendar: JCalendar): Integer; cdecl;
function equals(obj: JObject): Boolean; cdecl;
function &get(field: Integer): Integer; cdecl;
function getActualMaximum(field: Integer): Integer; cdecl;
function getActualMinimum(field: Integer): Integer; cdecl;
function getCalendarType: JString; cdecl;
function getDisplayName(field: Integer; style: Integer; locale: JLocale): JString; cdecl;
function getDisplayNames(field: Integer; style: Integer; locale: JLocale): JMap; cdecl;
function getFirstDayOfWeek: Integer; cdecl;
function getGreatestMinimum(field: Integer): Integer; cdecl;
function getLeastMaximum(field: Integer): Integer; cdecl;
function getMaximum(field: Integer): Integer; cdecl;
function getMinimalDaysInFirstWeek: Integer; cdecl;
function getMinimum(field: Integer): Integer; cdecl;
function getTime: JDate; cdecl;
function getTimeInMillis: Int64; cdecl;
function getTimeZone: JTimeZone; cdecl;
function getWeekYear: Integer; cdecl;
function getWeeksInWeekYear: Integer; cdecl;
function hashCode: Integer; cdecl;
function isLenient: Boolean; cdecl;
function isSet(field: Integer): Boolean; cdecl;
function isWeekDateSupported: Boolean; cdecl;
procedure roll(field: Integer; up: Boolean); cdecl; overload;
procedure roll(field: Integer; amount: Integer); cdecl; overload;
procedure &set(field: Integer; value: Integer); cdecl; overload;
procedure &set(year: Integer; month: Integer; date: Integer); cdecl; overload;
procedure &set(year: Integer; month: Integer; date: Integer; hourOfDay: Integer; minute: Integer); cdecl; overload;
procedure &set(year: Integer; month: Integer; date: Integer; hourOfDay: Integer; minute: Integer; second: Integer); cdecl; overload;
procedure setFirstDayOfWeek(value: Integer); cdecl;
procedure setLenient(lenient: Boolean); cdecl;
procedure setMinimalDaysInFirstWeek(value: Integer); cdecl;
procedure setTime(date: JDate); cdecl;
procedure setTimeInMillis(millis: Int64); cdecl;
procedure setTimeZone(value: JTimeZone); cdecl;
procedure setWeekDate(weekYear: Integer; weekOfYear: Integer; dayOfWeek: Integer); cdecl;
function toInstant: JInstant; cdecl;
function toString: JString; cdecl;
end;
TJCalendar = class(TJavaGenericImport<JCalendarClass, JCalendar>) end;
JCollectionClass = interface(JIterableClass)
['{2737AA1B-2E7C-406D-AF35-8B012C7D5803}']
end;
[JavaSignature('java/util/Collection')]
JCollection = interface(JIterable)
['{9E58EE70-C0A7-4660-BF62-945FAE9F5EC3}']
function add(e: JObject): Boolean; cdecl;
function addAll(c: JCollection): Boolean; cdecl;
procedure clear; cdecl;
function &contains(o: JObject): Boolean; cdecl;
function containsAll(c: JCollection): Boolean; cdecl;
function equals(o: JObject): Boolean; cdecl;
function hashCode: Integer; cdecl;
function isEmpty: Boolean; cdecl;
function iterator: JIterator; cdecl;
function parallelStream: JStream; cdecl;
function remove(o: JObject): Boolean; cdecl;
function removeAll(c: JCollection): Boolean; cdecl;
function removeIf(filter: Jfunction_Predicate): Boolean; cdecl;
function retainAll(c: JCollection): Boolean; cdecl;
function size: Integer; cdecl;
function spliterator: JSpliterator; cdecl;
function stream: JStream; cdecl;
function toArray: TJavaObjectArray<JObject>; cdecl; overload;
function toArray(a: TJavaObjectArray<JObject>): TJavaObjectArray<JObject>; cdecl; overload;
end;
TJCollection = class(TJavaGenericImport<JCollectionClass, JCollection>) end;
JComparatorClass = interface(IJavaClass)
['{BFB6395F-2694-4292-A1B5-87CC1138FB77}']
{class} function comparing(keyExtractor: JFunction; keyComparator: JComparator): JComparator; cdecl; overload;
{class} function comparing(keyExtractor: JFunction): JComparator; cdecl; overload;
{class} function comparingDouble(keyExtractor: JToDoubleFunction): JComparator; cdecl;
{class} function comparingInt(keyExtractor: JToIntFunction): JComparator; cdecl;
{class} function comparingLong(keyExtractor: JToLongFunction): JComparator; cdecl;
{class} function naturalOrder: JComparator; cdecl;
{class} function nullsFirst(comparator: JComparator): JComparator; cdecl;
{class} function nullsLast(comparator: JComparator): JComparator; cdecl;
{class} function reverseOrder: JComparator; cdecl;
end;
[JavaSignature('java/util/Comparator')]
JComparator = interface(IJavaInstance)
['{0754C41C-92B8-483B-88F0-B48BFE216D46}']
function compare(o1: JObject; o2: JObject): Integer; cdecl;
function equals(obj: JObject): Boolean; cdecl;
function reversed: JComparator; cdecl;
function thenComparing(other: JComparator): JComparator; cdecl; overload;
function thenComparing(keyExtractor: JFunction; keyComparator: JComparator): JComparator; cdecl; overload;
function thenComparing(keyExtractor: JFunction): JComparator; cdecl; overload;
function thenComparingDouble(keyExtractor: JToDoubleFunction): JComparator; cdecl;
function thenComparingInt(keyExtractor: JToIntFunction): JComparator; cdecl;
function thenComparingLong(keyExtractor: JToLongFunction): JComparator; cdecl;
end;
TJComparator = class(TJavaGenericImport<JComparatorClass, JComparator>) end;
JDateClass = interface(JObjectClass)
['{37EABF6D-C7EE-4AB5-BE8B-5E439112E116}']
{class} function init: JDate; cdecl; overload;
{class} function init(date: Int64): JDate; cdecl; overload;
{class} function init(year: Integer; month: Integer; date: Integer): JDate; cdecl; overload;//Deprecated
{class} function init(year: Integer; month: Integer; date: Integer; hrs: Integer; min: Integer): JDate; cdecl; overload;//Deprecated
{class} function init(year: Integer; month: Integer; date: Integer; hrs: Integer; min: Integer; sec: Integer): JDate; cdecl; overload;//Deprecated
{class} function init(s: JString): JDate; cdecl; overload;//Deprecated
{class} function UTC(year: Integer; month: Integer; date: Integer; hrs: Integer; min: Integer; sec: Integer): Int64; cdecl;//Deprecated
{class} function from(instant: JInstant): JDate; cdecl;
{class} function parse(s: JString): Int64; cdecl;//Deprecated
end;
[JavaSignature('java/util/Date')]
JDate = interface(JObject)
['{282E2836-B390-44E4-A14F-EF481460BDF7}']
function after(when: JDate): Boolean; cdecl;
function before(when: JDate): Boolean; cdecl;
function clone: JObject; cdecl;
function compareTo(anotherDate: JDate): Integer; cdecl;
function equals(obj: JObject): Boolean; cdecl;
function getDate: Integer; cdecl;//Deprecated
function getDay: Integer; cdecl;//Deprecated
function getHours: Integer; cdecl;//Deprecated
function getMinutes: Integer; cdecl;//Deprecated
function getMonth: Integer; cdecl;//Deprecated
function getSeconds: Integer; cdecl;//Deprecated
function getTime: Int64; cdecl;
function getTimezoneOffset: Integer; cdecl;//Deprecated
function getYear: Integer; cdecl;//Deprecated
function hashCode: Integer; cdecl;
procedure setDate(date: Integer); cdecl;//Deprecated
procedure setHours(hours: Integer); cdecl;//Deprecated
procedure setMinutes(minutes: Integer); cdecl;//Deprecated
procedure setMonth(month: Integer); cdecl;//Deprecated
procedure setSeconds(seconds: Integer); cdecl;//Deprecated
procedure setTime(time: Int64); cdecl;
procedure setYear(year: Integer); cdecl;//Deprecated
function toGMTString: JString; cdecl;//Deprecated
function toInstant: JInstant; cdecl;
function toLocaleString: JString; cdecl;//Deprecated
function toString: JString; cdecl;
end;
TJDate = class(TJavaGenericImport<JDateClass, JDate>) end;
JDictionaryClass = interface(JObjectClass)
['{33D1971B-B4C5-4FA5-9DE3-BD76F2FCBD29}']
{class} function init: JDictionary; cdecl;
end;
[JavaSignature('java/util/Dictionary')]
JDictionary = interface(JObject)
['{C52483EE-5BB5-4F8A-B6ED-411F1920D533}']
function elements: JEnumeration; cdecl;
function &get(key: JObject): JObject; cdecl;
function isEmpty: Boolean; cdecl;
function keys: JEnumeration; cdecl;
function put(key: JObject; value: JObject): JObject; cdecl;
function remove(key: JObject): JObject; cdecl;
function size: Integer; cdecl;
end;
TJDictionary = class(TJavaGenericImport<JDictionaryClass, JDictionary>) end;
JDoubleSummaryStatisticsClass = interface(JObjectClass)
['{D394965A-D960-4CF9-BD61-8ED2DFB32779}']
{class} function init: JDoubleSummaryStatistics; cdecl;
end;
[JavaSignature('java/util/DoubleSummaryStatistics')]
JDoubleSummaryStatistics = interface(JObject)
['{794D0B68-C6D8-4D6B-9100-38CDD48C4D51}']
procedure accept(value: Double); cdecl;
procedure combine(other: JDoubleSummaryStatistics); cdecl;
function getAverage: Double; cdecl;
function getCount: Int64; cdecl;
function getMax: Double; cdecl;
function getMin: Double; cdecl;
function getSum: Double; cdecl;
function toString: JString; cdecl;
end;
TJDoubleSummaryStatistics = class(TJavaGenericImport<JDoubleSummaryStatisticsClass, JDoubleSummaryStatistics>) end;
JEnumSetClass = interface(JAbstractSetClass)
['{67EF0287-D91B-44E0-9574-4CA9974FBC38}']
{class} function allOf(elementType: Jlang_Class): JEnumSet; cdecl;
{class} function complementOf(s: JEnumSet): JEnumSet; cdecl;
{class} function copyOf(s: JEnumSet): JEnumSet; cdecl; overload;
{class} function copyOf(c: JCollection): JEnumSet; cdecl; overload;
{class} function noneOf(elementType: Jlang_Class): JEnumSet; cdecl;
{class} function &of(e: JEnum): JEnumSet; cdecl; overload;
{class} function &of(e1: JEnum; e2: JEnum): JEnumSet; cdecl; overload;
{class} function &of(e1: JEnum; e2: JEnum; e3: JEnum): JEnumSet; cdecl; overload;
{class} function &of(e1: JEnum; e2: JEnum; e3: JEnum; e4: JEnum): JEnumSet; cdecl; overload;
{class} function &of(e1: JEnum; e2: JEnum; e3: JEnum; e4: JEnum; e5: JEnum): JEnumSet; cdecl; overload;
{class} function range(from: JEnum; to_: JEnum): JEnumSet; cdecl;
end;
[JavaSignature('java/util/EnumSet')]
JEnumSet = interface(JAbstractSet)
['{C8A6B028-B797-406A-9EE4-B65671555D97}']
function clone: JEnumSet; cdecl;
end;
TJEnumSet = class(TJavaGenericImport<JEnumSetClass, JEnumSet>) end;
JEnumerationClass = interface(IJavaClass)
['{5E393BCD-3EF2-4764-A59C-37B4D44C289A}']
end;
[JavaSignature('java/util/Enumeration')]
JEnumeration = interface(IJavaInstance)
['{8F9F8780-E6BE-4B67-A4F5-8EC28E1AE2EE}']
function hasMoreElements: Boolean; cdecl;
function nextElement: JObject; cdecl;
end;
TJEnumeration = class(TJavaGenericImport<JEnumerationClass, JEnumeration>) end;
JGregorianCalendarClass = interface(JCalendarClass)
['{69F4EF00-93DA-4249-8A30-3A3E4A71DA03}']
{class} function _GetAD: Integer; cdecl;
{class} function _GetBC: Integer; cdecl;
{class} function init: JGregorianCalendar; cdecl; overload;
{class} function init(zone: JTimeZone): JGregorianCalendar; cdecl; overload;
{class} function init(aLocale: JLocale): JGregorianCalendar; cdecl; overload;
{class} function init(zone: JTimeZone; aLocale: JLocale): JGregorianCalendar; cdecl; overload;
{class} function init(year: Integer; month: Integer; dayOfMonth: Integer): JGregorianCalendar; cdecl; overload;
{class} function init(year: Integer; month: Integer; dayOfMonth: Integer; hourOfDay: Integer; minute: Integer): JGregorianCalendar; cdecl; overload;
{class} function init(year: Integer; month: Integer; dayOfMonth: Integer; hourOfDay: Integer; minute: Integer; second: Integer): JGregorianCalendar; cdecl; overload;
{class} function from(zdt: JZonedDateTime): JGregorianCalendar; cdecl;
{class} property AD: Integer read _GetAD;
{class} property BC: Integer read _GetBC;
end;
[JavaSignature('java/util/GregorianCalendar')]
JGregorianCalendar = interface(JCalendar)
['{CB851885-16EA-49E7-8AAF-DBFE900DA328}']
procedure add(field: Integer; amount: Integer); cdecl;
function clone: JObject; cdecl;
function equals(obj: JObject): Boolean; cdecl;
function getActualMaximum(field: Integer): Integer; cdecl;
function getActualMinimum(field: Integer): Integer; cdecl;
function getCalendarType: JString; cdecl;
function getGreatestMinimum(field: Integer): Integer; cdecl;
function getGregorianChange: JDate; cdecl;
function getLeastMaximum(field: Integer): Integer; cdecl;
function getMaximum(field: Integer): Integer; cdecl;
function getMinimum(field: Integer): Integer; cdecl;
function getTimeZone: JTimeZone; cdecl;
function getWeekYear: Integer; cdecl;
function getWeeksInWeekYear: Integer; cdecl;
function hashCode: Integer; cdecl;
function isLeapYear(year: Integer): Boolean; cdecl;
function isWeekDateSupported: Boolean; cdecl;
procedure roll(field: Integer; up: Boolean); cdecl; overload;
procedure roll(field: Integer; amount: Integer); cdecl; overload;
procedure setGregorianChange(date: JDate); cdecl;
procedure setTimeZone(zone: JTimeZone); cdecl;
procedure setWeekDate(weekYear: Integer; weekOfYear: Integer; dayOfWeek: Integer); cdecl;
function toZonedDateTime: JZonedDateTime; cdecl;
end;
TJGregorianCalendar = class(TJavaGenericImport<JGregorianCalendarClass, JGregorianCalendar>) end;
JHashMapClass = interface(JAbstractMapClass)
['{AC953BC1-405B-4CDD-93D2-FBA77D171B56}']
{class} function init(initialCapacity: Integer; loadFactor: Single): JHashMap; cdecl; overload;
{class} function init(initialCapacity: Integer): JHashMap; cdecl; overload;
{class} function init: JHashMap; cdecl; overload;
{class} function init(m: JMap): JHashMap; cdecl; overload;
end;
[JavaSignature('java/util/HashMap')]
JHashMap = interface(JAbstractMap)
['{FD560211-A7FE-4AB5-B510-BB43A31AA75D}']
procedure clear; cdecl;
function clone: JObject; cdecl;
function compute(key: JObject; remappingFunction: JBiFunction): JObject; cdecl;
function computeIfAbsent(key: JObject; mappingFunction: JFunction): JObject; cdecl;
function computeIfPresent(key: JObject; remappingFunction: JBiFunction): JObject; cdecl;
function containsKey(key: JObject): Boolean; cdecl;
function containsValue(value: JObject): Boolean; cdecl;
function entrySet: JSet; cdecl;
procedure forEach(action: JBiConsumer); cdecl;
function &get(key: JObject): JObject; cdecl;
function getOrDefault(key: JObject; defaultValue: JObject): JObject; cdecl;
function isEmpty: Boolean; cdecl;
function keySet: JSet; cdecl;
function merge(key: JObject; value: JObject; remappingFunction: JBiFunction): JObject; cdecl;
function put(key: JObject; value: JObject): JObject; cdecl;
procedure putAll(m: JMap); cdecl;
function putIfAbsent(key: JObject; value: JObject): JObject; cdecl;
function remove(key: JObject): JObject; cdecl; overload;
function remove(key: JObject; value: JObject): Boolean; cdecl; overload;
function replace(key: JObject; oldValue: JObject; newValue: JObject): Boolean; cdecl; overload;
function replace(key: JObject; value: JObject): JObject; cdecl; overload;
procedure replaceAll(function_: JBiFunction); cdecl;
function size: Integer; cdecl;
function values: JCollection; cdecl;
end;
TJHashMap = class(TJavaGenericImport<JHashMapClass, JHashMap>) end;
JHashSetClass = interface(JAbstractSetClass)
['{7828E4D4-4F9F-493D-869E-92BE600444D5}']
{class} function init: JHashSet; cdecl; overload;
{class} function init(c: JCollection): JHashSet; cdecl; overload;
{class} function init(initialCapacity: Integer; loadFactor: Single): JHashSet; cdecl; overload;
{class} function init(initialCapacity: Integer): JHashSet; cdecl; overload;
end;
[JavaSignature('java/util/HashSet')]
JHashSet = interface(JAbstractSet)
['{A57B696D-8331-4C96-8759-7F2009371640}']
function add(e: JObject): Boolean; cdecl;
procedure clear; cdecl;
function clone: JObject; cdecl;
function &contains(o: JObject): Boolean; cdecl;
function isEmpty: Boolean; cdecl;
function iterator: JIterator; cdecl;
function remove(o: JObject): Boolean; cdecl;
function size: Integer; cdecl;
function spliterator: JSpliterator; cdecl;
end;
TJHashSet = class(TJavaGenericImport<JHashSetClass, JHashSet>) end;
JHashtableClass = interface(JDictionaryClass)
['{0459EE5F-44DF-406D-B0F4-6D2F19D2222F}']
{class} function init(initialCapacity: Integer; loadFactor: Single): JHashtable; cdecl; overload;
{class} function init(initialCapacity: Integer): JHashtable; cdecl; overload;
{class} function init: JHashtable; cdecl; overload;
{class} function init(t: JMap): JHashtable; cdecl; overload;
end;
[JavaSignature('java/util/Hashtable')]
JHashtable = interface(JDictionary)
['{7A995299-3381-4179-A8A2-21C4F0E2E755}']
procedure clear; cdecl;
function clone: JObject; cdecl;
function compute(key: JObject; remappingFunction: JBiFunction): JObject; cdecl;
function computeIfAbsent(key: JObject; mappingFunction: JFunction): JObject; cdecl;
function computeIfPresent(key: JObject; remappingFunction: JBiFunction): JObject; cdecl;
function &contains(value: JObject): Boolean; cdecl;
function containsKey(key: JObject): Boolean; cdecl;
function containsValue(value: JObject): Boolean; cdecl;
function elements: JEnumeration; cdecl;
function entrySet: JSet; cdecl;
function equals(o: JObject): Boolean; cdecl;
procedure forEach(action: JBiConsumer); cdecl;
function &get(key: JObject): JObject; cdecl;
function getOrDefault(key: JObject; defaultValue: JObject): JObject; cdecl;
function hashCode: Integer; cdecl;
function isEmpty: Boolean; cdecl;
function keySet: JSet; cdecl;
function keys: JEnumeration; cdecl;
function merge(key: JObject; value: JObject; remappingFunction: JBiFunction): JObject; cdecl;
function put(key: JObject; value: JObject): JObject; cdecl;
procedure putAll(t: JMap); cdecl;
function putIfAbsent(key: JObject; value: JObject): JObject; cdecl;
function remove(key: JObject): JObject; cdecl; overload;
function remove(key: JObject; value: JObject): Boolean; cdecl; overload;
function replace(key: JObject; oldValue: JObject; newValue: JObject): Boolean; cdecl; overload;
function replace(key: JObject; value: JObject): JObject; cdecl; overload;
procedure replaceAll(function_: JBiFunction); cdecl;
function size: Integer; cdecl;
function toString: JString; cdecl;
function values: JCollection; cdecl;
end;
TJHashtable = class(TJavaGenericImport<JHashtableClass, JHashtable>) end;
JIntSummaryStatisticsClass = interface(JObjectClass)
['{BC378E37-ED74-4F4D-9404-87C2CE119186}']
{class} function init: JIntSummaryStatistics; cdecl;
end;
[JavaSignature('java/util/IntSummaryStatistics')]
JIntSummaryStatistics = interface(JObject)
['{95B2958E-3780-42D0-A774-74DDCADAAD52}']
procedure accept(value: Integer); cdecl;
procedure combine(other: JIntSummaryStatistics); cdecl;
function getAverage: Double; cdecl;
function getCount: Int64; cdecl;
function getMax: Integer; cdecl;
function getMin: Integer; cdecl;
function getSum: Int64; cdecl;
function toString: JString; cdecl;
end;
TJIntSummaryStatistics = class(TJavaGenericImport<JIntSummaryStatisticsClass, JIntSummaryStatistics>) end;
JIteratorClass = interface(IJavaClass)
['{2E525F5D-C766-4F79-B800-BA5FFA909E90}']
end;
[JavaSignature('java/util/Iterator')]
JIterator = interface(IJavaInstance)
['{435EBC1F-CFE0-437C-B49B-45B5257B6953}']
procedure forEachRemaining(action: JConsumer); cdecl;
function hasNext: Boolean; cdecl;
function next: JObject; cdecl;
procedure remove; cdecl;
end;
TJIterator = class(TJavaGenericImport<JIteratorClass, JIterator>) end;
JListClass = interface(JCollectionClass)
['{8EA06296-143F-4381-9369-A77209B622F0}']
end;
[JavaSignature('java/util/List')]
JList = interface(JCollection)
['{3F85C565-F3F4-42D8-87EE-F724F72113C7}']
function add(e: JObject): Boolean; cdecl; overload;
procedure add(index: Integer; element: JObject); cdecl; overload;
function addAll(c: JCollection): Boolean; cdecl; overload;
function addAll(index: Integer; c: JCollection): Boolean; cdecl; overload;
procedure clear; cdecl;
function &contains(o: JObject): Boolean; cdecl;
function containsAll(c: JCollection): Boolean; cdecl;
function equals(o: JObject): Boolean; cdecl;
function &get(index: Integer): JObject; cdecl;
function hashCode: Integer; cdecl;
function indexOf(o: JObject): Integer; cdecl;
function isEmpty: Boolean; cdecl;
function iterator: JIterator; cdecl;
function lastIndexOf(o: JObject): Integer; cdecl;
function listIterator: JListIterator; cdecl; overload;
function listIterator(index: Integer): JListIterator; cdecl; overload;
function remove(o: JObject): Boolean; cdecl; overload;
function remove(index: Integer): JObject; cdecl; overload;
function removeAll(c: JCollection): Boolean; cdecl;
procedure replaceAll(operator: JUnaryOperator); cdecl;
function retainAll(c: JCollection): Boolean; cdecl;
function &set(index: Integer; element: JObject): JObject; cdecl;
function size: Integer; cdecl;
procedure sort(c: JComparator); cdecl;
function spliterator: JSpliterator; cdecl;
function subList(fromIndex: Integer; toIndex: Integer): JList; cdecl;
function toArray: TJavaObjectArray<JObject>; cdecl; overload;
function toArray(a: TJavaObjectArray<JObject>): TJavaObjectArray<JObject>; cdecl; overload;
end;
TJList = class(TJavaGenericImport<JListClass, JList>) end;
JListIteratorClass = interface(JIteratorClass)
['{7541F5DD-8E71-44AE-ACD9-142ED2D42810}']
end;
[JavaSignature('java/util/ListIterator')]
JListIterator = interface(JIterator)
['{B66BDA33-5CDD-43B1-B320-7353AE09C418}']
procedure add(e: JObject); cdecl;
function hasNext: Boolean; cdecl;
function hasPrevious: Boolean; cdecl;
function next: JObject; cdecl;
function nextIndex: Integer; cdecl;
function previous: JObject; cdecl;
function previousIndex: Integer; cdecl;
procedure remove; cdecl;
procedure &set(e: JObject); cdecl;
end;
TJListIterator = class(TJavaGenericImport<JListIteratorClass, JListIterator>) end;
JLocaleClass = interface(JObjectClass)
['{0A5D70AA-C01B-437F-97C8-FEE25C595AE7}']
{class} function _GetCANADA: JLocale; cdecl;
{class} function _GetCANADA_FRENCH: JLocale; cdecl;
{class} function _GetCHINA: JLocale; cdecl;
{class} function _GetCHINESE: JLocale; cdecl;
{class} function _GetENGLISH: JLocale; cdecl;
{class} function _GetFRANCE: JLocale; cdecl;
{class} function _GetFRENCH: JLocale; cdecl;
{class} function _GetGERMAN: JLocale; cdecl;
{class} function _GetGERMANY: JLocale; cdecl;
{class} function _GetITALIAN: JLocale; cdecl;
{class} function _GetITALY: JLocale; cdecl;
{class} function _GetJAPAN: JLocale; cdecl;
{class} function _GetJAPANESE: JLocale; cdecl;
{class} function _GetKOREA: JLocale; cdecl;
{class} function _GetKOREAN: JLocale; cdecl;
{class} function _GetPRC: JLocale; cdecl;
{class} function _GetPRIVATE_USE_EXTENSION: Char; cdecl;
{class} function _GetROOT: JLocale; cdecl;
{class} function _GetSIMPLIFIED_CHINESE: JLocale; cdecl;
{class} function _GetTAIWAN: JLocale; cdecl;
{class} function _GetTRADITIONAL_CHINESE: JLocale; cdecl;
{class} function _GetUK: JLocale; cdecl;
{class} function _GetUNICODE_LOCALE_EXTENSION: Char; cdecl;
{class} function _GetUS: JLocale; cdecl;
{class} function init(language: JString; country: JString; variant: JString): JLocale; cdecl; overload;
{class} function init(language: JString; country: JString): JLocale; cdecl; overload;
{class} function init(language: JString): JLocale; cdecl; overload;
{class} function filter(priorityList: JList; locales: JCollection; mode: JLocale_FilteringMode): JList; cdecl; overload;
{class} function filter(priorityList: JList; locales: JCollection): JList; cdecl; overload;
{class} function filterTags(priorityList: JList; tags: JCollection; mode: JLocale_FilteringMode): JList; cdecl; overload;
{class} function filterTags(priorityList: JList; tags: JCollection): JList; cdecl; overload;
{class} function forLanguageTag(languageTag: JString): JLocale; cdecl;
{class} function getAvailableLocales: TJavaObjectArray<JLocale>; cdecl;
{class} function getDefault: JLocale; cdecl; overload;
{class} function getDefault(category: JLocale_Category): JLocale; cdecl; overload;
{class} function getISOCountries: TJavaObjectArray<JString>; cdecl;
{class} function getISOLanguages: TJavaObjectArray<JString>; cdecl;
{class} function lookup(priorityList: JList; locales: JCollection): JLocale; cdecl;
{class} function lookupTag(priorityList: JList; tags: JCollection): JString; cdecl;
{class} procedure setDefault(newLocale: JLocale); cdecl; overload;
{class} procedure setDefault(category: JLocale_Category; newLocale: JLocale); cdecl; overload;
{class} property CANADA: JLocale read _GetCANADA;
{class} property CANADA_FRENCH: JLocale read _GetCANADA_FRENCH;
{class} property CHINA: JLocale read _GetCHINA;
{class} property CHINESE: JLocale read _GetCHINESE;
{class} property ENGLISH: JLocale read _GetENGLISH;
{class} property FRANCE: JLocale read _GetFRANCE;
{class} property FRENCH: JLocale read _GetFRENCH;
{class} property GERMAN: JLocale read _GetGERMAN;
{class} property GERMANY: JLocale read _GetGERMANY;
{class} property ITALIAN: JLocale read _GetITALIAN;
{class} property ITALY: JLocale read _GetITALY;
{class} property JAPAN: JLocale read _GetJAPAN;
{class} property JAPANESE: JLocale read _GetJAPANESE;
{class} property KOREA: JLocale read _GetKOREA;
{class} property KOREAN: JLocale read _GetKOREAN;
{class} property PRC: JLocale read _GetPRC;
{class} property PRIVATE_USE_EXTENSION: Char read _GetPRIVATE_USE_EXTENSION;
{class} property ROOT: JLocale read _GetROOT;
{class} property SIMPLIFIED_CHINESE: JLocale read _GetSIMPLIFIED_CHINESE;
{class} property TAIWAN: JLocale read _GetTAIWAN;
{class} property TRADITIONAL_CHINESE: JLocale read _GetTRADITIONAL_CHINESE;
{class} property UK: JLocale read _GetUK;
{class} property UNICODE_LOCALE_EXTENSION: Char read _GetUNICODE_LOCALE_EXTENSION;
{class} property US: JLocale read _GetUS;
end;
[JavaSignature('java/util/Locale')]
JLocale = interface(JObject)
['{877ADE25-1D13-4963-9A17-17EE17B3A0A8}']
function clone: JObject; cdecl;
function equals(obj: JObject): Boolean; cdecl;
function getCountry: JString; cdecl;
function getDisplayCountry: JString; cdecl; overload;
function getDisplayCountry(locale: JLocale): JString; cdecl; overload;
function getDisplayLanguage: JString; cdecl; overload;
function getDisplayLanguage(locale: JLocale): JString; cdecl; overload;
function getDisplayName: JString; cdecl; overload;
function getDisplayName(locale: JLocale): JString; cdecl; overload;
function getDisplayScript: JString; cdecl; overload;
function getDisplayScript(inLocale: JLocale): JString; cdecl; overload;
function getDisplayVariant: JString; cdecl; overload;
function getDisplayVariant(inLocale: JLocale): JString; cdecl; overload;
function getExtension(key: Char): JString; cdecl;
function getExtensionKeys: JSet; cdecl;
function getISO3Country: JString; cdecl;
function getISO3Language: JString; cdecl;
function getLanguage: JString; cdecl;
function getScript: JString; cdecl;
function getUnicodeLocaleAttributes: JSet; cdecl;
function getUnicodeLocaleKeys: JSet; cdecl;
function getUnicodeLocaleType(key: JString): JString; cdecl;
function getVariant: JString; cdecl;
function hasExtensions: Boolean; cdecl;
function hashCode: Integer; cdecl;
function stripExtensions: JLocale; cdecl;
function toLanguageTag: JString; cdecl;
function toString: JString; cdecl;
end;
TJLocale = class(TJavaGenericImport<JLocaleClass, JLocale>) end;
JLocale_CategoryClass = interface(JEnumClass)
['{85F52362-9FE6-4A13-B7FB-C064880E706F}']
{class} function _GetDISPLAY: JLocale_Category; cdecl;
{class} function _GetFORMAT: JLocale_Category; cdecl;
{class} function valueOf(name: JString): JLocale_Category; cdecl;
{class} function values: TJavaObjectArray<JLocale_Category>; cdecl;
{class} property DISPLAY: JLocale_Category read _GetDISPLAY;
{class} property FORMAT: JLocale_Category read _GetFORMAT;
end;
[JavaSignature('java/util/Locale$Category')]
JLocale_Category = interface(JEnum)
['{D145E7AF-375A-4B4A-BB9F-AA75D2AA48F7}']
end;
TJLocale_Category = class(TJavaGenericImport<JLocale_CategoryClass, JLocale_Category>) end;
JLocale_FilteringModeClass = interface(JEnumClass)
['{198E288B-B730-4DE6-A526-59D9690C98E8}']
{class} function _GetAUTOSELECT_FILTERING: JLocale_FilteringMode; cdecl;
{class} function _GetEXTENDED_FILTERING: JLocale_FilteringMode; cdecl;
{class} function _GetIGNORE_EXTENDED_RANGES: JLocale_FilteringMode; cdecl;
{class} function _GetMAP_EXTENDED_RANGES: JLocale_FilteringMode; cdecl;
{class} function _GetREJECT_EXTENDED_RANGES: JLocale_FilteringMode; cdecl;
{class} function valueOf(name: JString): JLocale_FilteringMode; cdecl;
{class} function values: TJavaObjectArray<JLocale_FilteringMode>; cdecl;
{class} property AUTOSELECT_FILTERING: JLocale_FilteringMode read _GetAUTOSELECT_FILTERING;
{class} property EXTENDED_FILTERING: JLocale_FilteringMode read _GetEXTENDED_FILTERING;
{class} property IGNORE_EXTENDED_RANGES: JLocale_FilteringMode read _GetIGNORE_EXTENDED_RANGES;
{class} property MAP_EXTENDED_RANGES: JLocale_FilteringMode read _GetMAP_EXTENDED_RANGES;
{class} property REJECT_EXTENDED_RANGES: JLocale_FilteringMode read _GetREJECT_EXTENDED_RANGES;
end;
[JavaSignature('java/util/Locale$FilteringMode')]
JLocale_FilteringMode = interface(JEnum)
['{C68D206C-7B4B-4650-9576-7982463DDA5E}']
end;
TJLocale_FilteringMode = class(TJavaGenericImport<JLocale_FilteringModeClass, JLocale_FilteringMode>) end;
JLongSummaryStatisticsClass = interface(JObjectClass)
['{B546F8AF-ED71-4298-9215-9F644B2E0DB7}']
{class} function init: JLongSummaryStatistics; cdecl;
end;
[JavaSignature('java/util/LongSummaryStatistics')]
JLongSummaryStatistics = interface(JObject)
['{0523DA5A-E6D8-4CD0-87CE-BB1E9BF9D095}']
procedure accept(value: Integer); cdecl; overload;
procedure accept(value: Int64); cdecl; overload;
procedure combine(other: JLongSummaryStatistics); cdecl;
function getAverage: Double; cdecl;
function getCount: Int64; cdecl;
function getMax: Int64; cdecl;
function getMin: Int64; cdecl;
function getSum: Int64; cdecl;
function toString: JString; cdecl;
end;
TJLongSummaryStatistics = class(TJavaGenericImport<JLongSummaryStatisticsClass, JLongSummaryStatistics>) end;
JMapClass = interface(IJavaClass)
['{2A7CE403-063B-45CA-9F4D-EA1E64304F1C}']
end;
[JavaSignature('java/util/Map')]
JMap = interface(IJavaInstance)
['{BE6A5DBF-B121-4BF2-BC18-EB64729C7811}']
procedure clear; cdecl;
function compute(key: JObject; remappingFunction: JBiFunction): JObject; cdecl;
function computeIfAbsent(key: JObject; mappingFunction: JFunction): JObject; cdecl;
function computeIfPresent(key: JObject; remappingFunction: JBiFunction): JObject; cdecl;
function containsKey(key: JObject): Boolean; cdecl;
function containsValue(value: JObject): Boolean; cdecl;
function entrySet: JSet; cdecl;
function equals(o: JObject): Boolean; cdecl;
procedure forEach(action: JBiConsumer); cdecl;
function &get(key: JObject): JObject; cdecl;
function getOrDefault(key: JObject; defaultValue: JObject): JObject; cdecl;
function hashCode: Integer; cdecl;
function isEmpty: Boolean; cdecl;
function keySet: JSet; cdecl;
function merge(key: JObject; value: JObject; remappingFunction: JBiFunction): JObject; cdecl;
function put(key: JObject; value: JObject): JObject; cdecl;
procedure putAll(m: JMap); cdecl;
function putIfAbsent(key: JObject; value: JObject): JObject; cdecl;
function remove(key: JObject): JObject; cdecl; overload;
function remove(key: JObject; value: JObject): Boolean; cdecl; overload;
function replace(key: JObject; oldValue: JObject; newValue: JObject): Boolean; cdecl; overload;
function replace(key: JObject; value: JObject): JObject; cdecl; overload;
procedure replaceAll(function_: JBiFunction); cdecl;
function size: Integer; cdecl;
function values: JCollection; cdecl;
end;
TJMap = class(TJavaGenericImport<JMapClass, JMap>) end;
Jutil_ObservableClass = interface(JObjectClass)
['{2BD8C696-02FF-4378-A514-ACD431BEE106}']
{class} function init: Jutil_Observable; cdecl;
end;
[JavaSignature('java/util/Observable')]
Jutil_Observable = interface(JObject)
['{B8443F0E-B41C-4475-934B-1C917FCF617B}']
procedure addObserver(o: JObserver); cdecl;
function countObservers: Integer; cdecl;
procedure deleteObserver(o: JObserver); cdecl;
procedure deleteObservers; cdecl;
function hasChanged: Boolean; cdecl;
procedure notifyObservers; cdecl; overload;
procedure notifyObservers(arg: JObject); cdecl; overload;
end;
TJutil_Observable = class(TJavaGenericImport<Jutil_ObservableClass, Jutil_Observable>) end;
JObserverClass = interface(IJavaClass)
['{8582EA20-ECD9-4C10-95BD-2C89B4D5BA6E}']
end;
[JavaSignature('java/util/Observer')]
JObserver = interface(IJavaInstance)
['{452A1BDA-4B4E-406E-B455-BC56F012C1B7}']
procedure update(o: Jutil_Observable; arg: JObject); cdecl;
end;
TJObserver = class(TJavaGenericImport<JObserverClass, JObserver>) end;
JOptionalClass = interface(JObjectClass)
['{CB83B39E-6950-4052-8751-AEBCEBAF47D7}']
{class} function empty: JOptional; cdecl;
{class} function &of(value: JObject): JOptional; cdecl;
{class} function ofNullable(value: JObject): JOptional; cdecl;
end;
[JavaSignature('java/util/Optional')]
JOptional = interface(JObject)
['{A10DD170-3D2E-4578-A5EB-A2E9E9A49A08}']
function equals(obj: JObject): Boolean; cdecl;
function filter(predicate: Jfunction_Predicate): JOptional; cdecl;
function flatMap(mapper: JFunction): JOptional; cdecl;
function &get: JObject; cdecl;
function hashCode: Integer; cdecl;
procedure ifPresent(consumer: JConsumer); cdecl;
function isPresent: Boolean; cdecl;
function map(mapper: JFunction): JOptional; cdecl;
function orElse(other: JObject): JObject; cdecl;
function orElseGet(other: JSupplier): JObject; cdecl;
function orElseThrow(exceptionSupplier: JSupplier): JObject; cdecl;
function toString: JString; cdecl;
end;
TJOptional = class(TJavaGenericImport<JOptionalClass, JOptional>) end;
JOptionalDoubleClass = interface(JObjectClass)
['{82CA5874-6B1C-4986-9856-3188D1D597C5}']
{class} function empty: JOptionalDouble; cdecl;
{class} function &of(value: Double): JOptionalDouble; cdecl;
end;
[JavaSignature('java/util/OptionalDouble')]
JOptionalDouble = interface(JObject)
['{55E6B249-D464-45A3-A0FA-909DD19C5088}']
function equals(obj: JObject): Boolean; cdecl;
function getAsDouble: Double; cdecl;
function hashCode: Integer; cdecl;
procedure ifPresent(consumer: JDoubleConsumer); cdecl;
function isPresent: Boolean; cdecl;
function orElse(other: Double): Double; cdecl;
function orElseGet(other: JDoubleSupplier): Double; cdecl;
function orElseThrow(exceptionSupplier: JSupplier): Double; cdecl;
function toString: JString; cdecl;
end;
TJOptionalDouble = class(TJavaGenericImport<JOptionalDoubleClass, JOptionalDouble>) end;
JOptionalIntClass = interface(JObjectClass)
['{3FCAC9CD-4A4A-49F7-A63C-F2400D2868CD}']
{class} function empty: JOptionalInt; cdecl;
{class} function &of(value: Integer): JOptionalInt; cdecl;
end;
[JavaSignature('java/util/OptionalInt')]
JOptionalInt = interface(JObject)
['{E662855E-5EC0-4B0E-BB21-698174A66B2F}']
function equals(obj: JObject): Boolean; cdecl;
function getAsInt: Integer; cdecl;
function hashCode: Integer; cdecl;
procedure ifPresent(consumer: JIntConsumer); cdecl;
function isPresent: Boolean; cdecl;
function orElse(other: Integer): Integer; cdecl;
function orElseGet(other: JIntSupplier): Integer; cdecl;
function orElseThrow(exceptionSupplier: JSupplier): Integer; cdecl;
function toString: JString; cdecl;
end;
TJOptionalInt = class(TJavaGenericImport<JOptionalIntClass, JOptionalInt>) end;
JOptionalLongClass = interface(JObjectClass)
['{23DDE21A-3436-4EA5-96F5-EAED9342B5F4}']
{class} function empty: JOptionalLong; cdecl;
{class} function &of(value: Int64): JOptionalLong; cdecl;
end;
[JavaSignature('java/util/OptionalLong')]
JOptionalLong = interface(JObject)
['{AF301C15-0637-4995-88C9-95F570D7F169}']
function equals(obj: JObject): Boolean; cdecl;
function getAsLong: Int64; cdecl;
function hashCode: Integer; cdecl;
procedure ifPresent(consumer: JLongConsumer); cdecl;
function isPresent: Boolean; cdecl;
function orElse(other: Int64): Int64; cdecl;
function orElseGet(other: JLongSupplier): Int64; cdecl;
function orElseThrow(exceptionSupplier: JSupplier): Int64; cdecl;
function toString: JString; cdecl;
end;
TJOptionalLong = class(TJavaGenericImport<JOptionalLongClass, JOptionalLong>) end;
JPrimitiveIteratorClass = interface(JIteratorClass)
['{A1CA462F-125B-4D2E-8EFA-105CEBFC81FC}']
end;
[JavaSignature('java/util/PrimitiveIterator')]
JPrimitiveIterator = interface(JIterator)
['{0D766E2A-31E3-45AA-9E47-50BF0C81188C}']
procedure forEachRemaining(action: JObject); cdecl;
end;
TJPrimitiveIterator = class(TJavaGenericImport<JPrimitiveIteratorClass, JPrimitiveIterator>) end;
JPrimitiveIterator_OfDoubleClass = interface(JPrimitiveIteratorClass)
['{BD1EC9AD-DE6E-4D79-B1EA-CF416E8E0054}']
end;
[JavaSignature('java/util/PrimitiveIterator$OfDouble')]
JPrimitiveIterator_OfDouble = interface(JPrimitiveIterator)
['{1CEEAA3A-8016-402A-8D73-6EBFC68F6F22}']
procedure forEachRemaining(action: JDoubleConsumer); cdecl; overload;
procedure forEachRemaining(action: JConsumer); cdecl; overload;
function next: JDouble; cdecl;
function nextDouble: Double; cdecl;
end;
TJPrimitiveIterator_OfDouble = class(TJavaGenericImport<JPrimitiveIterator_OfDoubleClass, JPrimitiveIterator_OfDouble>) end;
JPrimitiveIterator_OfIntClass = interface(JPrimitiveIteratorClass)
['{F9D2404C-1307-4EB8-AF9F-9704C7CDE9A4}']
end;
[JavaSignature('java/util/PrimitiveIterator$OfInt')]
JPrimitiveIterator_OfInt = interface(JPrimitiveIterator)
['{99F12F35-8B6C-45DA-B36D-0B5138CDEC04}']
procedure forEachRemaining(action: JIntConsumer); cdecl; overload;
procedure forEachRemaining(action: JConsumer); cdecl; overload;
function next: JInteger; cdecl;
function nextInt: Integer; cdecl;
end;
TJPrimitiveIterator_OfInt = class(TJavaGenericImport<JPrimitiveIterator_OfIntClass, JPrimitiveIterator_OfInt>) end;
JPrimitiveIterator_OfLongClass = interface(JPrimitiveIteratorClass)
['{49090089-F968-427F-8CC9-B07B3BB832CB}']
end;
[JavaSignature('java/util/PrimitiveIterator$OfLong')]
JPrimitiveIterator_OfLong = interface(JPrimitiveIterator)
['{15363668-D34E-4CA8-B3B9-4E5886B0C116}']
procedure forEachRemaining(action: JLongConsumer); cdecl; overload;
procedure forEachRemaining(action: JConsumer); cdecl; overload;
function next: JLong; cdecl;
function nextLong: Int64; cdecl;
end;
TJPrimitiveIterator_OfLong = class(TJavaGenericImport<JPrimitiveIterator_OfLongClass, JPrimitiveIterator_OfLong>) end;
JPropertiesClass = interface(JHashtableClass)
['{CA354A9C-C42E-41BD-B104-6058143813A5}']
{class} function init: JProperties; cdecl; overload;
{class} function init(defaults: JProperties): JProperties; cdecl; overload;
end;
[JavaSignature('java/util/Properties')]
JProperties = interface(JHashtable)
['{5F7AA87B-4EF0-4D76-923C-D7586F38760F}']
function getProperty(key: JString): JString; cdecl; overload;
function getProperty(key: JString; defaultValue: JString): JString; cdecl; overload;
procedure list(out_: JPrintStream); cdecl; overload;
procedure list(out_: JPrintWriter); cdecl; overload;
procedure load(reader: JReader); cdecl; overload;
procedure load(inStream: JInputStream); cdecl; overload;
procedure loadFromXML(in_: JInputStream); cdecl;
function propertyNames: JEnumeration; cdecl;
procedure save(out_: JOutputStream; comments: JString); cdecl;//Deprecated
function setProperty(key: JString; value: JString): JObject; cdecl;
procedure store(writer: JWriter; comments: JString); cdecl; overload;
procedure store(out_: JOutputStream; comments: JString); cdecl; overload;
procedure storeToXML(os: JOutputStream; comment: JString); cdecl; overload;
procedure storeToXML(os: JOutputStream; comment: JString; encoding: JString); cdecl; overload;
function stringPropertyNames: JSet; cdecl;
end;
TJProperties = class(TJavaGenericImport<JPropertiesClass, JProperties>) end;
JQueueClass = interface(JCollectionClass)
['{3A0B6ECD-D788-4FFA-9C17-6F7A761FE1DC}']
end;
[JavaSignature('java/util/Queue')]
JQueue = interface(JCollection)
['{1F7FBC68-484A-4622-AE37-764E1EC7AF04}']
function add(e: JObject): Boolean; cdecl;
function element: JObject; cdecl;
function offer(e: JObject): Boolean; cdecl;
function peek: JObject; cdecl;
function poll: JObject; cdecl;
function remove: JObject; cdecl;
end;
TJQueue = class(TJavaGenericImport<JQueueClass, JQueue>) end;
JRandomClass = interface(JObjectClass)
['{C50FE36A-6283-4523-BF77-15BB7A7B0F92}']
{class} function init: JRandom; cdecl; overload;
{class} function init(seed: Int64): JRandom; cdecl; overload;
end;
[JavaSignature('java/util/Random')]
JRandom = interface(JObject)
['{F1C05381-73F2-4991-853B-B22575DB43D2}']
function doubles(streamSize: Int64): JDoubleStream; cdecl; overload;
function doubles: JDoubleStream; cdecl; overload;
function doubles(streamSize: Int64; randomNumberOrigin: Double; randomNumberBound: Double): JDoubleStream; cdecl; overload;
function doubles(randomNumberOrigin: Double; randomNumberBound: Double): JDoubleStream; cdecl; overload;
function ints(streamSize: Int64): JIntStream; cdecl; overload;
function ints: JIntStream; cdecl; overload;
function ints(streamSize: Int64; randomNumberOrigin: Integer; randomNumberBound: Integer): JIntStream; cdecl; overload;
function ints(randomNumberOrigin: Integer; randomNumberBound: Integer): JIntStream; cdecl; overload;
function longs(streamSize: Int64): JLongStream; cdecl; overload;
function longs: JLongStream; cdecl; overload;
function longs(streamSize: Int64; randomNumberOrigin: Int64; randomNumberBound: Int64): JLongStream; cdecl; overload;
function longs(randomNumberOrigin: Int64; randomNumberBound: Int64): JLongStream; cdecl; overload;
function nextBoolean: Boolean; cdecl;
procedure nextBytes(bytes: TJavaArray<Byte>); cdecl;
function nextDouble: Double; cdecl;
function nextFloat: Single; cdecl;
function nextGaussian: Double; cdecl;
function nextInt: Integer; cdecl; overload;
function nextInt(bound: Integer): Integer; cdecl; overload;
function nextLong: Int64; cdecl;
procedure setSeed(seed: Int64); cdecl;
end;
TJRandom = class(TJavaGenericImport<JRandomClass, JRandom>) end;
JSetClass = interface(JCollectionClass)
['{A3E290FD-FD46-4DA8-B728-07B04920F5DE}']
end;
[JavaSignature('java/util/Set')]
JSet = interface(JCollection)
['{07BF19A2-0C1C-4ABF-9028-1F99DD0E0A79}']
function add(e: JObject): Boolean; cdecl;
function addAll(c: JCollection): Boolean; cdecl;
procedure clear; cdecl;
function &contains(o: JObject): Boolean; cdecl;
function containsAll(c: JCollection): Boolean; cdecl;
function equals(o: JObject): Boolean; cdecl;
function hashCode: Integer; cdecl;
function isEmpty: Boolean; cdecl;
function iterator: JIterator; cdecl;
function remove(o: JObject): Boolean; cdecl;
function removeAll(c: JCollection): Boolean; cdecl;
function retainAll(c: JCollection): Boolean; cdecl;
function size: Integer; cdecl;
function spliterator: JSpliterator; cdecl;
function toArray: TJavaObjectArray<JObject>; cdecl; overload;
function toArray(a: TJavaObjectArray<JObject>): TJavaObjectArray<JObject>; cdecl; overload;
end;
TJSet = class(TJavaGenericImport<JSetClass, JSet>) end;
JSortedMapClass = interface(JMapClass)
['{7665A1A5-0EE6-483D-A256-B13FA7E65230}']
end;
[JavaSignature('java/util/SortedMap')]
JSortedMap = interface(JMap)
['{3FD4011C-7238-42A1-8E25-D7B3F130E88F}']
function comparator: JComparator; cdecl;
function entrySet: JSet; cdecl;
function firstKey: JObject; cdecl;
function headMap(toKey: JObject): JSortedMap; cdecl;
function keySet: JSet; cdecl;
function lastKey: JObject; cdecl;
function subMap(fromKey: JObject; toKey: JObject): JSortedMap; cdecl;
function tailMap(fromKey: JObject): JSortedMap; cdecl;
function values: JCollection; cdecl;
end;
TJSortedMap = class(TJavaGenericImport<JSortedMapClass, JSortedMap>) end;
JSpliteratorClass = interface(IJavaClass)
['{761CE3C7-3F2A-40D3-98D4-66816976ADDA}']
{class} function _GetCONCURRENT: Integer; cdecl;
{class} function _GetDISTINCT: Integer; cdecl;
{class} function _GetIMMUTABLE: Integer; cdecl;
{class} function _GetNONNULL: Integer; cdecl;
{class} function _GetORDERED: Integer; cdecl;
{class} function _GetSIZED: Integer; cdecl;
{class} function _GetSORTED: Integer; cdecl;
{class} function _GetSUBSIZED: Integer; cdecl;
{class} property CONCURRENT: Integer read _GetCONCURRENT;
{class} property DISTINCT: Integer read _GetDISTINCT;
{class} property IMMUTABLE: Integer read _GetIMMUTABLE;
{class} property NONNULL: Integer read _GetNONNULL;
{class} property ORDERED: Integer read _GetORDERED;
{class} property SIZED: Integer read _GetSIZED;
{class} property SORTED: Integer read _GetSORTED;
{class} property SUBSIZED: Integer read _GetSUBSIZED;
end;
[JavaSignature('java/util/Spliterator')]
JSpliterator = interface(IJavaInstance)
['{3C0C81D2-3AA1-4C9C-973B-2C718E1E8787}']
function characteristics: Integer; cdecl;
function estimateSize: Int64; cdecl;
procedure forEachRemaining(action: JConsumer); cdecl;
function getComparator: JComparator; cdecl;
function getExactSizeIfKnown: Int64; cdecl;
function hasCharacteristics(characteristics: Integer): Boolean; cdecl;
function tryAdvance(action: JConsumer): Boolean; cdecl;
function trySplit: JSpliterator; cdecl;
end;
TJSpliterator = class(TJavaGenericImport<JSpliteratorClass, JSpliterator>) end;
JSpliterator_OfPrimitiveClass = interface(JSpliteratorClass)
['{C97EEB5E-86A4-44C7-AE57-87B4E1DBD12B}']
end;
[JavaSignature('java/util/Spliterator$OfPrimitive')]
JSpliterator_OfPrimitive = interface(JSpliterator)
['{59F4B88F-F844-4910-9210-364671E1E9EB}']
procedure forEachRemaining(action: JObject); cdecl;
function tryAdvance(action: JObject): Boolean; cdecl;
function trySplit: JSpliterator_OfPrimitive; cdecl;
end;
TJSpliterator_OfPrimitive = class(TJavaGenericImport<JSpliterator_OfPrimitiveClass, JSpliterator_OfPrimitive>) end;
JSpliterator_OfDoubleClass = interface(JSpliterator_OfPrimitiveClass)
['{0F3E8A32-2936-490C-9052-85EB104D90C0}']
end;
[JavaSignature('java/util/Spliterator$OfDouble')]
JSpliterator_OfDouble = interface(JSpliterator_OfPrimitive)
['{A966A50D-7073-417F-847C-416A59E1ECF8}']
procedure forEachRemaining(action: JDoubleConsumer); cdecl; overload;
procedure forEachRemaining(action: JConsumer); cdecl; overload;
function tryAdvance(action: JDoubleConsumer): Boolean; cdecl; overload;
function tryAdvance(action: JConsumer): Boolean; cdecl; overload;
function trySplit: JSpliterator_OfDouble; cdecl;
end;
TJSpliterator_OfDouble = class(TJavaGenericImport<JSpliterator_OfDoubleClass, JSpliterator_OfDouble>) end;
JSpliterator_OfIntClass = interface(JSpliterator_OfPrimitiveClass)
['{5B4AC398-3105-447D-BE63-BA3D469D734E}']
end;
[JavaSignature('java/util/Spliterator$OfInt')]
JSpliterator_OfInt = interface(JSpliterator_OfPrimitive)
['{4CE6C93D-43C5-4C9B-94F1-9117C16B6429}']
procedure forEachRemaining(action: JIntConsumer); cdecl; overload;
procedure forEachRemaining(action: JConsumer); cdecl; overload;
function tryAdvance(action: JIntConsumer): Boolean; cdecl; overload;
function tryAdvance(action: JConsumer): Boolean; cdecl; overload;
function trySplit: JSpliterator_OfInt; cdecl;
end;
TJSpliterator_OfInt = class(TJavaGenericImport<JSpliterator_OfIntClass, JSpliterator_OfInt>) end;
JSpliterator_OfLongClass = interface(JSpliterator_OfPrimitiveClass)
['{49370BB6-25ED-462E-BB19-33BB9E91FFE5}']
end;
[JavaSignature('java/util/Spliterator$OfLong')]
JSpliterator_OfLong = interface(JSpliterator_OfPrimitive)
['{736FBDF1-B75F-48FA-B529-100FF6427577}']
procedure forEachRemaining(action: JLongConsumer); cdecl; overload;
procedure forEachRemaining(action: JConsumer); cdecl; overload;
function tryAdvance(action: JLongConsumer): Boolean; cdecl; overload;
function tryAdvance(action: JConsumer): Boolean; cdecl; overload;
function trySplit: JSpliterator_OfLong; cdecl;
end;
TJSpliterator_OfLong = class(TJavaGenericImport<JSpliterator_OfLongClass, JSpliterator_OfLong>) end;
JTimeZoneClass = interface(JObjectClass)
['{8F823620-CE10-44D5-82BA-24BFD63DCF80}']
{class} function _GetLONG: Integer; cdecl;
{class} function _GetSHORT: Integer; cdecl;
{class} function init: JTimeZone; cdecl;
{class} function getAvailableIDs(rawOffset: Integer): TJavaObjectArray<JString>; cdecl; overload;
{class} function getAvailableIDs: TJavaObjectArray<JString>; cdecl; overload;
{class} function getDefault: JTimeZone; cdecl;
{class} function getTimeZone(id: JString): JTimeZone; cdecl; overload;
{class} function getTimeZone(zoneId: JZoneId): JTimeZone; cdecl; overload;
{class} procedure setDefault(timeZone: JTimeZone); cdecl;
{class} property LONG: Integer read _GetLONG;
{class} property SHORT: Integer read _GetSHORT;
end;
[JavaSignature('java/util/TimeZone')]
JTimeZone = interface(JObject)
['{9D5215F4-A1B5-4B24-8B0B-EB3B88A0328D}']
function clone: JObject; cdecl;
function getDSTSavings: Integer; cdecl;
function getDisplayName: JString; cdecl; overload;
function getDisplayName(locale: JLocale): JString; cdecl; overload;
function getDisplayName(daylight: Boolean; style: Integer): JString; cdecl; overload;
function getDisplayName(daylightTime: Boolean; style: Integer; locale: JLocale): JString; cdecl; overload;
function getID: JString; cdecl;
function getOffset(era: Integer; year: Integer; month: Integer; day: Integer; dayOfWeek: Integer; milliseconds: Integer): Integer; cdecl; overload;
function getOffset(date: Int64): Integer; cdecl; overload;
function getRawOffset: Integer; cdecl;
function hasSameRules(other: JTimeZone): Boolean; cdecl;
function inDaylightTime(date: JDate): Boolean; cdecl;
function observesDaylightTime: Boolean; cdecl;
procedure setID(ID: JString); cdecl;
procedure setRawOffset(offsetMillis: Integer); cdecl;
function toZoneId: JZoneId; cdecl;
function useDaylightTime: Boolean; cdecl;
end;
TJTimeZone = class(TJavaGenericImport<JTimeZoneClass, JTimeZone>) end;
JTimerClass = interface(JObjectClass)
['{52E301A5-4F00-4743-94D1-BA38347CC59F}']
{class} function init: JTimer; cdecl; overload;
{class} function init(isDaemon: Boolean): JTimer; cdecl; overload;
{class} function init(name: JString): JTimer; cdecl; overload;
{class} function init(name: JString; isDaemon: Boolean): JTimer; cdecl; overload;
end;
[JavaSignature('java/util/Timer')]
JTimer = interface(JObject)
['{131F841C-9357-49F0-A688-9AC5506F4C5A}']
procedure cancel; cdecl;
function purge: Integer; cdecl;
procedure schedule(task: JTimerTask; delay: Int64); cdecl; overload;
procedure schedule(task: JTimerTask; time: JDate); cdecl; overload;
procedure schedule(task: JTimerTask; delay: Int64; period: Int64); cdecl; overload;
procedure schedule(task: JTimerTask; firstTime: JDate; period: Int64); cdecl; overload;
procedure scheduleAtFixedRate(task: JTimerTask; delay: Int64; period: Int64); cdecl; overload;
procedure scheduleAtFixedRate(task: JTimerTask; firstTime: JDate; period: Int64); cdecl; overload;
end;
TJTimer = class(TJavaGenericImport<JTimerClass, JTimer>) end;
JTimerTaskClass = interface(JObjectClass)
['{DC15DA86-BDCC-42A9-8B9D-7348D4AE0F13}']
end;
[JavaSignature('java/util/TimerTask')]
JTimerTask = interface(JObject)
['{B01AA454-6E9B-4A26-A31E-8D9A32E59816}']
function cancel: Boolean; cdecl;
procedure run; cdecl;
function scheduledExecutionTime: Int64; cdecl;
end;
TJTimerTask = class(TJavaGenericImport<JTimerTaskClass, JTimerTask>) end;
JUUIDClass = interface(JObjectClass)
['{F254C874-67C8-4832-9619-9F686CB8E466}']
{class} function init(mostSigBits: Int64; leastSigBits: Int64): JUUID; cdecl;
{class} function fromString(name: JString): JUUID; cdecl;
{class} function nameUUIDFromBytes(name: TJavaArray<Byte>): JUUID; cdecl;
{class} function randomUUID: JUUID; cdecl;
end;
[JavaSignature('java/util/UUID')]
JUUID = interface(JObject)
['{B280C48F-E064-4030-BFD0-FB5970A78101}']
function clockSequence: Integer; cdecl;
function compareTo(val: JUUID): Integer; cdecl;
function equals(obj: JObject): Boolean; cdecl;
function getLeastSignificantBits: Int64; cdecl;
function getMostSignificantBits: Int64; cdecl;
function hashCode: Integer; cdecl;
function node: Int64; cdecl;
function timestamp: Int64; cdecl;
function toString: JString; cdecl;
function variant: Integer; cdecl;
function version: Integer; cdecl;
end;
TJUUID = class(TJavaGenericImport<JUUIDClass, JUUID>) end;
JAbstractExecutorServiceClass = interface(JObjectClass)
['{3896A98A-B273-4500-B0D5-F7D69CD7D49E}']
{class} function init: JAbstractExecutorService; cdecl;
end;
[JavaSignature('java/util/concurrent/AbstractExecutorService')]
JAbstractExecutorService = interface(JObject)
['{7A846346-CB8B-442D-A705-40CB673B7A84}']
function invokeAll(tasks: JCollection): JList; cdecl; overload;
function invokeAll(tasks: JCollection; timeout: Int64; unit_: JTimeUnit): JList; cdecl; overload;
function invokeAny(tasks: JCollection): JObject; cdecl; overload;
function invokeAny(tasks: JCollection; timeout: Int64; unit_: JTimeUnit): JObject; cdecl; overload;
function submit(task: JRunnable): JFuture; cdecl; overload;
function submit(task: JRunnable; result: JObject): JFuture; cdecl; overload;
function submit(task: JCallable): JFuture; cdecl; overload;
end;
TJAbstractExecutorService = class(TJavaGenericImport<JAbstractExecutorServiceClass, JAbstractExecutorService>) end;
JBlockingQueueClass = interface(JQueueClass)
['{FEAC4030-F87A-4E78-9454-A48238AC00D8}']
end;
[JavaSignature('java/util/concurrent/BlockingQueue')]
JBlockingQueue = interface(JQueue)
['{4F92390A-DED1-405E-894E-656C3AD20695}']
function add(e: JObject): Boolean; cdecl;
function &contains(o: JObject): Boolean; cdecl;
function drainTo(c: JCollection): Integer; cdecl; overload;
function drainTo(c: JCollection; maxElements: Integer): Integer; cdecl; overload;
function offer(e: JObject): Boolean; cdecl; overload;
function offer(e: JObject; timeout: Int64; unit_: JTimeUnit): Boolean; cdecl; overload;
function poll(timeout: Int64; unit_: JTimeUnit): JObject; cdecl;
procedure put(e: JObject); cdecl;
function remainingCapacity: Integer; cdecl;
function remove(o: JObject): Boolean; cdecl;
function take: JObject; cdecl;
end;
TJBlockingQueue = class(TJavaGenericImport<JBlockingQueueClass, JBlockingQueue>) end;
JCallableClass = interface(IJavaClass)
['{F12DB2A8-1E01-44A9-BFBE-C6F3E32F7A65}']
end;
[JavaSignature('java/util/concurrent/Callable')]
JCallable = interface(IJavaInstance)
['{071A2E40-747B-4702-8DDB-D1749FB9B8FD}']
function call: JObject; cdecl;
end;
TJCallable = class(TJavaGenericImport<JCallableClass, JCallable>) end;
JCountDownLatchClass = interface(JObjectClass)
['{8BB952D3-8BF8-4704-BC03-DCE2997C03AC}']
{class} function init(count: Integer): JCountDownLatch; cdecl;
end;
[JavaSignature('java/util/concurrent/CountDownLatch')]
JCountDownLatch = interface(JObject)
['{302AA7D1-4CD0-45CB-868F-C1CF1209D276}']
procedure await; cdecl; overload;
function await(timeout: Int64; unit_: JTimeUnit): Boolean; cdecl; overload;
procedure countDown; cdecl;
function getCount: Int64; cdecl;
function toString: JString; cdecl;
end;
TJCountDownLatch = class(TJavaGenericImport<JCountDownLatchClass, JCountDownLatch>) end;
JDelayedClass = interface(JComparableClass)
['{67CD6011-1F40-4BCA-9E24-EDA55F6A4EA1}']
end;
[JavaSignature('java/util/concurrent/Delayed')]
JDelayed = interface(JComparable)
['{2BE364E4-9B4A-4A34-BDED-D1D9773530BF}']
function getDelay(unit_: JTimeUnit): Int64; cdecl;
end;
TJDelayed = class(TJavaGenericImport<JDelayedClass, JDelayed>) end;
JExecutorClass = interface(IJavaClass)
['{0606DEEF-30E1-4E40-82A3-20FF3E89BD61}']
end;
[JavaSignature('java/util/concurrent/Executor')]
JExecutor = interface(IJavaInstance)
['{B846ECEE-83CF-40BB-A4C5-FFC949DCEF15}']
procedure execute(command: JRunnable); cdecl;
end;
TJExecutor = class(TJavaGenericImport<JExecutorClass, JExecutor>) end;
JExecutorServiceClass = interface(JExecutorClass)
['{4CF14DA3-BA41-4F67-A2DE-F62C8B02177F}']
end;
[JavaSignature('java/util/concurrent/ExecutorService')]
JExecutorService = interface(JExecutor)
['{37810DA0-1254-423D-B181-C62455CB5AE4}']
function awaitTermination(timeout: Int64; unit_: JTimeUnit): Boolean; cdecl;
function invokeAll(tasks: JCollection): JList; cdecl; overload;
function invokeAll(tasks: JCollection; timeout: Int64; unit_: JTimeUnit): JList; cdecl; overload;
function invokeAny(tasks: JCollection): JObject; cdecl; overload;
function invokeAny(tasks: JCollection; timeout: Int64; unit_: JTimeUnit): JObject; cdecl; overload;
function isShutdown: Boolean; cdecl;
function isTerminated: Boolean; cdecl;
procedure shutdown; cdecl;
function shutdownNow: JList; cdecl;
function submit(task: JCallable): JFuture; cdecl; overload;
function submit(task: JRunnable; result: JObject): JFuture; cdecl; overload;
function submit(task: JRunnable): JFuture; cdecl; overload;
end;
TJExecutorService = class(TJavaGenericImport<JExecutorServiceClass, JExecutorService>) end;
JFutureClass = interface(IJavaClass)
['{1716BCA6-301F-4D84-956C-AC25D1787B40}']
end;
[JavaSignature('java/util/concurrent/Future')]
JFuture = interface(IJavaInstance)
['{EFD52756-9DF1-45BD-9E0D-A36E3CDE3DB9}']
function cancel(mayInterruptIfRunning: Boolean): Boolean; cdecl;
function &get: JObject; cdecl; overload;
function &get(timeout: Int64; unit_: JTimeUnit): JObject; cdecl; overload;
function isCancelled: Boolean; cdecl;
function isDone: Boolean; cdecl;
end;
TJFuture = class(TJavaGenericImport<JFutureClass, JFuture>) end;
JRejectedExecutionHandlerClass = interface(IJavaClass)
['{59CBB7C6-368F-446D-92CB-DB8638AE3BBD}']
end;
[JavaSignature('java/util/concurrent/RejectedExecutionHandler')]
JRejectedExecutionHandler = interface(IJavaInstance)
['{F75637CF-D111-4DE1-9820-CA00A2AA17C7}']
procedure rejectedExecution(r: JRunnable; executor: JThreadPoolExecutor); cdecl;
end;
TJRejectedExecutionHandler = class(TJavaGenericImport<JRejectedExecutionHandlerClass, JRejectedExecutionHandler>) end;
JScheduledFutureClass = interface(JDelayedClass)
['{6AEAD91E-6D96-4057-BD8D-8B28E3833E7E}']
end;
[JavaSignature('java/util/concurrent/ScheduledFuture')]
JScheduledFuture = interface(JDelayed)
['{0D2AEB43-60E8-4488-9260-15E693B853DD}']
end;
TJScheduledFuture = class(TJavaGenericImport<JScheduledFutureClass, JScheduledFuture>) end;
JThreadPoolExecutorClass = interface(JAbstractExecutorServiceClass)
['{DDC3110F-84AA-41F1-9D0F-9800A406A8A8}']
{class} function init(corePoolSize: Integer; maximumPoolSize: Integer; keepAliveTime: Int64; unit_: JTimeUnit; workQueue: JBlockingQueue): JThreadPoolExecutor; cdecl; overload;
{class} function init(corePoolSize: Integer; maximumPoolSize: Integer; keepAliveTime: Int64; unit_: JTimeUnit; workQueue: JBlockingQueue; threadFactory: JThreadFactory): JThreadPoolExecutor; cdecl; overload;
{class} function init(corePoolSize: Integer; maximumPoolSize: Integer; keepAliveTime: Int64; unit_: JTimeUnit; workQueue: JBlockingQueue; handler: JRejectedExecutionHandler): JThreadPoolExecutor; cdecl; overload;
{class} function init(corePoolSize: Integer; maximumPoolSize: Integer; keepAliveTime: Int64; unit_: JTimeUnit; workQueue: JBlockingQueue; threadFactory: JThreadFactory; handler: JRejectedExecutionHandler): JThreadPoolExecutor; cdecl; overload;
end;
[JavaSignature('java/util/concurrent/ThreadPoolExecutor')]
JThreadPoolExecutor = interface(JAbstractExecutorService)
['{866B2F57-7E31-4566-876F-4A35D526D76C}']
procedure allowCoreThreadTimeOut(value: Boolean); cdecl;
function allowsCoreThreadTimeOut: Boolean; cdecl;
function awaitTermination(timeout: Int64; unit_: JTimeUnit): Boolean; cdecl;
procedure execute(command: JRunnable); cdecl;
function getActiveCount: Integer; cdecl;
function getCompletedTaskCount: Int64; cdecl;
function getCorePoolSize: Integer; cdecl;
function getKeepAliveTime(unit_: JTimeUnit): Int64; cdecl;
function getLargestPoolSize: Integer; cdecl;
function getMaximumPoolSize: Integer; cdecl;
function getPoolSize: Integer; cdecl;
function getQueue: JBlockingQueue; cdecl;
function getRejectedExecutionHandler: JRejectedExecutionHandler; cdecl;
function getTaskCount: Int64; cdecl;
function getThreadFactory: JThreadFactory; cdecl;
function isShutdown: Boolean; cdecl;
function isTerminated: Boolean; cdecl;
function isTerminating: Boolean; cdecl;
function prestartAllCoreThreads: Integer; cdecl;
function prestartCoreThread: Boolean; cdecl;
procedure purge; cdecl;
function remove(task: JRunnable): Boolean; cdecl;
procedure setCorePoolSize(corePoolSize: Integer); cdecl;
procedure setKeepAliveTime(time: Int64; unit_: JTimeUnit); cdecl;
procedure setMaximumPoolSize(maximumPoolSize: Integer); cdecl;
procedure setRejectedExecutionHandler(handler: JRejectedExecutionHandler); cdecl;
procedure setThreadFactory(threadFactory: JThreadFactory); cdecl;
procedure shutdown; cdecl;
function shutdownNow: JList; cdecl;
function toString: JString; cdecl;
end;
TJThreadPoolExecutor = class(TJavaGenericImport<JThreadPoolExecutorClass, JThreadPoolExecutor>) end;
JScheduledThreadPoolExecutorClass = interface(JThreadPoolExecutorClass)
['{E97835A3-4211-4A02-AC53-E0951A70BFCE}']
{class} function init(corePoolSize: Integer): JScheduledThreadPoolExecutor; cdecl; overload;
{class} function init(corePoolSize: Integer; threadFactory: JThreadFactory): JScheduledThreadPoolExecutor; cdecl; overload;
{class} function init(corePoolSize: Integer; handler: JRejectedExecutionHandler): JScheduledThreadPoolExecutor; cdecl; overload;
{class} function init(corePoolSize: Integer; threadFactory: JThreadFactory; handler: JRejectedExecutionHandler): JScheduledThreadPoolExecutor; cdecl; overload;
end;
[JavaSignature('java/util/concurrent/ScheduledThreadPoolExecutor')]
JScheduledThreadPoolExecutor = interface(JThreadPoolExecutor)
['{7E9D716D-A52D-440A-B55A-21B9832960C6}']
procedure execute(command: JRunnable); cdecl;
function getContinueExistingPeriodicTasksAfterShutdownPolicy: Boolean; cdecl;
function getExecuteExistingDelayedTasksAfterShutdownPolicy: Boolean; cdecl;
function getQueue: JBlockingQueue; cdecl;
function getRemoveOnCancelPolicy: Boolean; cdecl;
function schedule(command: JRunnable; delay: Int64; unit_: JTimeUnit): JScheduledFuture; cdecl; overload;
function schedule(callable: JCallable; delay: Int64; unit_: JTimeUnit): JScheduledFuture; cdecl; overload;
function scheduleAtFixedRate(command: JRunnable; initialDelay: Int64; period: Int64; unit_: JTimeUnit): JScheduledFuture; cdecl;
function scheduleWithFixedDelay(command: JRunnable; initialDelay: Int64; delay: Int64; unit_: JTimeUnit): JScheduledFuture; cdecl;
procedure setContinueExistingPeriodicTasksAfterShutdownPolicy(value: Boolean); cdecl;
procedure setExecuteExistingDelayedTasksAfterShutdownPolicy(value: Boolean); cdecl;
procedure setRemoveOnCancelPolicy(value: Boolean); cdecl;
procedure shutdown; cdecl;
function shutdownNow: JList; cdecl;
function submit(task: JRunnable): JFuture; cdecl; overload;
function submit(task: JRunnable; result: JObject): JFuture; cdecl; overload;
function submit(task: JCallable): JFuture; cdecl; overload;
end;
TJScheduledThreadPoolExecutor = class(TJavaGenericImport<JScheduledThreadPoolExecutorClass, JScheduledThreadPoolExecutor>) end;
JThreadFactoryClass = interface(IJavaClass)
['{CD4277E8-4960-409B-B76C-70D202901E27}']
end;
[JavaSignature('java/util/concurrent/ThreadFactory')]
JThreadFactory = interface(IJavaInstance)
['{D96A16B3-CE4E-4293-9BB0-FE84575F7E19}']
function newThread(r: JRunnable): JThread; cdecl;
end;
TJThreadFactory = class(TJavaGenericImport<JThreadFactoryClass, JThreadFactory>) end;
JTimeUnitClass = interface(JEnumClass)
['{005AE9B1-228D-48C4-BFD2-41DCEE712F3B}']
{class} function _GetDAYS: JTimeUnit; cdecl;
{class} function _GetHOURS: JTimeUnit; cdecl;
{class} function _GetMICROSECONDS: JTimeUnit; cdecl;
{class} function _GetMILLISECONDS: JTimeUnit; cdecl;
{class} function _GetMINUTES: JTimeUnit; cdecl;
{class} function _GetNANOSECONDS: JTimeUnit; cdecl;
{class} function _GetSECONDS: JTimeUnit; cdecl;
{class} function valueOf(name: JString): JTimeUnit; cdecl;
{class} function values: TJavaObjectArray<JTimeUnit>; cdecl;
{class} property DAYS: JTimeUnit read _GetDAYS;
{class} property HOURS: JTimeUnit read _GetHOURS;
{class} property MICROSECONDS: JTimeUnit read _GetMICROSECONDS;
{class} property MILLISECONDS: JTimeUnit read _GetMILLISECONDS;
{class} property MINUTES: JTimeUnit read _GetMINUTES;
{class} property NANOSECONDS: JTimeUnit read _GetNANOSECONDS;
{class} property SECONDS: JTimeUnit read _GetSECONDS;
end;
[JavaSignature('java/util/concurrent/TimeUnit')]
JTimeUnit = interface(JEnum)
['{97B8E3BD-6430-4597-B01D-CD2AD51ECB2C}']
function convert(sourceDuration: Int64; sourceUnit: JTimeUnit): Int64; cdecl;
procedure sleep(timeout: Int64); cdecl;
procedure timedJoin(thread: JThread; timeout: Int64); cdecl;
procedure timedWait(obj: JObject; timeout: Int64); cdecl;
function toDays(duration: Int64): Int64; cdecl;
function toHours(duration: Int64): Int64; cdecl;
function toMicros(duration: Int64): Int64; cdecl;
function toMillis(duration: Int64): Int64; cdecl;
function toMinutes(duration: Int64): Int64; cdecl;
function toNanos(duration: Int64): Int64; cdecl;
function toSeconds(duration: Int64): Int64; cdecl;
end;
TJTimeUnit = class(TJavaGenericImport<JTimeUnitClass, JTimeUnit>) end;
JBiConsumerClass = interface(IJavaClass)
['{065BE993-4F2C-4871-9031-CC7C43C8D0AE}']
end;
[JavaSignature('java/util/function/BiConsumer')]
JBiConsumer = interface(IJavaInstance)
['{5BAC9E18-EBE9-48E2-9773-E2E3B3804787}']
procedure accept(t: JObject; u: JObject); cdecl;
function andThen(after: JBiConsumer): JBiConsumer; cdecl;
end;
TJBiConsumer = class(TJavaGenericImport<JBiConsumerClass, JBiConsumer>) end;
JBiFunctionClass = interface(IJavaClass)
['{5464C002-1FDC-48A1-A77A-E5FA20D8CF59}']
end;
[JavaSignature('java/util/function/BiFunction')]
JBiFunction = interface(IJavaInstance)
['{EF9FF082-16D1-480E-AA7F-3CB4B4DC778A}']
function andThen(after: JFunction): JBiFunction; cdecl;
function apply(t: JObject; u: JObject): JObject; cdecl;
end;
TJBiFunction = class(TJavaGenericImport<JBiFunctionClass, JBiFunction>) end;
JBinaryOperatorClass = interface(JBiFunctionClass)
['{95EEBC66-5B49-414A-8368-11A14437F334}']
{class} function maxBy(comparator: JComparator): JBinaryOperator; cdecl;
{class} function minBy(comparator: JComparator): JBinaryOperator; cdecl;
end;
[JavaSignature('java/util/function/BinaryOperator')]
JBinaryOperator = interface(JBiFunction)
['{EEECC7C7-BFC2-4927-89D2-73D755113D1E}']
end;
TJBinaryOperator = class(TJavaGenericImport<JBinaryOperatorClass, JBinaryOperator>) end;
JConsumerClass = interface(IJavaClass)
['{FD2040AB-3E2C-427F-9785-6F7D63AD1B30}']
end;
[JavaSignature('java/util/function/Consumer')]
JConsumer = interface(IJavaInstance)
['{FA3FC0D0-8321-4890-9A76-43297FB1D573}']
procedure accept(t: JObject); cdecl;
function andThen(after: JConsumer): JConsumer; cdecl;
end;
TJConsumer = class(TJavaGenericImport<JConsumerClass, JConsumer>) end;
JDoubleBinaryOperatorClass = interface(IJavaClass)
['{B3CBC9D2-7198-4AEA-AFAB-BE8BE48EED4D}']
end;
[JavaSignature('java/util/function/DoubleBinaryOperator')]
JDoubleBinaryOperator = interface(IJavaInstance)
['{DADEB50A-87CB-419E-A485-278D4DA3EF5D}']
function applyAsDouble(left: Double; right: Double): Double; cdecl;
end;
TJDoubleBinaryOperator = class(TJavaGenericImport<JDoubleBinaryOperatorClass, JDoubleBinaryOperator>) end;
JDoubleConsumerClass = interface(IJavaClass)
['{83FD623D-BDE6-4FCE-A7DA-3BA39294EBCC}']
end;
[JavaSignature('java/util/function/DoubleConsumer')]
JDoubleConsumer = interface(IJavaInstance)
['{264EB215-0144-445D-BB7E-AEE42056AC61}']
procedure accept(value: Double); cdecl;
function andThen(after: JDoubleConsumer): JDoubleConsumer; cdecl;
end;
TJDoubleConsumer = class(TJavaGenericImport<JDoubleConsumerClass, JDoubleConsumer>) end;
JDoubleFunctionClass = interface(IJavaClass)
['{3DAA0C36-4EB9-4957-BEAD-3FB92C0D0017}']
end;
[JavaSignature('java/util/function/DoubleFunction')]
JDoubleFunction = interface(IJavaInstance)
['{0332F11A-0C95-4329-99CE-B518E0F1D165}']
function apply(value: Double): JObject; cdecl;
end;
TJDoubleFunction = class(TJavaGenericImport<JDoubleFunctionClass, JDoubleFunction>) end;
JDoublePredicateClass = interface(IJavaClass)
['{D2568D36-370F-46DD-9B99-F0027FE19331}']
end;
[JavaSignature('java/util/function/DoublePredicate')]
JDoublePredicate = interface(IJavaInstance)
['{1670F5A4-68D1-4D46-8448-9EBCE7A81A0C}']
function &and(other: JDoublePredicate): JDoublePredicate; cdecl;
function negate: JDoublePredicate; cdecl;
function &or(other: JDoublePredicate): JDoublePredicate; cdecl;
function test(value: Double): Boolean; cdecl;
end;
TJDoublePredicate = class(TJavaGenericImport<JDoublePredicateClass, JDoublePredicate>) end;
JDoubleSupplierClass = interface(IJavaClass)
['{6AA866F7-143D-41B7-BDAB-6E5CA99864C3}']
end;
[JavaSignature('java/util/function/DoubleSupplier')]
JDoubleSupplier = interface(IJavaInstance)
['{CD96F65D-B6FA-458E-9D90-75DF4A3259BD}']
function getAsDouble: Double; cdecl;
end;
TJDoubleSupplier = class(TJavaGenericImport<JDoubleSupplierClass, JDoubleSupplier>) end;
JDoubleToIntFunctionClass = interface(IJavaClass)
['{44D077FE-ADB6-451F-A7F5-F352EFF13F62}']
end;
[JavaSignature('java/util/function/DoubleToIntFunction')]
JDoubleToIntFunction = interface(IJavaInstance)
['{83A128F0-9C61-4531-8317-BD8811A9FD45}']
function applyAsInt(value: Double): Integer; cdecl;
end;
TJDoubleToIntFunction = class(TJavaGenericImport<JDoubleToIntFunctionClass, JDoubleToIntFunction>) end;
JDoubleToLongFunctionClass = interface(IJavaClass)
['{1BCACF79-4F3E-43DF-A5E9-CE81B1FC57A7}']
end;
[JavaSignature('java/util/function/DoubleToLongFunction')]
JDoubleToLongFunction = interface(IJavaInstance)
['{3C9BEE45-29C0-45E7-9393-367C99E61D96}']
function applyAsLong(value: Double): Int64; cdecl;
end;
TJDoubleToLongFunction = class(TJavaGenericImport<JDoubleToLongFunctionClass, JDoubleToLongFunction>) end;
JDoubleUnaryOperatorClass = interface(IJavaClass)
['{1C90EDBB-50AE-415B-938B-7620D852FA18}']
{class} function identity: JDoubleUnaryOperator; cdecl;
end;
[JavaSignature('java/util/function/DoubleUnaryOperator')]
JDoubleUnaryOperator = interface(IJavaInstance)
['{9760D589-5CA6-4D36-8886-B3A3D2E797A5}']
function andThen(after: JDoubleUnaryOperator): JDoubleUnaryOperator; cdecl;
function applyAsDouble(operand: Double): Double; cdecl;
function compose(before: JDoubleUnaryOperator): JDoubleUnaryOperator; cdecl;
end;
TJDoubleUnaryOperator = class(TJavaGenericImport<JDoubleUnaryOperatorClass, JDoubleUnaryOperator>) end;
JFunctionClass = interface(IJavaClass)
['{B894BE7C-C2EB-4FBD-82F2-5143E3C72087}']
{class} function identity: JFunction; cdecl;
end;
[JavaSignature('java/util/function/Function')]
JFunction = interface(IJavaInstance)
['{DE3AF3E0-AAC1-4F16-AE6F-8BDEE45712A5}']
function andThen(after: JFunction): JFunction; cdecl;
function apply(t: JObject): JObject; cdecl;
function compose(before: JFunction): JFunction; cdecl;
end;
TJFunction = class(TJavaGenericImport<JFunctionClass, JFunction>) end;
JIntBinaryOperatorClass = interface(IJavaClass)
['{D3FCC9B0-D9EC-4D50-A62D-41B1DF086A30}']
end;
[JavaSignature('java/util/function/IntBinaryOperator')]
JIntBinaryOperator = interface(IJavaInstance)
['{A1B427B4-961D-4AAF-AF87-692D18530032}']
function applyAsInt(left: Integer; right: Integer): Integer; cdecl;
end;
TJIntBinaryOperator = class(TJavaGenericImport<JIntBinaryOperatorClass, JIntBinaryOperator>) end;
JIntConsumerClass = interface(IJavaClass)
['{8355AAF9-C5F8-48D9-A37F-96B167063465}']
end;
[JavaSignature('java/util/function/IntConsumer')]
JIntConsumer = interface(IJavaInstance)
['{716831E0-3045-4BC6-BD4B-9CC2AFBAE951}']
procedure accept(value: Integer); cdecl;
function andThen(after: JIntConsumer): JIntConsumer; cdecl;
end;
TJIntConsumer = class(TJavaGenericImport<JIntConsumerClass, JIntConsumer>) end;
JIntFunctionClass = interface(IJavaClass)
['{A1DBACC3-3DB3-4C44-948E-0B56328EC56A}']
end;
[JavaSignature('java/util/function/IntFunction')]
JIntFunction = interface(IJavaInstance)
['{4C584C4F-CC64-464F-968F-3C96F00D1F2F}']
function apply(value: Integer): JObject; cdecl;
end;
TJIntFunction = class(TJavaGenericImport<JIntFunctionClass, JIntFunction>) end;
JIntPredicateClass = interface(IJavaClass)
['{3DC5487F-7B58-46A1-992D-471E84750E5C}']
end;
[JavaSignature('java/util/function/IntPredicate')]
JIntPredicate = interface(IJavaInstance)
['{907EE188-53BE-435F-AFEB-65B0373D9B4D}']
function &and(other: JIntPredicate): JIntPredicate; cdecl;
function negate: JIntPredicate; cdecl;
function &or(other: JIntPredicate): JIntPredicate; cdecl;
function test(value: Integer): Boolean; cdecl;
end;
TJIntPredicate = class(TJavaGenericImport<JIntPredicateClass, JIntPredicate>) end;
JIntSupplierClass = interface(IJavaClass)
['{34E94E9A-70CD-4EC7-A7AB-A930564D649A}']
end;
[JavaSignature('java/util/function/IntSupplier')]
JIntSupplier = interface(IJavaInstance)
['{F933802B-916C-4BF4-91B0-EB8355583150}']
function getAsInt: Integer; cdecl;
end;
TJIntSupplier = class(TJavaGenericImport<JIntSupplierClass, JIntSupplier>) end;
JIntToDoubleFunctionClass = interface(IJavaClass)
['{ADC1836D-7074-4FB5-87EC-5EF0B09B89A8}']
end;
[JavaSignature('java/util/function/IntToDoubleFunction')]
JIntToDoubleFunction = interface(IJavaInstance)
['{0CB8806D-99B5-4E0F-A6D4-0E474B509D44}']
function applyAsDouble(value: Integer): Double; cdecl;
end;
TJIntToDoubleFunction = class(TJavaGenericImport<JIntToDoubleFunctionClass, JIntToDoubleFunction>) end;
JIntToLongFunctionClass = interface(IJavaClass)
['{E26F1631-0AC6-433D-B248-58AD7F77BBF9}']
end;
[JavaSignature('java/util/function/IntToLongFunction')]
JIntToLongFunction = interface(IJavaInstance)
['{41177A7E-3C96-428D-BFD1-FAB2B93AE1AA}']
function applyAsLong(value: Integer): Int64; cdecl;
end;
TJIntToLongFunction = class(TJavaGenericImport<JIntToLongFunctionClass, JIntToLongFunction>) end;
JIntUnaryOperatorClass = interface(IJavaClass)
['{D49C6AD7-D088-44A5-B2BD-4918638B974E}']
{class} function identity: JIntUnaryOperator; cdecl;
end;
[JavaSignature('java/util/function/IntUnaryOperator')]
JIntUnaryOperator = interface(IJavaInstance)
['{90D5FDB0-F70A-4575-BB9A-DFE77B24BC4E}']
function andThen(after: JIntUnaryOperator): JIntUnaryOperator; cdecl;
function applyAsInt(operand: Integer): Integer; cdecl;
function compose(before: JIntUnaryOperator): JIntUnaryOperator; cdecl;
end;
TJIntUnaryOperator = class(TJavaGenericImport<JIntUnaryOperatorClass, JIntUnaryOperator>) end;
JLongBinaryOperatorClass = interface(IJavaClass)
['{956BB45E-C61D-42BC-8216-FD9701523DD9}']
end;
[JavaSignature('java/util/function/LongBinaryOperator')]
JLongBinaryOperator = interface(IJavaInstance)
['{D6D37837-D052-4CC5-966E-C2C45FEE43E2}']
function applyAsLong(left: Int64; right: Int64): Int64; cdecl;
end;
TJLongBinaryOperator = class(TJavaGenericImport<JLongBinaryOperatorClass, JLongBinaryOperator>) end;
JLongConsumerClass = interface(IJavaClass)
['{0387FD41-8255-4EF0-B5C4-C030D16AE68E}']
end;
[JavaSignature('java/util/function/LongConsumer')]
JLongConsumer = interface(IJavaInstance)
['{3AE22FBB-7203-4AC4-B04F-71863C48C074}']
procedure accept(value: Int64); cdecl;
function andThen(after: JLongConsumer): JLongConsumer; cdecl;
end;
TJLongConsumer = class(TJavaGenericImport<JLongConsumerClass, JLongConsumer>) end;
JLongFunctionClass = interface(IJavaClass)
['{F385D73D-A40A-4C56-95CA-3049ADA213E1}']
end;
[JavaSignature('java/util/function/LongFunction')]
JLongFunction = interface(IJavaInstance)
['{C155EBFD-B19B-4757-9F25-207CC8C95612}']
function apply(value: Int64): JObject; cdecl;
end;
TJLongFunction = class(TJavaGenericImport<JLongFunctionClass, JLongFunction>) end;
JLongPredicateClass = interface(IJavaClass)
['{E7323BC2-F6D3-4141-9E06-430D82F04A06}']
end;
[JavaSignature('java/util/function/LongPredicate')]
JLongPredicate = interface(IJavaInstance)
['{C099E986-10A1-4E8A-B24D-2FFB9811127D}']
function &and(other: JLongPredicate): JLongPredicate; cdecl;
function negate: JLongPredicate; cdecl;
function &or(other: JLongPredicate): JLongPredicate; cdecl;
function test(value: Int64): Boolean; cdecl;
end;
TJLongPredicate = class(TJavaGenericImport<JLongPredicateClass, JLongPredicate>) end;
JLongSupplierClass = interface(IJavaClass)
['{AB5EB526-40B1-4750-B093-3C48C27E18E5}']
end;
[JavaSignature('java/util/function/LongSupplier')]
JLongSupplier = interface(IJavaInstance)
['{90C098B2-7AC7-4A38-8955-506278DEC571}']
function getAsLong: Int64; cdecl;
end;
TJLongSupplier = class(TJavaGenericImport<JLongSupplierClass, JLongSupplier>) end;
JLongToDoubleFunctionClass = interface(IJavaClass)
['{A6A2D00E-2B16-4949-9C8F-EF94D4F3CEC8}']
end;
[JavaSignature('java/util/function/LongToDoubleFunction')]
JLongToDoubleFunction = interface(IJavaInstance)
['{DF437697-4236-4220-ABA2-6C275D7A5D55}']
function applyAsDouble(value: Int64): Double; cdecl;
end;
TJLongToDoubleFunction = class(TJavaGenericImport<JLongToDoubleFunctionClass, JLongToDoubleFunction>) end;
JLongToIntFunctionClass = interface(IJavaClass)
['{F735EE2D-7F52-4A44-889C-C323F02B0240}']
end;
[JavaSignature('java/util/function/LongToIntFunction')]
JLongToIntFunction = interface(IJavaInstance)
['{1E9E6841-D548-4AA9-BA1C-27546BACE98C}']
function applyAsInt(value: Int64): Integer; cdecl;
end;
TJLongToIntFunction = class(TJavaGenericImport<JLongToIntFunctionClass, JLongToIntFunction>) end;
JLongUnaryOperatorClass = interface(IJavaClass)
['{68D59977-B642-4966-B697-37ED7B906931}']
{class} function identity: JLongUnaryOperator; cdecl;
end;
[JavaSignature('java/util/function/LongUnaryOperator')]
JLongUnaryOperator = interface(IJavaInstance)
['{4E259A17-47EA-451A-B168-903CAB3E7208}']
function andThen(after: JLongUnaryOperator): JLongUnaryOperator; cdecl;
function applyAsLong(operand: Int64): Int64; cdecl;
function compose(before: JLongUnaryOperator): JLongUnaryOperator; cdecl;
end;
TJLongUnaryOperator = class(TJavaGenericImport<JLongUnaryOperatorClass, JLongUnaryOperator>) end;
JObjDoubleConsumerClass = interface(IJavaClass)
['{36A487A2-5A35-461E-BA24-9304EBBCDC5F}']
end;
[JavaSignature('java/util/function/ObjDoubleConsumer')]
JObjDoubleConsumer = interface(IJavaInstance)
['{251FBA8B-B3E2-4481-A9FE-9150E9EE6520}']
procedure accept(t: JObject; value: Double); cdecl;
end;
TJObjDoubleConsumer = class(TJavaGenericImport<JObjDoubleConsumerClass, JObjDoubleConsumer>) end;
JObjIntConsumerClass = interface(IJavaClass)
['{E0BEE2E8-43E1-4122-9B4E-BDA7F0B289E6}']
end;
[JavaSignature('java/util/function/ObjIntConsumer')]
JObjIntConsumer = interface(IJavaInstance)
['{998BBD5D-EE86-4B8A-9211-AA1362C55E51}']
procedure accept(t: JObject; value: Integer); cdecl;
end;
TJObjIntConsumer = class(TJavaGenericImport<JObjIntConsumerClass, JObjIntConsumer>) end;
JObjLongConsumerClass = interface(IJavaClass)
['{C26427D1-9159-4F57-BD51-6225CC9294FB}']
end;
[JavaSignature('java/util/function/ObjLongConsumer')]
JObjLongConsumer = interface(IJavaInstance)
['{AECB9A3F-0DF8-44A4-B3A0-149EB31ACA28}']
procedure accept(t: JObject; value: Int64); cdecl;
end;
TJObjLongConsumer = class(TJavaGenericImport<JObjLongConsumerClass, JObjLongConsumer>) end;
Jfunction_PredicateClass = interface(IJavaClass)
['{959B15C1-7ABA-41B2-880C-AF80340211CF}']
{class} function isEqual(targetRef: JObject): Jfunction_Predicate; cdecl;
end;
[JavaSignature('java/util/function/Predicate')]
Jfunction_Predicate = interface(IJavaInstance)
['{CEEE51CA-6A23-4AC9-B2E2-24EC48DD6AA7}']
function &and(other: Jfunction_Predicate): Jfunction_Predicate; cdecl;
function negate: Jfunction_Predicate; cdecl;
function &or(other: Jfunction_Predicate): Jfunction_Predicate; cdecl;
function test(t: JObject): Boolean; cdecl;
end;
TJfunction_Predicate = class(TJavaGenericImport<Jfunction_PredicateClass, Jfunction_Predicate>) end;
JSupplierClass = interface(IJavaClass)
['{04A70565-9F2F-4445-8BF9-06ADBC8C62BA}']
end;
[JavaSignature('java/util/function/Supplier')]
JSupplier = interface(IJavaInstance)
['{CD2853E6-546F-479C-A934-CF56EE99450F}']
function &get: JObject; cdecl;
end;
TJSupplier = class(TJavaGenericImport<JSupplierClass, JSupplier>) end;
JToDoubleFunctionClass = interface(IJavaClass)
['{B546CD0E-82C4-4EE4-9299-16DAE9FB518A}']
end;
[JavaSignature('java/util/function/ToDoubleFunction')]
JToDoubleFunction = interface(IJavaInstance)
['{81E092C0-A6E9-45D0-8AE8-7932A21B2DF3}']
function applyAsDouble(value: JObject): Double; cdecl;
end;
TJToDoubleFunction = class(TJavaGenericImport<JToDoubleFunctionClass, JToDoubleFunction>) end;
JToIntFunctionClass = interface(IJavaClass)
['{6F4F201F-78F9-4225-8744-E1F8615BF17D}']
end;
[JavaSignature('java/util/function/ToIntFunction')]
JToIntFunction = interface(IJavaInstance)
['{AE45B514-C2A6-416A-A6CB-AC35761BFCF1}']
function applyAsInt(value: JObject): Integer; cdecl;
end;
TJToIntFunction = class(TJavaGenericImport<JToIntFunctionClass, JToIntFunction>) end;
JToLongFunctionClass = interface(IJavaClass)
['{96B05960-EDFA-497F-A0C2-51ABF28FD3D1}']
end;
[JavaSignature('java/util/function/ToLongFunction')]
JToLongFunction = interface(IJavaInstance)
['{817FE784-2AE6-43EB-87FA-8347B62D8F23}']
function applyAsLong(value: JObject): Int64; cdecl;
end;
TJToLongFunction = class(TJavaGenericImport<JToLongFunctionClass, JToLongFunction>) end;
JUnaryOperatorClass = interface(JFunctionClass)
['{740E2077-1A4C-4DAA-89FD-F97932E9CB00}']
{class} function identity: JUnaryOperator; cdecl;
end;
[JavaSignature('java/util/function/UnaryOperator')]
JUnaryOperator = interface(JFunction)
['{3A91B090-A4A3-4C2E-8C35-8ACABCEA8156}']
end;
TJUnaryOperator = class(TJavaGenericImport<JUnaryOperatorClass, JUnaryOperator>) end;
JBaseStreamClass = interface(JAutoCloseableClass)
['{3760B90D-4AAB-4159-BB0A-AF2AE9C2F783}']
end;
[JavaSignature('java/util/stream/BaseStream')]
JBaseStream = interface(JAutoCloseable)
['{A94FAC16-CD7B-4534-9235-44E641FCFE39}']
procedure close; cdecl;
function isParallel: Boolean; cdecl;
function iterator: JIterator; cdecl;
function onClose(closeHandler: JRunnable): JBaseStream; cdecl;
function parallel: JBaseStream; cdecl;
function sequential: JBaseStream; cdecl;
function spliterator: JSpliterator; cdecl;
function unordered: JBaseStream; cdecl;
end;
TJBaseStream = class(TJavaGenericImport<JBaseStreamClass, JBaseStream>) end;
JCollectorClass = interface(IJavaClass)
['{8589CE91-2E05-4B98-9CA0-69EA9E0372C4}']
end;
[JavaSignature('java/util/stream/Collector')]
JCollector = interface(IJavaInstance)
['{49CB9A3B-ACE2-47C5-8E3D-CA380693AD2E}']
function accumulator: JBiConsumer; cdecl;
function characteristics: JSet; cdecl;
function combiner: JBinaryOperator; cdecl;
function finisher: JFunction; cdecl;
function supplier: JSupplier; cdecl;
end;
TJCollector = class(TJavaGenericImport<JCollectorClass, JCollector>) end;
JCollector_CharacteristicsClass = interface(JEnumClass)
['{E54E7D02-FDD5-4B45-A7F8-579BC1AEB1DF}']
{class} function _GetCONCURRENT: JCollector_Characteristics; cdecl;
{class} function _GetIDENTITY_FINISH: JCollector_Characteristics; cdecl;
{class} function _GetUNORDERED: JCollector_Characteristics; cdecl;
{class} function valueOf(name: JString): JCollector_Characteristics; cdecl;
{class} function values: TJavaObjectArray<JCollector_Characteristics>; cdecl;
{class} property CONCURRENT: JCollector_Characteristics read _GetCONCURRENT;
{class} property IDENTITY_FINISH: JCollector_Characteristics read _GetIDENTITY_FINISH;
{class} property UNORDERED: JCollector_Characteristics read _GetUNORDERED;
end;
[JavaSignature('java/util/stream/Collector$Characteristics')]
JCollector_Characteristics = interface(JEnum)
['{BBD8E04D-F41F-4DE5-812D-5A1DA3ECB2A8}']
end;
TJCollector_Characteristics = class(TJavaGenericImport<JCollector_CharacteristicsClass, JCollector_Characteristics>) end;
JDoubleStreamClass = interface(JBaseStreamClass)
['{54B73264-0D15-4A16-A520-D3C0A20FB11F}']
{class} function builder: JDoubleStream_Builder; cdecl;
{class} function concat(a: JDoubleStream; b: JDoubleStream): JDoubleStream; cdecl;
{class} function empty: JDoubleStream; cdecl;
{class} function generate(s: JDoubleSupplier): JDoubleStream; cdecl;
{class} function iterate(seed: Double; f: JDoubleUnaryOperator): JDoubleStream; cdecl;
{class} function &of(t: Double): JDoubleStream; cdecl;
end;
[JavaSignature('java/util/stream/DoubleStream')]
JDoubleStream = interface(JBaseStream)
['{E7877181-FE91-4130-8E0E-FF650F326B7E}']
function allMatch(predicate: JDoublePredicate): Boolean; cdecl;
function anyMatch(predicate: JDoublePredicate): Boolean; cdecl;
function average: JOptionalDouble; cdecl;
function boxed: JStream; cdecl;
function collect(supplier: JSupplier; accumulator: JObjDoubleConsumer; combiner: JBiConsumer): JObject; cdecl;
function count: Int64; cdecl;
function distinct: JDoubleStream; cdecl;
function filter(predicate: JDoublePredicate): JDoubleStream; cdecl;
function findAny: JOptionalDouble; cdecl;
function findFirst: JOptionalDouble; cdecl;
function flatMap(mapper: JDoubleFunction): JDoubleStream; cdecl;
procedure forEach(action: JDoubleConsumer); cdecl;
procedure forEachOrdered(action: JDoubleConsumer); cdecl;
function iterator: JPrimitiveIterator_OfDouble; cdecl;
function limit(maxSize: Int64): JDoubleStream; cdecl;
function map(mapper: JDoubleUnaryOperator): JDoubleStream; cdecl;
function mapToInt(mapper: JDoubleToIntFunction): JIntStream; cdecl;
function mapToLong(mapper: JDoubleToLongFunction): JLongStream; cdecl;
function mapToObj(mapper: JDoubleFunction): JStream; cdecl;
function max: JOptionalDouble; cdecl;
function min: JOptionalDouble; cdecl;
function noneMatch(predicate: JDoublePredicate): Boolean; cdecl;
function parallel: JDoubleStream; cdecl;
function peek(action: JDoubleConsumer): JDoubleStream; cdecl;
function reduce(identity: Double; op: JDoubleBinaryOperator): Double; cdecl; overload;
function reduce(op: JDoubleBinaryOperator): JOptionalDouble; cdecl; overload;
function sequential: JDoubleStream; cdecl;
function skip(n: Int64): JDoubleStream; cdecl;
function sorted: JDoubleStream; cdecl;
function spliterator: JSpliterator_OfDouble; cdecl;
function sum: Double; cdecl;
function summaryStatistics: JDoubleSummaryStatistics; cdecl;
function toArray: TJavaArray<Double>; cdecl;
end;
TJDoubleStream = class(TJavaGenericImport<JDoubleStreamClass, JDoubleStream>) end;
JDoubleStream_BuilderClass = interface(JDoubleConsumerClass)
['{E739E1BA-B586-40D0-9543-C66C44240530}']
end;
[JavaSignature('java/util/stream/DoubleStream$Builder')]
JDoubleStream_Builder = interface(JDoubleConsumer)
['{A28F5ABA-FEC8-464E-900A-8961BCEC88FF}']
procedure accept(t: Double); cdecl;
function add(t: Double): JDoubleStream_Builder; cdecl;
function build: JDoubleStream; cdecl;
end;
TJDoubleStream_Builder = class(TJavaGenericImport<JDoubleStream_BuilderClass, JDoubleStream_Builder>) end;
JIntStreamClass = interface(JBaseStreamClass)
['{CD655857-02FE-49E8-B588-78727AACA18C}']
{class} function builder: JIntStream_Builder; cdecl;
{class} function concat(a: JIntStream; b: JIntStream): JIntStream; cdecl;
{class} function empty: JIntStream; cdecl;
{class} function generate(s: JIntSupplier): JIntStream; cdecl;
{class} function iterate(seed: Integer; f: JIntUnaryOperator): JIntStream; cdecl;
{class} function &of(t: Integer): JIntStream; cdecl;
{class} function range(startInclusive: Integer; endExclusive: Integer): JIntStream; cdecl;
{class} function rangeClosed(startInclusive: Integer; endInclusive: Integer): JIntStream; cdecl;
end;
[JavaSignature('java/util/stream/IntStream')]
JIntStream = interface(JBaseStream)
['{65798DE6-8E1C-4B04-A08E-7AEC37CB5191}']
function allMatch(predicate: JIntPredicate): Boolean; cdecl;
function anyMatch(predicate: JIntPredicate): Boolean; cdecl;
function asDoubleStream: JDoubleStream; cdecl;
function asLongStream: JLongStream; cdecl;
function average: JOptionalDouble; cdecl;
function boxed: JStream; cdecl;
function collect(supplier: JSupplier; accumulator: JObjIntConsumer; combiner: JBiConsumer): JObject; cdecl;
function count: Int64; cdecl;
function distinct: JIntStream; cdecl;
function filter(predicate: JIntPredicate): JIntStream; cdecl;
function findAny: JOptionalInt; cdecl;
function findFirst: JOptionalInt; cdecl;
function flatMap(mapper: JIntFunction): JIntStream; cdecl;
procedure forEach(action: JIntConsumer); cdecl;
procedure forEachOrdered(action: JIntConsumer); cdecl;
function iterator: JPrimitiveIterator_OfInt; cdecl;
function limit(maxSize: Int64): JIntStream; cdecl;
function map(mapper: JIntUnaryOperator): JIntStream; cdecl;
function mapToDouble(mapper: JIntToDoubleFunction): JDoubleStream; cdecl;
function mapToLong(mapper: JIntToLongFunction): JLongStream; cdecl;
function mapToObj(mapper: JIntFunction): JStream; cdecl;
function max: JOptionalInt; cdecl;
function min: JOptionalInt; cdecl;
function noneMatch(predicate: JIntPredicate): Boolean; cdecl;
function parallel: JIntStream; cdecl;
function peek(action: JIntConsumer): JIntStream; cdecl;
function reduce(identity: Integer; op: JIntBinaryOperator): Integer; cdecl; overload;
function reduce(op: JIntBinaryOperator): JOptionalInt; cdecl; overload;
function sequential: JIntStream; cdecl;
function skip(n: Int64): JIntStream; cdecl;
function sorted: JIntStream; cdecl;
function spliterator: JSpliterator_OfInt; cdecl;
function sum: Integer; cdecl;
function summaryStatistics: JIntSummaryStatistics; cdecl;
function toArray: TJavaArray<Integer>; cdecl;
end;
TJIntStream = class(TJavaGenericImport<JIntStreamClass, JIntStream>) end;
JIntStream_BuilderClass = interface(JIntConsumerClass)
['{6FD46E4F-B49D-47D9-A113-1B809956B985}']
end;
[JavaSignature('java/util/stream/IntStream$Builder')]
JIntStream_Builder = interface(JIntConsumer)
['{CAF43F79-BE72-4EDF-B95B-88CEE7CC481F}']
procedure accept(t: Integer); cdecl;
function add(t: Integer): JIntStream_Builder; cdecl;
function build: JIntStream; cdecl;
end;
TJIntStream_Builder = class(TJavaGenericImport<JIntStream_BuilderClass, JIntStream_Builder>) end;
JLongStreamClass = interface(JBaseStreamClass)
['{6E183054-70C7-474E-86FB-87148FBCF269}']
{class} function builder: JLongStream_Builder; cdecl;
{class} function concat(a: JLongStream; b: JLongStream): JLongStream; cdecl;
{class} function empty: JLongStream; cdecl;
{class} function generate(s: JLongSupplier): JLongStream; cdecl;
{class} function iterate(seed: Int64; f: JLongUnaryOperator): JLongStream; cdecl;
{class} function &of(t: Int64): JLongStream; cdecl;
{class} function range(startInclusive: Int64; endExclusive: Int64): JLongStream; cdecl;
{class} function rangeClosed(startInclusive: Int64; endInclusive: Int64): JLongStream; cdecl;
end;
[JavaSignature('java/util/stream/LongStream')]
JLongStream = interface(JBaseStream)
['{BABCDCF8-897E-4660-B04B-F45B5B4E4A21}']
function allMatch(predicate: JLongPredicate): Boolean; cdecl;
function anyMatch(predicate: JLongPredicate): Boolean; cdecl;
function asDoubleStream: JDoubleStream; cdecl;
function average: JOptionalDouble; cdecl;
function boxed: JStream; cdecl;
function collect(supplier: JSupplier; accumulator: JObjLongConsumer; combiner: JBiConsumer): JObject; cdecl;
function count: Int64; cdecl;
function distinct: JLongStream; cdecl;
function filter(predicate: JLongPredicate): JLongStream; cdecl;
function findAny: JOptionalLong; cdecl;
function findFirst: JOptionalLong; cdecl;
function flatMap(mapper: JLongFunction): JLongStream; cdecl;
procedure forEach(action: JLongConsumer); cdecl;
procedure forEachOrdered(action: JLongConsumer); cdecl;
function iterator: JPrimitiveIterator_OfLong; cdecl;
function limit(maxSize: Int64): JLongStream; cdecl;
function map(mapper: JLongUnaryOperator): JLongStream; cdecl;
function mapToDouble(mapper: JLongToDoubleFunction): JDoubleStream; cdecl;
function mapToInt(mapper: JLongToIntFunction): JIntStream; cdecl;
function mapToObj(mapper: JLongFunction): JStream; cdecl;
function max: JOptionalLong; cdecl;
function min: JOptionalLong; cdecl;
function noneMatch(predicate: JLongPredicate): Boolean; cdecl;
function parallel: JLongStream; cdecl;
function peek(action: JLongConsumer): JLongStream; cdecl;
function reduce(identity: Int64; op: JLongBinaryOperator): Int64; cdecl; overload;
function reduce(op: JLongBinaryOperator): JOptionalLong; cdecl; overload;
function sequential: JLongStream; cdecl;
function skip(n: Int64): JLongStream; cdecl;
function sorted: JLongStream; cdecl;
function spliterator: JSpliterator_OfLong; cdecl;
function sum: Int64; cdecl;
function summaryStatistics: JLongSummaryStatistics; cdecl;
function toArray: TJavaArray<Int64>; cdecl;
end;
TJLongStream = class(TJavaGenericImport<JLongStreamClass, JLongStream>) end;
JLongStream_BuilderClass = interface(JLongConsumerClass)
['{D47F1A08-EB28-4A70-81C0-328CEEABBF6D}']
end;
[JavaSignature('java/util/stream/LongStream$Builder')]
JLongStream_Builder = interface(JLongConsumer)
['{6E420622-1F87-4BAC-8942-1125F58F9363}']
procedure accept(t: Int64); cdecl;
function add(t: Int64): JLongStream_Builder; cdecl;
function build: JLongStream; cdecl;
end;
TJLongStream_Builder = class(TJavaGenericImport<JLongStream_BuilderClass, JLongStream_Builder>) end;
JStreamClass = interface(JBaseStreamClass)
['{C6C02319-044E-41E7-A2E6-5E8987B0B603}']
{class} function builder: JStream_Builder; cdecl;
{class} function concat(a: JStream; b: JStream): JStream; cdecl;
{class} function empty: JStream; cdecl;
{class} function generate(s: JSupplier): JStream; cdecl;
{class} function iterate(seed: JObject; f: JUnaryOperator): JStream; cdecl;
{class} function &of(t: JObject): JStream; cdecl;
end;
[JavaSignature('java/util/stream/Stream')]
JStream = interface(JBaseStream)
['{7E174099-DA5F-4688-988D-0EA1C64A2DCC}']
function allMatch(predicate: Jfunction_Predicate): Boolean; cdecl;
function anyMatch(predicate: Jfunction_Predicate): Boolean; cdecl;
function collect(supplier: JSupplier; accumulator: JBiConsumer; combiner: JBiConsumer): JObject; cdecl; overload;
function collect(collector: JCollector): JObject; cdecl; overload;
function count: Int64; cdecl;
function distinct: JStream; cdecl;
function filter(predicate: Jfunction_Predicate): JStream; cdecl;
function findAny: JOptional; cdecl;
function findFirst: JOptional; cdecl;
function flatMap(mapper: JFunction): JStream; cdecl;
function flatMapToDouble(mapper: JFunction): JDoubleStream; cdecl;
function flatMapToInt(mapper: JFunction): JIntStream; cdecl;
function flatMapToLong(mapper: JFunction): JLongStream; cdecl;
procedure forEach(action: JConsumer); cdecl;
procedure forEachOrdered(action: JConsumer); cdecl;
function limit(maxSize: Int64): JStream; cdecl;
function map(mapper: JFunction): JStream; cdecl;
function mapToDouble(mapper: JToDoubleFunction): JDoubleStream; cdecl;
function mapToInt(mapper: JToIntFunction): JIntStream; cdecl;
function mapToLong(mapper: JToLongFunction): JLongStream; cdecl;
function max(comparator: JComparator): JOptional; cdecl;
function min(comparator: JComparator): JOptional; cdecl;
function noneMatch(predicate: Jfunction_Predicate): Boolean; cdecl;
function peek(action: JConsumer): JStream; cdecl;
function reduce(identity: JObject; accumulator: JBinaryOperator): JObject; cdecl; overload;
function reduce(accumulator: JBinaryOperator): JOptional; cdecl; overload;
function reduce(identity: JObject; accumulator: JBiFunction; combiner: JBinaryOperator): JObject; cdecl; overload;
function skip(n: Int64): JStream; cdecl;
function sorted: JStream; cdecl; overload;
function sorted(comparator: JComparator): JStream; cdecl; overload;
function toArray: TJavaObjectArray<JObject>; cdecl; overload;
function toArray(generator: TJavaObjectArray<JIntFunction>): TJavaObjectArray<JObject>; cdecl; overload;
end;
TJStream = class(TJavaGenericImport<JStreamClass, JStream>) end;
JStream_BuilderClass = interface(JConsumerClass)
['{77DB3AD9-08BF-43EA-B626-4135D84B9B25}']
end;
[JavaSignature('java/util/stream/Stream$Builder')]
JStream_Builder = interface(JConsumer)
['{D40E2B21-0D4B-4D1A-BA45-73BDFEA685A4}']
procedure accept(t: JObject); cdecl;
function add(t: JObject): JStream_Builder; cdecl;
function build: JStream; cdecl;
end;
TJStream_Builder = class(TJavaGenericImport<JStream_BuilderClass, JStream_Builder>) end;
// javax.crypto.SecretKey
JEGLClass = interface(IJavaClass)
['{79C069DA-2C75-4159-BE9D-A05ACE86FDCE}']
end;
[JavaSignature('javax/microedition/khronos/egl/EGL')]
JEGL = interface(IJavaInstance)
['{90E8D73C-9FF7-4CA4-B661-6A58F6A3C6C8}']
end;
TJEGL = class(TJavaGenericImport<JEGLClass, JEGL>) end;
JEGL10Class = interface(JEGLClass)
['{D1DB03A9-8FA6-44E2-BB75-AE16D5A11CA2}']
{class} function _GetEGL_ALPHA_FORMAT: Integer; cdecl;
{class} function _GetEGL_ALPHA_MASK_SIZE: Integer; cdecl;
{class} function _GetEGL_ALPHA_SIZE: Integer; cdecl;
{class} function _GetEGL_BAD_ACCESS: Integer; cdecl;
{class} function _GetEGL_BAD_ALLOC: Integer; cdecl;
{class} function _GetEGL_BAD_ATTRIBUTE: Integer; cdecl;
{class} function _GetEGL_BAD_CONFIG: Integer; cdecl;
{class} function _GetEGL_BAD_CONTEXT: Integer; cdecl;
{class} function _GetEGL_BAD_CURRENT_SURFACE: Integer; cdecl;
{class} function _GetEGL_BAD_DISPLAY: Integer; cdecl;
{class} function _GetEGL_BAD_MATCH: Integer; cdecl;
{class} function _GetEGL_BAD_NATIVE_PIXMAP: Integer; cdecl;
{class} function _GetEGL_BAD_NATIVE_WINDOW: Integer; cdecl;
{class} function _GetEGL_BAD_PARAMETER: Integer; cdecl;
{class} function _GetEGL_BAD_SURFACE: Integer; cdecl;
{class} function _GetEGL_BLUE_SIZE: Integer; cdecl;
{class} function _GetEGL_BUFFER_SIZE: Integer; cdecl;
{class} function _GetEGL_COLORSPACE: Integer; cdecl;
{class} function _GetEGL_COLOR_BUFFER_TYPE: Integer; cdecl;
{class} function _GetEGL_CONFIG_CAVEAT: Integer; cdecl;
{class} function _GetEGL_CONFIG_ID: Integer; cdecl;
{class} function _GetEGL_CORE_NATIVE_ENGINE: Integer; cdecl;
{class} function _GetEGL_DEFAULT_DISPLAY: JObject; cdecl;
{class} function _GetEGL_DEPTH_SIZE: Integer; cdecl;
{class} function _GetEGL_DONT_CARE: Integer; cdecl;
{class} function _GetEGL_DRAW: Integer; cdecl;
{class} function _GetEGL_EXTENSIONS: Integer; cdecl;
{class} function _GetEGL_GREEN_SIZE: Integer; cdecl;
{class} function _GetEGL_HEIGHT: Integer; cdecl;
{class} function _GetEGL_HORIZONTAL_RESOLUTION: Integer; cdecl;
{class} function _GetEGL_LARGEST_PBUFFER: Integer; cdecl;
{class} function _GetEGL_LEVEL: Integer; cdecl;
{class} function _GetEGL_LUMINANCE_BUFFER: Integer; cdecl;
{class} function _GetEGL_LUMINANCE_SIZE: Integer; cdecl;
{class} function _GetEGL_MAX_PBUFFER_HEIGHT: Integer; cdecl;
{class} function _GetEGL_MAX_PBUFFER_PIXELS: Integer; cdecl;
{class} function _GetEGL_MAX_PBUFFER_WIDTH: Integer; cdecl;
{class} function _GetEGL_NATIVE_RENDERABLE: Integer; cdecl;
{class} function _GetEGL_NATIVE_VISUAL_ID: Integer; cdecl;
{class} function _GetEGL_NATIVE_VISUAL_TYPE: Integer; cdecl;
{class} function _GetEGL_NONE: Integer; cdecl;
{class} function _GetEGL_NON_CONFORMANT_CONFIG: Integer; cdecl;
{class} function _GetEGL_NOT_INITIALIZED: Integer; cdecl;
{class} function _GetEGL_NO_CONTEXT: JEGLContext; cdecl;
{class} function _GetEGL_NO_DISPLAY: JEGLDisplay; cdecl;
{class} function _GetEGL_NO_SURFACE: JEGLSurface; cdecl;
{class} function _GetEGL_PBUFFER_BIT: Integer; cdecl;
{class} function _GetEGL_PIXEL_ASPECT_RATIO: Integer; cdecl;
{class} function _GetEGL_PIXMAP_BIT: Integer; cdecl;
{class} function _GetEGL_READ: Integer; cdecl;
{class} function _GetEGL_RED_SIZE: Integer; cdecl;
{class} function _GetEGL_RENDERABLE_TYPE: Integer; cdecl;
{class} function _GetEGL_RENDER_BUFFER: Integer; cdecl;
{class} function _GetEGL_RGB_BUFFER: Integer; cdecl;
{class} function _GetEGL_SAMPLES: Integer; cdecl;
{class} function _GetEGL_SAMPLE_BUFFERS: Integer; cdecl;
{class} function _GetEGL_SINGLE_BUFFER: Integer; cdecl;
{class} function _GetEGL_SLOW_CONFIG: Integer; cdecl;
{class} function _GetEGL_STENCIL_SIZE: Integer; cdecl;
{class} function _GetEGL_SUCCESS: Integer; cdecl;
{class} function _GetEGL_SURFACE_TYPE: Integer; cdecl;
{class} function _GetEGL_TRANSPARENT_BLUE_VALUE: Integer; cdecl;
{class} function _GetEGL_TRANSPARENT_GREEN_VALUE: Integer; cdecl;
{class} function _GetEGL_TRANSPARENT_RED_VALUE: Integer; cdecl;
{class} function _GetEGL_TRANSPARENT_RGB: Integer; cdecl;
{class} function _GetEGL_TRANSPARENT_TYPE: Integer; cdecl;
{class} function _GetEGL_VENDOR: Integer; cdecl;
{class} function _GetEGL_VERSION: Integer; cdecl;
{class} function _GetEGL_VERTICAL_RESOLUTION: Integer; cdecl;
{class} function _GetEGL_WIDTH: Integer; cdecl;
{class} function _GetEGL_WINDOW_BIT: Integer; cdecl;
{class} property EGL_ALPHA_FORMAT: Integer read _GetEGL_ALPHA_FORMAT;
{class} property EGL_ALPHA_MASK_SIZE: Integer read _GetEGL_ALPHA_MASK_SIZE;
{class} property EGL_ALPHA_SIZE: Integer read _GetEGL_ALPHA_SIZE;
{class} property EGL_BAD_ACCESS: Integer read _GetEGL_BAD_ACCESS;
{class} property EGL_BAD_ALLOC: Integer read _GetEGL_BAD_ALLOC;
{class} property EGL_BAD_ATTRIBUTE: Integer read _GetEGL_BAD_ATTRIBUTE;
{class} property EGL_BAD_CONFIG: Integer read _GetEGL_BAD_CONFIG;
{class} property EGL_BAD_CONTEXT: Integer read _GetEGL_BAD_CONTEXT;
{class} property EGL_BAD_CURRENT_SURFACE: Integer read _GetEGL_BAD_CURRENT_SURFACE;
{class} property EGL_BAD_DISPLAY: Integer read _GetEGL_BAD_DISPLAY;
{class} property EGL_BAD_MATCH: Integer read _GetEGL_BAD_MATCH;
{class} property EGL_BAD_NATIVE_PIXMAP: Integer read _GetEGL_BAD_NATIVE_PIXMAP;
{class} property EGL_BAD_NATIVE_WINDOW: Integer read _GetEGL_BAD_NATIVE_WINDOW;
{class} property EGL_BAD_PARAMETER: Integer read _GetEGL_BAD_PARAMETER;
{class} property EGL_BAD_SURFACE: Integer read _GetEGL_BAD_SURFACE;
{class} property EGL_BLUE_SIZE: Integer read _GetEGL_BLUE_SIZE;
{class} property EGL_BUFFER_SIZE: Integer read _GetEGL_BUFFER_SIZE;
{class} property EGL_COLORSPACE: Integer read _GetEGL_COLORSPACE;
{class} property EGL_COLOR_BUFFER_TYPE: Integer read _GetEGL_COLOR_BUFFER_TYPE;
{class} property EGL_CONFIG_CAVEAT: Integer read _GetEGL_CONFIG_CAVEAT;
{class} property EGL_CONFIG_ID: Integer read _GetEGL_CONFIG_ID;
{class} property EGL_CORE_NATIVE_ENGINE: Integer read _GetEGL_CORE_NATIVE_ENGINE;
{class} property EGL_DEFAULT_DISPLAY: JObject read _GetEGL_DEFAULT_DISPLAY;
{class} property EGL_DEPTH_SIZE: Integer read _GetEGL_DEPTH_SIZE;
{class} property EGL_DONT_CARE: Integer read _GetEGL_DONT_CARE;
{class} property EGL_DRAW: Integer read _GetEGL_DRAW;
{class} property EGL_EXTENSIONS: Integer read _GetEGL_EXTENSIONS;
{class} property EGL_GREEN_SIZE: Integer read _GetEGL_GREEN_SIZE;
{class} property EGL_HEIGHT: Integer read _GetEGL_HEIGHT;
{class} property EGL_HORIZONTAL_RESOLUTION: Integer read _GetEGL_HORIZONTAL_RESOLUTION;
{class} property EGL_LARGEST_PBUFFER: Integer read _GetEGL_LARGEST_PBUFFER;
{class} property EGL_LEVEL: Integer read _GetEGL_LEVEL;
{class} property EGL_LUMINANCE_BUFFER: Integer read _GetEGL_LUMINANCE_BUFFER;
{class} property EGL_LUMINANCE_SIZE: Integer read _GetEGL_LUMINANCE_SIZE;
{class} property EGL_MAX_PBUFFER_HEIGHT: Integer read _GetEGL_MAX_PBUFFER_HEIGHT;
{class} property EGL_MAX_PBUFFER_PIXELS: Integer read _GetEGL_MAX_PBUFFER_PIXELS;
{class} property EGL_MAX_PBUFFER_WIDTH: Integer read _GetEGL_MAX_PBUFFER_WIDTH;
{class} property EGL_NATIVE_RENDERABLE: Integer read _GetEGL_NATIVE_RENDERABLE;
{class} property EGL_NATIVE_VISUAL_ID: Integer read _GetEGL_NATIVE_VISUAL_ID;
{class} property EGL_NATIVE_VISUAL_TYPE: Integer read _GetEGL_NATIVE_VISUAL_TYPE;
{class} property EGL_NONE: Integer read _GetEGL_NONE;
{class} property EGL_NON_CONFORMANT_CONFIG: Integer read _GetEGL_NON_CONFORMANT_CONFIG;
{class} property EGL_NOT_INITIALIZED: Integer read _GetEGL_NOT_INITIALIZED;
{class} property EGL_NO_CONTEXT: JEGLContext read _GetEGL_NO_CONTEXT;
{class} property EGL_NO_DISPLAY: JEGLDisplay read _GetEGL_NO_DISPLAY;
{class} property EGL_NO_SURFACE: JEGLSurface read _GetEGL_NO_SURFACE;
{class} property EGL_PBUFFER_BIT: Integer read _GetEGL_PBUFFER_BIT;
{class} property EGL_PIXEL_ASPECT_RATIO: Integer read _GetEGL_PIXEL_ASPECT_RATIO;
{class} property EGL_PIXMAP_BIT: Integer read _GetEGL_PIXMAP_BIT;
{class} property EGL_READ: Integer read _GetEGL_READ;
{class} property EGL_RED_SIZE: Integer read _GetEGL_RED_SIZE;
{class} property EGL_RENDERABLE_TYPE: Integer read _GetEGL_RENDERABLE_TYPE;
{class} property EGL_RENDER_BUFFER: Integer read _GetEGL_RENDER_BUFFER;
{class} property EGL_RGB_BUFFER: Integer read _GetEGL_RGB_BUFFER;
{class} property EGL_SAMPLES: Integer read _GetEGL_SAMPLES;
{class} property EGL_SAMPLE_BUFFERS: Integer read _GetEGL_SAMPLE_BUFFERS;
{class} property EGL_SINGLE_BUFFER: Integer read _GetEGL_SINGLE_BUFFER;
{class} property EGL_SLOW_CONFIG: Integer read _GetEGL_SLOW_CONFIG;
{class} property EGL_STENCIL_SIZE: Integer read _GetEGL_STENCIL_SIZE;
{class} property EGL_SUCCESS: Integer read _GetEGL_SUCCESS;
{class} property EGL_SURFACE_TYPE: Integer read _GetEGL_SURFACE_TYPE;
{class} property EGL_TRANSPARENT_BLUE_VALUE: Integer read _GetEGL_TRANSPARENT_BLUE_VALUE;
{class} property EGL_TRANSPARENT_GREEN_VALUE: Integer read _GetEGL_TRANSPARENT_GREEN_VALUE;
{class} property EGL_TRANSPARENT_RED_VALUE: Integer read _GetEGL_TRANSPARENT_RED_VALUE;
{class} property EGL_TRANSPARENT_RGB: Integer read _GetEGL_TRANSPARENT_RGB;
{class} property EGL_TRANSPARENT_TYPE: Integer read _GetEGL_TRANSPARENT_TYPE;
{class} property EGL_VENDOR: Integer read _GetEGL_VENDOR;
{class} property EGL_VERSION: Integer read _GetEGL_VERSION;
{class} property EGL_VERTICAL_RESOLUTION: Integer read _GetEGL_VERTICAL_RESOLUTION;
{class} property EGL_WIDTH: Integer read _GetEGL_WIDTH;
{class} property EGL_WINDOW_BIT: Integer read _GetEGL_WINDOW_BIT;
end;
[JavaSignature('javax/microedition/khronos/egl/EGL10')]
JEGL10 = interface(JEGL)
['{5178914E-D8BE-44D4-AD82-ADE844D55BEE}']
function eglChooseConfig(display: JEGLDisplay; attrib_list: TJavaArray<Integer>; configs: TJavaObjectArray<JEGLConfig>; config_size: Integer; num_config: TJavaArray<Integer>): Boolean; cdecl;
function eglCopyBuffers(display: JEGLDisplay; surface: JEGLSurface; native_pixmap: JObject): Boolean; cdecl;
function eglCreateContext(display: JEGLDisplay; config: JEGLConfig; share_context: JEGLContext; attrib_list: TJavaArray<Integer>): JEGLContext; cdecl;
function eglCreatePbufferSurface(display: JEGLDisplay; config: JEGLConfig; attrib_list: TJavaArray<Integer>): JEGLSurface; cdecl;
function eglCreatePixmapSurface(display: JEGLDisplay; config: JEGLConfig; native_pixmap: JObject; attrib_list: TJavaArray<Integer>): JEGLSurface; cdecl;//Deprecated
function eglCreateWindowSurface(display: JEGLDisplay; config: JEGLConfig; native_window: JObject; attrib_list: TJavaArray<Integer>): JEGLSurface; cdecl;
function eglDestroyContext(display: JEGLDisplay; context: JEGLContext): Boolean; cdecl;
function eglDestroySurface(display: JEGLDisplay; surface: JEGLSurface): Boolean; cdecl;
function eglGetConfigAttrib(display: JEGLDisplay; config: JEGLConfig; attribute: Integer; value: TJavaArray<Integer>): Boolean; cdecl;
function eglGetConfigs(display: JEGLDisplay; configs: TJavaObjectArray<JEGLConfig>; config_size: Integer; num_config: TJavaArray<Integer>): Boolean; cdecl;
function eglGetCurrentContext: JEGLContext; cdecl;
function eglGetCurrentDisplay: JEGLDisplay; cdecl;
function eglGetCurrentSurface(readdraw: Integer): JEGLSurface; cdecl;
function eglGetDisplay(native_display: JObject): JEGLDisplay; cdecl;
function eglGetError: Integer; cdecl;
function eglInitialize(display: JEGLDisplay; major_minor: TJavaArray<Integer>): Boolean; cdecl;
function eglMakeCurrent(display: JEGLDisplay; draw: JEGLSurface; read: JEGLSurface; context: JEGLContext): Boolean; cdecl;
function eglQueryContext(display: JEGLDisplay; context: JEGLContext; attribute: Integer; value: TJavaArray<Integer>): Boolean; cdecl;
function eglQueryString(display: JEGLDisplay; name: Integer): JString; cdecl;
function eglQuerySurface(display: JEGLDisplay; surface: JEGLSurface; attribute: Integer; value: TJavaArray<Integer>): Boolean; cdecl;
function eglSwapBuffers(display: JEGLDisplay; surface: JEGLSurface): Boolean; cdecl;
function eglTerminate(display: JEGLDisplay): Boolean; cdecl;
function eglWaitGL: Boolean; cdecl;
function eglWaitNative(engine: Integer; bindTarget: JObject): Boolean; cdecl;
end;
TJEGL10 = class(TJavaGenericImport<JEGL10Class, JEGL10>) end;
JEGLConfigClass = interface(JObjectClass)
['{96A2CBA0-853E-45DC-95EA-AA707DA29569}']
{class} function init: JEGLConfig; cdecl;
end;
[JavaSignature('javax/microedition/khronos/egl/EGLConfig')]
JEGLConfig = interface(JObject)
['{2647F2E5-3A3D-4D51-AB8D-5819899D7B8E}']
end;
TJEGLConfig = class(TJavaGenericImport<JEGLConfigClass, JEGLConfig>) end;
JEGLContextClass = interface(JObjectClass)
['{75CB0600-343C-4078-A743-40B5C9E79FFF}']
{class} function init: JEGLContext; cdecl;
{class} function getEGL: JEGL; cdecl;
end;
[JavaSignature('javax/microedition/khronos/egl/EGLContext')]
JEGLContext = interface(JObject)
['{768D920B-DB0B-4278-B16D-226D7BF1A971}']
function getGL: JGL; cdecl;
end;
TJEGLContext = class(TJavaGenericImport<JEGLContextClass, JEGLContext>) end;
JEGLDisplayClass = interface(JObjectClass)
['{1BCD3FCD-D59F-4D36-A5D2-F7492B04669F}']
{class} function init: JEGLDisplay; cdecl;
end;
[JavaSignature('javax/microedition/khronos/egl/EGLDisplay')]
JEGLDisplay = interface(JObject)
['{CB130B2B-7534-4FFF-9679-BD9B21F8FEC6}']
end;
TJEGLDisplay = class(TJavaGenericImport<JEGLDisplayClass, JEGLDisplay>) end;
JEGLSurfaceClass = interface(JObjectClass)
['{E0F463FF-63B5-4F4D-BF36-6CDEDFE151EB}']
{class} function init: JEGLSurface; cdecl;
end;
[JavaSignature('javax/microedition/khronos/egl/EGLSurface')]
JEGLSurface = interface(JObject)
['{6BD5B09A-C1F7-4E46-A4E3-56F96C388D26}']
end;
TJEGLSurface = class(TJavaGenericImport<JEGLSurfaceClass, JEGLSurface>) end;
JGLClass = interface(IJavaClass)
['{9E0B1F51-CA90-4AEB-8D45-C34729067041}']
end;
[JavaSignature('javax/microedition/khronos/opengles/GL')]
JGL = interface(IJavaInstance)
['{210EA9DA-F5F9-4849-9FF2-28297F3CD7ED}']
end;
TJGL = class(TJavaGenericImport<JGLClass, JGL>) end;
JGL10Class = interface(JGLClass)
['{11B00106-3641-4149-833C-F2A15DD0A1FB}']
{class} function _GetGL_ADD: Integer; cdecl;
{class} function _GetGL_ALIASED_LINE_WIDTH_RANGE: Integer; cdecl;
{class} function _GetGL_ALIASED_POINT_SIZE_RANGE: Integer; cdecl;
{class} function _GetGL_ALPHA: Integer; cdecl;
{class} function _GetGL_ALPHA_BITS: Integer; cdecl;
{class} function _GetGL_ALPHA_TEST: Integer; cdecl;
{class} function _GetGL_ALWAYS: Integer; cdecl;
{class} function _GetGL_AMBIENT: Integer; cdecl;
{class} function _GetGL_AMBIENT_AND_DIFFUSE: Integer; cdecl;
{class} function _GetGL_AND: Integer; cdecl;
{class} function _GetGL_AND_INVERTED: Integer; cdecl;
{class} function _GetGL_AND_REVERSE: Integer; cdecl;
{class} function _GetGL_BACK: Integer; cdecl;
{class} function _GetGL_BLEND: Integer; cdecl;
{class} function _GetGL_BLUE_BITS: Integer; cdecl;
{class} function _GetGL_BYTE: Integer; cdecl;
{class} function _GetGL_CCW: Integer; cdecl;
{class} function _GetGL_CLAMP_TO_EDGE: Integer; cdecl;
{class} function _GetGL_CLEAR: Integer; cdecl;
{class} function _GetGL_COLOR_ARRAY: Integer; cdecl;
{class} function _GetGL_COLOR_BUFFER_BIT: Integer; cdecl;
{class} function _GetGL_COLOR_LOGIC_OP: Integer; cdecl;
{class} function _GetGL_COLOR_MATERIAL: Integer; cdecl;
{class} function _GetGL_COMPRESSED_TEXTURE_FORMATS: Integer; cdecl;
{class} function _GetGL_CONSTANT_ATTENUATION: Integer; cdecl;
{class} function _GetGL_COPY: Integer; cdecl;
{class} function _GetGL_COPY_INVERTED: Integer; cdecl;
{class} function _GetGL_CULL_FACE: Integer; cdecl;
{class} function _GetGL_CW: Integer; cdecl;
{class} function _GetGL_DECAL: Integer; cdecl;
{class} function _GetGL_DECR: Integer; cdecl;
{class} function _GetGL_DEPTH_BITS: Integer; cdecl;
{class} function _GetGL_DEPTH_BUFFER_BIT: Integer; cdecl;
{class} function _GetGL_DEPTH_TEST: Integer; cdecl;
{class} function _GetGL_DIFFUSE: Integer; cdecl;
{class} function _GetGL_DITHER: Integer; cdecl;
{class} function _GetGL_DONT_CARE: Integer; cdecl;
{class} function _GetGL_DST_ALPHA: Integer; cdecl;
{class} function _GetGL_DST_COLOR: Integer; cdecl;
{class} function _GetGL_EMISSION: Integer; cdecl;
{class} function _GetGL_EQUAL: Integer; cdecl;
{class} function _GetGL_EQUIV: Integer; cdecl;
{class} function _GetGL_EXP: Integer; cdecl;
{class} function _GetGL_EXP2: Integer; cdecl;
{class} function _GetGL_EXTENSIONS: Integer; cdecl;
{class} function _GetGL_FALSE: Integer; cdecl;
{class} function _GetGL_FASTEST: Integer; cdecl;
{class} function _GetGL_FIXED: Integer; cdecl;
{class} function _GetGL_FLAT: Integer; cdecl;
{class} function _GetGL_FLOAT: Integer; cdecl;
{class} function _GetGL_FOG: Integer; cdecl;
{class} function _GetGL_FOG_COLOR: Integer; cdecl;
{class} function _GetGL_FOG_DENSITY: Integer; cdecl;
{class} function _GetGL_FOG_END: Integer; cdecl;
{class} function _GetGL_FOG_HINT: Integer; cdecl;
{class} function _GetGL_FOG_MODE: Integer; cdecl;
{class} function _GetGL_FOG_START: Integer; cdecl;
{class} function _GetGL_FRONT: Integer; cdecl;
{class} function _GetGL_FRONT_AND_BACK: Integer; cdecl;
{class} function _GetGL_GEQUAL: Integer; cdecl;
{class} function _GetGL_GREATER: Integer; cdecl;
{class} function _GetGL_GREEN_BITS: Integer; cdecl;
{class} function _GetGL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: Integer; cdecl;
{class} function _GetGL_IMPLEMENTATION_COLOR_READ_TYPE_OES: Integer; cdecl;
{class} function _GetGL_INCR: Integer; cdecl;
{class} function _GetGL_INVALID_ENUM: Integer; cdecl;
{class} function _GetGL_INVALID_OPERATION: Integer; cdecl;
{class} function _GetGL_INVALID_VALUE: Integer; cdecl;
{class} function _GetGL_INVERT: Integer; cdecl;
{class} function _GetGL_KEEP: Integer; cdecl;
{class} function _GetGL_LEQUAL: Integer; cdecl;
{class} function _GetGL_LESS: Integer; cdecl;
{class} function _GetGL_LIGHT0: Integer; cdecl;
{class} function _GetGL_LIGHT1: Integer; cdecl;
{class} function _GetGL_LIGHT2: Integer; cdecl;
{class} function _GetGL_LIGHT3: Integer; cdecl;
{class} function _GetGL_LIGHT4: Integer; cdecl;
{class} function _GetGL_LIGHT5: Integer; cdecl;
{class} function _GetGL_LIGHT6: Integer; cdecl;
{class} function _GetGL_LIGHT7: Integer; cdecl;
{class} function _GetGL_LIGHTING: Integer; cdecl;
{class} function _GetGL_LIGHT_MODEL_AMBIENT: Integer; cdecl;
{class} function _GetGL_LIGHT_MODEL_TWO_SIDE: Integer; cdecl;
{class} function _GetGL_LINEAR: Integer; cdecl;
{class} function _GetGL_LINEAR_ATTENUATION: Integer; cdecl;
{class} function _GetGL_LINEAR_MIPMAP_LINEAR: Integer; cdecl;
{class} function _GetGL_LINEAR_MIPMAP_NEAREST: Integer; cdecl;
{class} function _GetGL_LINES: Integer; cdecl;
{class} function _GetGL_LINE_LOOP: Integer; cdecl;
{class} function _GetGL_LINE_SMOOTH: Integer; cdecl;
{class} function _GetGL_LINE_SMOOTH_HINT: Integer; cdecl;
{class} function _GetGL_LINE_STRIP: Integer; cdecl;
{class} function _GetGL_LUMINANCE: Integer; cdecl;
{class} function _GetGL_LUMINANCE_ALPHA: Integer; cdecl;
{class} function _GetGL_MAX_ELEMENTS_INDICES: Integer; cdecl;
{class} function _GetGL_MAX_ELEMENTS_VERTICES: Integer; cdecl;
{class} function _GetGL_MAX_LIGHTS: Integer; cdecl;
{class} function _GetGL_MAX_MODELVIEW_STACK_DEPTH: Integer; cdecl;
{class} function _GetGL_MAX_PROJECTION_STACK_DEPTH: Integer; cdecl;
{class} function _GetGL_MAX_TEXTURE_SIZE: Integer; cdecl;
{class} function _GetGL_MAX_TEXTURE_STACK_DEPTH: Integer; cdecl;
{class} function _GetGL_MAX_TEXTURE_UNITS: Integer; cdecl;
{class} function _GetGL_MAX_VIEWPORT_DIMS: Integer; cdecl;
{class} function _GetGL_MODELVIEW: Integer; cdecl;
{class} function _GetGL_MODULATE: Integer; cdecl;
{class} function _GetGL_MULTISAMPLE: Integer; cdecl;
{class} function _GetGL_NAND: Integer; cdecl;
{class} function _GetGL_NEAREST: Integer; cdecl;
{class} function _GetGL_NEAREST_MIPMAP_LINEAR: Integer; cdecl;
{class} function _GetGL_NEAREST_MIPMAP_NEAREST: Integer; cdecl;
{class} function _GetGL_NEVER: Integer; cdecl;
{class} function _GetGL_NICEST: Integer; cdecl;
{class} function _GetGL_NOOP: Integer; cdecl;
{class} function _GetGL_NOR: Integer; cdecl;
{class} function _GetGL_NORMALIZE: Integer; cdecl;
{class} function _GetGL_NORMAL_ARRAY: Integer; cdecl;
{class} function _GetGL_NOTEQUAL: Integer; cdecl;
{class} function _GetGL_NO_ERROR: Integer; cdecl;
{class} function _GetGL_NUM_COMPRESSED_TEXTURE_FORMATS: Integer; cdecl;
{class} function _GetGL_ONE: Integer; cdecl;
{class} function _GetGL_ONE_MINUS_DST_ALPHA: Integer; cdecl;
{class} function _GetGL_ONE_MINUS_DST_COLOR: Integer; cdecl;
{class} function _GetGL_ONE_MINUS_SRC_ALPHA: Integer; cdecl;
{class} function _GetGL_ONE_MINUS_SRC_COLOR: Integer; cdecl;
{class} function _GetGL_OR: Integer; cdecl;
{class} function _GetGL_OR_INVERTED: Integer; cdecl;
{class} function _GetGL_OR_REVERSE: Integer; cdecl;
{class} function _GetGL_OUT_OF_MEMORY: Integer; cdecl;
{class} function _GetGL_PACK_ALIGNMENT: Integer; cdecl;
{class} function _GetGL_PALETTE4_R5_G6_B5_OES: Integer; cdecl;
{class} function _GetGL_PALETTE4_RGB5_A1_OES: Integer; cdecl;
{class} function _GetGL_PALETTE4_RGB8_OES: Integer; cdecl;
{class} function _GetGL_PALETTE4_RGBA4_OES: Integer; cdecl;
{class} function _GetGL_PALETTE4_RGBA8_OES: Integer; cdecl;
{class} function _GetGL_PALETTE8_R5_G6_B5_OES: Integer; cdecl;
{class} function _GetGL_PALETTE8_RGB5_A1_OES: Integer; cdecl;
{class} function _GetGL_PALETTE8_RGB8_OES: Integer; cdecl;
{class} function _GetGL_PALETTE8_RGBA4_OES: Integer; cdecl;
{class} function _GetGL_PALETTE8_RGBA8_OES: Integer; cdecl;
{class} function _GetGL_PERSPECTIVE_CORRECTION_HINT: Integer; cdecl;
{class} function _GetGL_POINTS: Integer; cdecl;
{class} function _GetGL_POINT_FADE_THRESHOLD_SIZE: Integer; cdecl;
{class} function _GetGL_POINT_SIZE: Integer; cdecl;
{class} function _GetGL_POINT_SMOOTH: Integer; cdecl;
{class} function _GetGL_POINT_SMOOTH_HINT: Integer; cdecl;
{class} function _GetGL_POLYGON_OFFSET_FILL: Integer; cdecl;
{class} function _GetGL_POLYGON_SMOOTH_HINT: Integer; cdecl;
{class} function _GetGL_POSITION: Integer; cdecl;
{class} function _GetGL_PROJECTION: Integer; cdecl;
{class} function _GetGL_QUADRATIC_ATTENUATION: Integer; cdecl;
{class} function _GetGL_RED_BITS: Integer; cdecl;
{class} function _GetGL_RENDERER: Integer; cdecl;
{class} function _GetGL_REPEAT: Integer; cdecl;
{class} function _GetGL_REPLACE: Integer; cdecl;
{class} function _GetGL_RESCALE_NORMAL: Integer; cdecl;
{class} function _GetGL_RGB: Integer; cdecl;
{class} function _GetGL_RGBA: Integer; cdecl;
{class} function _GetGL_SAMPLE_ALPHA_TO_COVERAGE: Integer; cdecl;
{class} function _GetGL_SAMPLE_ALPHA_TO_ONE: Integer; cdecl;
{class} function _GetGL_SAMPLE_COVERAGE: Integer; cdecl;
{class} function _GetGL_SCISSOR_TEST: Integer; cdecl;
{class} function _GetGL_SET: Integer; cdecl;
{class} function _GetGL_SHININESS: Integer; cdecl;
{class} function _GetGL_SHORT: Integer; cdecl;
{class} function _GetGL_SMOOTH: Integer; cdecl;
{class} function _GetGL_SMOOTH_LINE_WIDTH_RANGE: Integer; cdecl;
{class} function _GetGL_SMOOTH_POINT_SIZE_RANGE: Integer; cdecl;
{class} function _GetGL_SPECULAR: Integer; cdecl;
{class} function _GetGL_SPOT_CUTOFF: Integer; cdecl;
{class} function _GetGL_SPOT_DIRECTION: Integer; cdecl;
{class} function _GetGL_SPOT_EXPONENT: Integer; cdecl;
{class} function _GetGL_SRC_ALPHA: Integer; cdecl;
{class} function _GetGL_SRC_ALPHA_SATURATE: Integer; cdecl;
{class} function _GetGL_SRC_COLOR: Integer; cdecl;
{class} function _GetGL_STACK_OVERFLOW: Integer; cdecl;
{class} function _GetGL_STACK_UNDERFLOW: Integer; cdecl;
{class} function _GetGL_STENCIL_BITS: Integer; cdecl;
{class} function _GetGL_STENCIL_BUFFER_BIT: Integer; cdecl;
{class} function _GetGL_STENCIL_TEST: Integer; cdecl;
{class} function _GetGL_SUBPIXEL_BITS: Integer; cdecl;
{class} function _GetGL_TEXTURE: Integer; cdecl;
{class} function _GetGL_TEXTURE0: Integer; cdecl;
{class} function _GetGL_TEXTURE1: Integer; cdecl;
{class} function _GetGL_TEXTURE10: Integer; cdecl;
{class} function _GetGL_TEXTURE11: Integer; cdecl;
{class} function _GetGL_TEXTURE12: Integer; cdecl;
{class} function _GetGL_TEXTURE13: Integer; cdecl;
{class} function _GetGL_TEXTURE14: Integer; cdecl;
{class} function _GetGL_TEXTURE15: Integer; cdecl;
{class} function _GetGL_TEXTURE16: Integer; cdecl;
{class} function _GetGL_TEXTURE17: Integer; cdecl;
{class} function _GetGL_TEXTURE18: Integer; cdecl;
{class} function _GetGL_TEXTURE19: Integer; cdecl;
{class} function _GetGL_TEXTURE2: Integer; cdecl;
{class} function _GetGL_TEXTURE20: Integer; cdecl;
{class} function _GetGL_TEXTURE21: Integer; cdecl;
{class} function _GetGL_TEXTURE22: Integer; cdecl;
{class} function _GetGL_TEXTURE23: Integer; cdecl;
{class} function _GetGL_TEXTURE24: Integer; cdecl;
{class} function _GetGL_TEXTURE25: Integer; cdecl;
{class} function _GetGL_TEXTURE26: Integer; cdecl;
{class} function _GetGL_TEXTURE27: Integer; cdecl;
{class} function _GetGL_TEXTURE28: Integer; cdecl;
{class} function _GetGL_TEXTURE29: Integer; cdecl;
{class} function _GetGL_TEXTURE3: Integer; cdecl;
{class} function _GetGL_TEXTURE30: Integer; cdecl;
{class} function _GetGL_TEXTURE31: Integer; cdecl;
{class} function _GetGL_TEXTURE4: Integer; cdecl;
{class} function _GetGL_TEXTURE5: Integer; cdecl;
{class} function _GetGL_TEXTURE6: Integer; cdecl;
{class} function _GetGL_TEXTURE7: Integer; cdecl;
{class} function _GetGL_TEXTURE8: Integer; cdecl;
{class} function _GetGL_TEXTURE9: Integer; cdecl;
{class} function _GetGL_TEXTURE_2D: Integer; cdecl;
{class} function _GetGL_TEXTURE_COORD_ARRAY: Integer; cdecl;
{class} function _GetGL_TEXTURE_ENV: Integer; cdecl;
{class} function _GetGL_TEXTURE_ENV_COLOR: Integer; cdecl;
{class} function _GetGL_TEXTURE_ENV_MODE: Integer; cdecl;
{class} function _GetGL_TEXTURE_MAG_FILTER: Integer; cdecl;
{class} function _GetGL_TEXTURE_MIN_FILTER: Integer; cdecl;
{class} function _GetGL_TEXTURE_WRAP_S: Integer; cdecl;
{class} function _GetGL_TEXTURE_WRAP_T: Integer; cdecl;
{class} function _GetGL_TRIANGLES: Integer; cdecl;
{class} function _GetGL_TRIANGLE_FAN: Integer; cdecl;
{class} function _GetGL_TRIANGLE_STRIP: Integer; cdecl;
{class} function _GetGL_TRUE: Integer; cdecl;
{class} function _GetGL_UNPACK_ALIGNMENT: Integer; cdecl;
{class} function _GetGL_UNSIGNED_BYTE: Integer; cdecl;
{class} function _GetGL_UNSIGNED_SHORT: Integer; cdecl;
{class} function _GetGL_UNSIGNED_SHORT_4_4_4_4: Integer; cdecl;
{class} function _GetGL_UNSIGNED_SHORT_5_5_5_1: Integer; cdecl;
{class} function _GetGL_UNSIGNED_SHORT_5_6_5: Integer; cdecl;
{class} function _GetGL_VENDOR: Integer; cdecl;
{class} function _GetGL_VERSION: Integer; cdecl;
{class} function _GetGL_VERTEX_ARRAY: Integer; cdecl;
{class} function _GetGL_XOR: Integer; cdecl;
{class} function _GetGL_ZERO: Integer; cdecl;
{class} property GL_ADD: Integer read _GetGL_ADD;
{class} property GL_ALIASED_LINE_WIDTH_RANGE: Integer read _GetGL_ALIASED_LINE_WIDTH_RANGE;
{class} property GL_ALIASED_POINT_SIZE_RANGE: Integer read _GetGL_ALIASED_POINT_SIZE_RANGE;
{class} property GL_ALPHA: Integer read _GetGL_ALPHA;
{class} property GL_ALPHA_BITS: Integer read _GetGL_ALPHA_BITS;
{class} property GL_ALPHA_TEST: Integer read _GetGL_ALPHA_TEST;
{class} property GL_ALWAYS: Integer read _GetGL_ALWAYS;
{class} property GL_AMBIENT: Integer read _GetGL_AMBIENT;
{class} property GL_AMBIENT_AND_DIFFUSE: Integer read _GetGL_AMBIENT_AND_DIFFUSE;
{class} property GL_AND: Integer read _GetGL_AND;
{class} property GL_AND_INVERTED: Integer read _GetGL_AND_INVERTED;
{class} property GL_AND_REVERSE: Integer read _GetGL_AND_REVERSE;
{class} property GL_BACK: Integer read _GetGL_BACK;
{class} property GL_BLEND: Integer read _GetGL_BLEND;
{class} property GL_BLUE_BITS: Integer read _GetGL_BLUE_BITS;
{class} property GL_BYTE: Integer read _GetGL_BYTE;
{class} property GL_CCW: Integer read _GetGL_CCW;
{class} property GL_CLAMP_TO_EDGE: Integer read _GetGL_CLAMP_TO_EDGE;
{class} property GL_CLEAR: Integer read _GetGL_CLEAR;
{class} property GL_COLOR_ARRAY: Integer read _GetGL_COLOR_ARRAY;
{class} property GL_COLOR_BUFFER_BIT: Integer read _GetGL_COLOR_BUFFER_BIT;
{class} property GL_COLOR_LOGIC_OP: Integer read _GetGL_COLOR_LOGIC_OP;
{class} property GL_COLOR_MATERIAL: Integer read _GetGL_COLOR_MATERIAL;
{class} property GL_COMPRESSED_TEXTURE_FORMATS: Integer read _GetGL_COMPRESSED_TEXTURE_FORMATS;
{class} property GL_CONSTANT_ATTENUATION: Integer read _GetGL_CONSTANT_ATTENUATION;
{class} property GL_COPY: Integer read _GetGL_COPY;
{class} property GL_COPY_INVERTED: Integer read _GetGL_COPY_INVERTED;
{class} property GL_CULL_FACE: Integer read _GetGL_CULL_FACE;
{class} property GL_CW: Integer read _GetGL_CW;
{class} property GL_DECAL: Integer read _GetGL_DECAL;
{class} property GL_DECR: Integer read _GetGL_DECR;
{class} property GL_DEPTH_BITS: Integer read _GetGL_DEPTH_BITS;
{class} property GL_DEPTH_BUFFER_BIT: Integer read _GetGL_DEPTH_BUFFER_BIT;
{class} property GL_DEPTH_TEST: Integer read _GetGL_DEPTH_TEST;
{class} property GL_DIFFUSE: Integer read _GetGL_DIFFUSE;
{class} property GL_DITHER: Integer read _GetGL_DITHER;
{class} property GL_DONT_CARE: Integer read _GetGL_DONT_CARE;
{class} property GL_DST_ALPHA: Integer read _GetGL_DST_ALPHA;
{class} property GL_DST_COLOR: Integer read _GetGL_DST_COLOR;
{class} property GL_EMISSION: Integer read _GetGL_EMISSION;
{class} property GL_EQUAL: Integer read _GetGL_EQUAL;
{class} property GL_EQUIV: Integer read _GetGL_EQUIV;
{class} property GL_EXP: Integer read _GetGL_EXP;
{class} property GL_EXP2: Integer read _GetGL_EXP2;
{class} property GL_EXTENSIONS: Integer read _GetGL_EXTENSIONS;
{class} property GL_FALSE: Integer read _GetGL_FALSE;
{class} property GL_FASTEST: Integer read _GetGL_FASTEST;
{class} property GL_FIXED: Integer read _GetGL_FIXED;
{class} property GL_FLAT: Integer read _GetGL_FLAT;
{class} property GL_FLOAT: Integer read _GetGL_FLOAT;
{class} property GL_FOG: Integer read _GetGL_FOG;
{class} property GL_FOG_COLOR: Integer read _GetGL_FOG_COLOR;
{class} property GL_FOG_DENSITY: Integer read _GetGL_FOG_DENSITY;
{class} property GL_FOG_END: Integer read _GetGL_FOG_END;
{class} property GL_FOG_HINT: Integer read _GetGL_FOG_HINT;
{class} property GL_FOG_MODE: Integer read _GetGL_FOG_MODE;
{class} property GL_FOG_START: Integer read _GetGL_FOG_START;
{class} property GL_FRONT: Integer read _GetGL_FRONT;
{class} property GL_FRONT_AND_BACK: Integer read _GetGL_FRONT_AND_BACK;
{class} property GL_GEQUAL: Integer read _GetGL_GEQUAL;
{class} property GL_GREATER: Integer read _GetGL_GREATER;
{class} property GL_GREEN_BITS: Integer read _GetGL_GREEN_BITS;
{class} property GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: Integer read _GetGL_IMPLEMENTATION_COLOR_READ_FORMAT_OES;
{class} property GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: Integer read _GetGL_IMPLEMENTATION_COLOR_READ_TYPE_OES;
{class} property GL_INCR: Integer read _GetGL_INCR;
{class} property GL_INVALID_ENUM: Integer read _GetGL_INVALID_ENUM;
{class} property GL_INVALID_OPERATION: Integer read _GetGL_INVALID_OPERATION;
{class} property GL_INVALID_VALUE: Integer read _GetGL_INVALID_VALUE;
{class} property GL_INVERT: Integer read _GetGL_INVERT;
{class} property GL_KEEP: Integer read _GetGL_KEEP;
{class} property GL_LEQUAL: Integer read _GetGL_LEQUAL;
{class} property GL_LESS: Integer read _GetGL_LESS;
{class} property GL_LIGHT0: Integer read _GetGL_LIGHT0;
{class} property GL_LIGHT1: Integer read _GetGL_LIGHT1;
{class} property GL_LIGHT2: Integer read _GetGL_LIGHT2;
{class} property GL_LIGHT3: Integer read _GetGL_LIGHT3;
{class} property GL_LIGHT4: Integer read _GetGL_LIGHT4;
{class} property GL_LIGHT5: Integer read _GetGL_LIGHT5;
{class} property GL_LIGHT6: Integer read _GetGL_LIGHT6;
{class} property GL_LIGHT7: Integer read _GetGL_LIGHT7;
{class} property GL_LIGHTING: Integer read _GetGL_LIGHTING;
{class} property GL_LIGHT_MODEL_AMBIENT: Integer read _GetGL_LIGHT_MODEL_AMBIENT;
{class} property GL_LIGHT_MODEL_TWO_SIDE: Integer read _GetGL_LIGHT_MODEL_TWO_SIDE;
{class} property GL_LINEAR: Integer read _GetGL_LINEAR;
{class} property GL_LINEAR_ATTENUATION: Integer read _GetGL_LINEAR_ATTENUATION;
{class} property GL_LINEAR_MIPMAP_LINEAR: Integer read _GetGL_LINEAR_MIPMAP_LINEAR;
{class} property GL_LINEAR_MIPMAP_NEAREST: Integer read _GetGL_LINEAR_MIPMAP_NEAREST;
{class} property GL_LINES: Integer read _GetGL_LINES;
{class} property GL_LINE_LOOP: Integer read _GetGL_LINE_LOOP;
{class} property GL_LINE_SMOOTH: Integer read _GetGL_LINE_SMOOTH;
{class} property GL_LINE_SMOOTH_HINT: Integer read _GetGL_LINE_SMOOTH_HINT;
{class} property GL_LINE_STRIP: Integer read _GetGL_LINE_STRIP;
{class} property GL_LUMINANCE: Integer read _GetGL_LUMINANCE;
{class} property GL_LUMINANCE_ALPHA: Integer read _GetGL_LUMINANCE_ALPHA;
{class} property GL_MAX_ELEMENTS_INDICES: Integer read _GetGL_MAX_ELEMENTS_INDICES;
{class} property GL_MAX_ELEMENTS_VERTICES: Integer read _GetGL_MAX_ELEMENTS_VERTICES;
{class} property GL_MAX_LIGHTS: Integer read _GetGL_MAX_LIGHTS;
{class} property GL_MAX_MODELVIEW_STACK_DEPTH: Integer read _GetGL_MAX_MODELVIEW_STACK_DEPTH;
{class} property GL_MAX_PROJECTION_STACK_DEPTH: Integer read _GetGL_MAX_PROJECTION_STACK_DEPTH;
{class} property GL_MAX_TEXTURE_SIZE: Integer read _GetGL_MAX_TEXTURE_SIZE;
{class} property GL_MAX_TEXTURE_STACK_DEPTH: Integer read _GetGL_MAX_TEXTURE_STACK_DEPTH;
{class} property GL_MAX_TEXTURE_UNITS: Integer read _GetGL_MAX_TEXTURE_UNITS;
{class} property GL_MAX_VIEWPORT_DIMS: Integer read _GetGL_MAX_VIEWPORT_DIMS;
{class} property GL_MODELVIEW: Integer read _GetGL_MODELVIEW;
{class} property GL_MODULATE: Integer read _GetGL_MODULATE;
{class} property GL_MULTISAMPLE: Integer read _GetGL_MULTISAMPLE;
{class} property GL_NAND: Integer read _GetGL_NAND;
{class} property GL_NEAREST: Integer read _GetGL_NEAREST;
{class} property GL_NEAREST_MIPMAP_LINEAR: Integer read _GetGL_NEAREST_MIPMAP_LINEAR;
{class} property GL_NEAREST_MIPMAP_NEAREST: Integer read _GetGL_NEAREST_MIPMAP_NEAREST;
{class} property GL_NEVER: Integer read _GetGL_NEVER;
{class} property GL_NICEST: Integer read _GetGL_NICEST;
{class} property GL_NOOP: Integer read _GetGL_NOOP;
{class} property GL_NOR: Integer read _GetGL_NOR;
{class} property GL_NORMALIZE: Integer read _GetGL_NORMALIZE;
{class} property GL_NORMAL_ARRAY: Integer read _GetGL_NORMAL_ARRAY;
{class} property GL_NOTEQUAL: Integer read _GetGL_NOTEQUAL;
{class} property GL_NO_ERROR: Integer read _GetGL_NO_ERROR;
{class} property GL_NUM_COMPRESSED_TEXTURE_FORMATS: Integer read _GetGL_NUM_COMPRESSED_TEXTURE_FORMATS;
{class} property GL_ONE: Integer read _GetGL_ONE;
{class} property GL_ONE_MINUS_DST_ALPHA: Integer read _GetGL_ONE_MINUS_DST_ALPHA;
{class} property GL_ONE_MINUS_DST_COLOR: Integer read _GetGL_ONE_MINUS_DST_COLOR;
{class} property GL_ONE_MINUS_SRC_ALPHA: Integer read _GetGL_ONE_MINUS_SRC_ALPHA;
{class} property GL_ONE_MINUS_SRC_COLOR: Integer read _GetGL_ONE_MINUS_SRC_COLOR;
{class} property GL_OR: Integer read _GetGL_OR;
{class} property GL_OR_INVERTED: Integer read _GetGL_OR_INVERTED;
{class} property GL_OR_REVERSE: Integer read _GetGL_OR_REVERSE;
{class} property GL_OUT_OF_MEMORY: Integer read _GetGL_OUT_OF_MEMORY;
{class} property GL_PACK_ALIGNMENT: Integer read _GetGL_PACK_ALIGNMENT;
{class} property GL_PALETTE4_R5_G6_B5_OES: Integer read _GetGL_PALETTE4_R5_G6_B5_OES;
{class} property GL_PALETTE4_RGB5_A1_OES: Integer read _GetGL_PALETTE4_RGB5_A1_OES;
{class} property GL_PALETTE4_RGB8_OES: Integer read _GetGL_PALETTE4_RGB8_OES;
{class} property GL_PALETTE4_RGBA4_OES: Integer read _GetGL_PALETTE4_RGBA4_OES;
{class} property GL_PALETTE4_RGBA8_OES: Integer read _GetGL_PALETTE4_RGBA8_OES;
{class} property GL_PALETTE8_R5_G6_B5_OES: Integer read _GetGL_PALETTE8_R5_G6_B5_OES;
{class} property GL_PALETTE8_RGB5_A1_OES: Integer read _GetGL_PALETTE8_RGB5_A1_OES;
{class} property GL_PALETTE8_RGB8_OES: Integer read _GetGL_PALETTE8_RGB8_OES;
{class} property GL_PALETTE8_RGBA4_OES: Integer read _GetGL_PALETTE8_RGBA4_OES;
{class} property GL_PALETTE8_RGBA8_OES: Integer read _GetGL_PALETTE8_RGBA8_OES;
{class} property GL_PERSPECTIVE_CORRECTION_HINT: Integer read _GetGL_PERSPECTIVE_CORRECTION_HINT;
{class} property GL_POINTS: Integer read _GetGL_POINTS;
{class} property GL_POINT_FADE_THRESHOLD_SIZE: Integer read _GetGL_POINT_FADE_THRESHOLD_SIZE;
{class} property GL_POINT_SIZE: Integer read _GetGL_POINT_SIZE;
{class} property GL_POINT_SMOOTH: Integer read _GetGL_POINT_SMOOTH;
{class} property GL_POINT_SMOOTH_HINT: Integer read _GetGL_POINT_SMOOTH_HINT;
{class} property GL_POLYGON_OFFSET_FILL: Integer read _GetGL_POLYGON_OFFSET_FILL;
{class} property GL_POLYGON_SMOOTH_HINT: Integer read _GetGL_POLYGON_SMOOTH_HINT;
{class} property GL_POSITION: Integer read _GetGL_POSITION;
{class} property GL_PROJECTION: Integer read _GetGL_PROJECTION;
{class} property GL_QUADRATIC_ATTENUATION: Integer read _GetGL_QUADRATIC_ATTENUATION;
{class} property GL_RED_BITS: Integer read _GetGL_RED_BITS;
{class} property GL_RENDERER: Integer read _GetGL_RENDERER;
{class} property GL_REPEAT: Integer read _GetGL_REPEAT;
{class} property GL_REPLACE: Integer read _GetGL_REPLACE;
{class} property GL_RESCALE_NORMAL: Integer read _GetGL_RESCALE_NORMAL;
{class} property GL_RGB: Integer read _GetGL_RGB;
{class} property GL_RGBA: Integer read _GetGL_RGBA;
{class} property GL_SAMPLE_ALPHA_TO_COVERAGE: Integer read _GetGL_SAMPLE_ALPHA_TO_COVERAGE;
{class} property GL_SAMPLE_ALPHA_TO_ONE: Integer read _GetGL_SAMPLE_ALPHA_TO_ONE;
{class} property GL_SAMPLE_COVERAGE: Integer read _GetGL_SAMPLE_COVERAGE;
{class} property GL_SCISSOR_TEST: Integer read _GetGL_SCISSOR_TEST;
{class} property GL_SET: Integer read _GetGL_SET;
{class} property GL_SHININESS: Integer read _GetGL_SHININESS;
{class} property GL_SHORT: Integer read _GetGL_SHORT;
{class} property GL_SMOOTH: Integer read _GetGL_SMOOTH;
{class} property GL_SMOOTH_LINE_WIDTH_RANGE: Integer read _GetGL_SMOOTH_LINE_WIDTH_RANGE;
{class} property GL_SMOOTH_POINT_SIZE_RANGE: Integer read _GetGL_SMOOTH_POINT_SIZE_RANGE;
{class} property GL_SPECULAR: Integer read _GetGL_SPECULAR;
{class} property GL_SPOT_CUTOFF: Integer read _GetGL_SPOT_CUTOFF;
{class} property GL_SPOT_DIRECTION: Integer read _GetGL_SPOT_DIRECTION;
{class} property GL_SPOT_EXPONENT: Integer read _GetGL_SPOT_EXPONENT;
{class} property GL_SRC_ALPHA: Integer read _GetGL_SRC_ALPHA;
{class} property GL_SRC_ALPHA_SATURATE: Integer read _GetGL_SRC_ALPHA_SATURATE;
{class} property GL_SRC_COLOR: Integer read _GetGL_SRC_COLOR;
{class} property GL_STACK_OVERFLOW: Integer read _GetGL_STACK_OVERFLOW;
{class} property GL_STACK_UNDERFLOW: Integer read _GetGL_STACK_UNDERFLOW;
{class} property GL_STENCIL_BITS: Integer read _GetGL_STENCIL_BITS;
{class} property GL_STENCIL_BUFFER_BIT: Integer read _GetGL_STENCIL_BUFFER_BIT;
{class} property GL_STENCIL_TEST: Integer read _GetGL_STENCIL_TEST;
{class} property GL_SUBPIXEL_BITS: Integer read _GetGL_SUBPIXEL_BITS;
{class} property GL_TEXTURE: Integer read _GetGL_TEXTURE;
{class} property GL_TEXTURE0: Integer read _GetGL_TEXTURE0;
{class} property GL_TEXTURE1: Integer read _GetGL_TEXTURE1;
{class} property GL_TEXTURE10: Integer read _GetGL_TEXTURE10;
{class} property GL_TEXTURE11: Integer read _GetGL_TEXTURE11;
{class} property GL_TEXTURE12: Integer read _GetGL_TEXTURE12;
{class} property GL_TEXTURE13: Integer read _GetGL_TEXTURE13;
{class} property GL_TEXTURE14: Integer read _GetGL_TEXTURE14;
{class} property GL_TEXTURE15: Integer read _GetGL_TEXTURE15;
{class} property GL_TEXTURE16: Integer read _GetGL_TEXTURE16;
{class} property GL_TEXTURE17: Integer read _GetGL_TEXTURE17;
{class} property GL_TEXTURE18: Integer read _GetGL_TEXTURE18;
{class} property GL_TEXTURE19: Integer read _GetGL_TEXTURE19;
{class} property GL_TEXTURE2: Integer read _GetGL_TEXTURE2;
{class} property GL_TEXTURE20: Integer read _GetGL_TEXTURE20;
{class} property GL_TEXTURE21: Integer read _GetGL_TEXTURE21;
{class} property GL_TEXTURE22: Integer read _GetGL_TEXTURE22;
{class} property GL_TEXTURE23: Integer read _GetGL_TEXTURE23;
{class} property GL_TEXTURE24: Integer read _GetGL_TEXTURE24;
{class} property GL_TEXTURE25: Integer read _GetGL_TEXTURE25;
{class} property GL_TEXTURE26: Integer read _GetGL_TEXTURE26;
{class} property GL_TEXTURE27: Integer read _GetGL_TEXTURE27;
{class} property GL_TEXTURE28: Integer read _GetGL_TEXTURE28;
{class} property GL_TEXTURE29: Integer read _GetGL_TEXTURE29;
{class} property GL_TEXTURE3: Integer read _GetGL_TEXTURE3;
{class} property GL_TEXTURE30: Integer read _GetGL_TEXTURE30;
{class} property GL_TEXTURE31: Integer read _GetGL_TEXTURE31;
{class} property GL_TEXTURE4: Integer read _GetGL_TEXTURE4;
{class} property GL_TEXTURE5: Integer read _GetGL_TEXTURE5;
{class} property GL_TEXTURE6: Integer read _GetGL_TEXTURE6;
{class} property GL_TEXTURE7: Integer read _GetGL_TEXTURE7;
{class} property GL_TEXTURE8: Integer read _GetGL_TEXTURE8;
{class} property GL_TEXTURE9: Integer read _GetGL_TEXTURE9;
{class} property GL_TEXTURE_2D: Integer read _GetGL_TEXTURE_2D;
{class} property GL_TEXTURE_COORD_ARRAY: Integer read _GetGL_TEXTURE_COORD_ARRAY;
{class} property GL_TEXTURE_ENV: Integer read _GetGL_TEXTURE_ENV;
{class} property GL_TEXTURE_ENV_COLOR: Integer read _GetGL_TEXTURE_ENV_COLOR;
{class} property GL_TEXTURE_ENV_MODE: Integer read _GetGL_TEXTURE_ENV_MODE;
{class} property GL_TEXTURE_MAG_FILTER: Integer read _GetGL_TEXTURE_MAG_FILTER;
{class} property GL_TEXTURE_MIN_FILTER: Integer read _GetGL_TEXTURE_MIN_FILTER;
{class} property GL_TEXTURE_WRAP_S: Integer read _GetGL_TEXTURE_WRAP_S;
{class} property GL_TEXTURE_WRAP_T: Integer read _GetGL_TEXTURE_WRAP_T;
{class} property GL_TRIANGLES: Integer read _GetGL_TRIANGLES;
{class} property GL_TRIANGLE_FAN: Integer read _GetGL_TRIANGLE_FAN;
{class} property GL_TRIANGLE_STRIP: Integer read _GetGL_TRIANGLE_STRIP;
{class} property GL_TRUE: Integer read _GetGL_TRUE;
{class} property GL_UNPACK_ALIGNMENT: Integer read _GetGL_UNPACK_ALIGNMENT;
{class} property GL_UNSIGNED_BYTE: Integer read _GetGL_UNSIGNED_BYTE;
{class} property GL_UNSIGNED_SHORT: Integer read _GetGL_UNSIGNED_SHORT;
{class} property GL_UNSIGNED_SHORT_4_4_4_4: Integer read _GetGL_UNSIGNED_SHORT_4_4_4_4;
{class} property GL_UNSIGNED_SHORT_5_5_5_1: Integer read _GetGL_UNSIGNED_SHORT_5_5_5_1;
{class} property GL_UNSIGNED_SHORT_5_6_5: Integer read _GetGL_UNSIGNED_SHORT_5_6_5;
{class} property GL_VENDOR: Integer read _GetGL_VENDOR;
{class} property GL_VERSION: Integer read _GetGL_VERSION;
{class} property GL_VERTEX_ARRAY: Integer read _GetGL_VERTEX_ARRAY;
{class} property GL_XOR: Integer read _GetGL_XOR;
{class} property GL_ZERO: Integer read _GetGL_ZERO;
end;
[JavaSignature('javax/microedition/khronos/opengles/GL10')]
JGL10 = interface(JGL)
['{4F032613-C505-4409-A116-09343E69472F}']
procedure glActiveTexture(texture: Integer); cdecl;
procedure glAlphaFunc(func: Integer; ref: Single); cdecl;
procedure glAlphaFuncx(func: Integer; ref: Integer); cdecl;
procedure glBindTexture(target: Integer; texture: Integer); cdecl;
procedure glBlendFunc(sfactor: Integer; dfactor: Integer); cdecl;
procedure glClear(mask: Integer); cdecl;
procedure glClearColor(red: Single; green: Single; blue: Single; alpha: Single); cdecl;
procedure glClearColorx(red: Integer; green: Integer; blue: Integer; alpha: Integer); cdecl;
procedure glClearDepthf(depth: Single); cdecl;
procedure glClearDepthx(depth: Integer); cdecl;
procedure glClearStencil(s: Integer); cdecl;
procedure glClientActiveTexture(texture: Integer); cdecl;
procedure glColor4f(red: Single; green: Single; blue: Single; alpha: Single); cdecl;
procedure glColor4x(red: Integer; green: Integer; blue: Integer; alpha: Integer); cdecl;
procedure glColorMask(red: Boolean; green: Boolean; blue: Boolean; alpha: Boolean); cdecl;
procedure glColorPointer(size: Integer; type_: Integer; stride: Integer; pointer: JBuffer); cdecl;
procedure glCompressedTexImage2D(target: Integer; level: Integer; internalformat: Integer; width: Integer; height: Integer; border: Integer; imageSize: Integer; data: JBuffer); cdecl;
procedure glCompressedTexSubImage2D(target: Integer; level: Integer; xoffset: Integer; yoffset: Integer; width: Integer; height: Integer; format: Integer; imageSize: Integer; data: JBuffer); cdecl;
procedure glCopyTexImage2D(target: Integer; level: Integer; internalformat: Integer; x: Integer; y: Integer; width: Integer; height: Integer; border: Integer); cdecl;
procedure glCopyTexSubImage2D(target: Integer; level: Integer; xoffset: Integer; yoffset: Integer; x: Integer; y: Integer; width: Integer; height: Integer); cdecl;
procedure glCullFace(mode: Integer); cdecl;
procedure glDeleteTextures(n: Integer; textures: TJavaArray<Integer>; offset: Integer); cdecl; overload;
procedure glDeleteTextures(n: Integer; textures: JIntBuffer); cdecl; overload;
procedure glDepthFunc(func: Integer); cdecl;
procedure glDepthMask(flag: Boolean); cdecl;
procedure glDepthRangef(zNear: Single; zFar: Single); cdecl;
procedure glDepthRangex(zNear: Integer; zFar: Integer); cdecl;
procedure glDisable(cap: Integer); cdecl;
procedure glDisableClientState(array_: Integer); cdecl;
procedure glDrawArrays(mode: Integer; first: Integer; count: Integer); cdecl;
procedure glDrawElements(mode: Integer; count: Integer; type_: Integer; indices: JBuffer); cdecl;
procedure glEnable(cap: Integer); cdecl;
procedure glEnableClientState(array_: Integer); cdecl;
procedure glFinish; cdecl;
procedure glFlush; cdecl;
procedure glFogf(pname: Integer; param: Single); cdecl;
procedure glFogfv(pname: Integer; params: TJavaArray<Single>; offset: Integer); cdecl; overload;
procedure glFogfv(pname: Integer; params: JFloatBuffer); cdecl; overload;
procedure glFogx(pname: Integer; param: Integer); cdecl;
procedure glFogxv(pname: Integer; params: TJavaArray<Integer>; offset: Integer); cdecl; overload;
procedure glFogxv(pname: Integer; params: JIntBuffer); cdecl; overload;
procedure glFrontFace(mode: Integer); cdecl;
procedure glFrustumf(left: Single; right: Single; bottom: Single; top: Single; zNear: Single; zFar: Single); cdecl;
procedure glFrustumx(left: Integer; right: Integer; bottom: Integer; top: Integer; zNear: Integer; zFar: Integer); cdecl;
procedure glGenTextures(n: Integer; textures: TJavaArray<Integer>; offset: Integer); cdecl; overload;
procedure glGenTextures(n: Integer; textures: JIntBuffer); cdecl; overload;
function glGetError: Integer; cdecl;
procedure glGetIntegerv(pname: Integer; params: TJavaArray<Integer>; offset: Integer); cdecl; overload;
procedure glGetIntegerv(pname: Integer; params: JIntBuffer); cdecl; overload;
function glGetString(name: Integer): JString; cdecl;
procedure glHint(target: Integer; mode: Integer); cdecl;
procedure glLightModelf(pname: Integer; param: Single); cdecl;
procedure glLightModelfv(pname: Integer; params: TJavaArray<Single>; offset: Integer); cdecl; overload;
procedure glLightModelfv(pname: Integer; params: JFloatBuffer); cdecl; overload;
procedure glLightModelx(pname: Integer; param: Integer); cdecl;
procedure glLightModelxv(pname: Integer; params: TJavaArray<Integer>; offset: Integer); cdecl; overload;
procedure glLightModelxv(pname: Integer; params: JIntBuffer); cdecl; overload;
procedure glLightf(light: Integer; pname: Integer; param: Single); cdecl;
procedure glLightfv(light: Integer; pname: Integer; params: TJavaArray<Single>; offset: Integer); cdecl; overload;
procedure glLightfv(light: Integer; pname: Integer; params: JFloatBuffer); cdecl; overload;
procedure glLightx(light: Integer; pname: Integer; param: Integer); cdecl;
procedure glLightxv(light: Integer; pname: Integer; params: TJavaArray<Integer>; offset: Integer); cdecl; overload;
procedure glLightxv(light: Integer; pname: Integer; params: JIntBuffer); cdecl; overload;
procedure glLineWidth(width: Single); cdecl;
procedure glLineWidthx(width: Integer); cdecl;
procedure glLoadIdentity; cdecl;
procedure glLoadMatrixf(m: TJavaArray<Single>; offset: Integer); cdecl; overload;
procedure glLoadMatrixf(m: JFloatBuffer); cdecl; overload;
procedure glLoadMatrixx(m: TJavaArray<Integer>; offset: Integer); cdecl; overload;
procedure glLoadMatrixx(m: JIntBuffer); cdecl; overload;
procedure glLogicOp(opcode: Integer); cdecl;
procedure glMaterialf(face: Integer; pname: Integer; param: Single); cdecl;
procedure glMaterialfv(face: Integer; pname: Integer; params: TJavaArray<Single>; offset: Integer); cdecl; overload;
procedure glMaterialfv(face: Integer; pname: Integer; params: JFloatBuffer); cdecl; overload;
procedure glMaterialx(face: Integer; pname: Integer; param: Integer); cdecl;
procedure glMaterialxv(face: Integer; pname: Integer; params: TJavaArray<Integer>; offset: Integer); cdecl; overload;
procedure glMaterialxv(face: Integer; pname: Integer; params: JIntBuffer); cdecl; overload;
procedure glMatrixMode(mode: Integer); cdecl;
procedure glMultMatrixf(m: TJavaArray<Single>; offset: Integer); cdecl; overload;
procedure glMultMatrixf(m: JFloatBuffer); cdecl; overload;
procedure glMultMatrixx(m: TJavaArray<Integer>; offset: Integer); cdecl; overload;
procedure glMultMatrixx(m: JIntBuffer); cdecl; overload;
procedure glMultiTexCoord4f(target: Integer; s: Single; t: Single; r: Single; q: Single); cdecl;
procedure glMultiTexCoord4x(target: Integer; s: Integer; t: Integer; r: Integer; q: Integer); cdecl;
procedure glNormal3f(nx: Single; ny: Single; nz: Single); cdecl;
procedure glNormal3x(nx: Integer; ny: Integer; nz: Integer); cdecl;
procedure glNormalPointer(type_: Integer; stride: Integer; pointer: JBuffer); cdecl;
procedure glOrthof(left: Single; right: Single; bottom: Single; top: Single; zNear: Single; zFar: Single); cdecl;
procedure glOrthox(left: Integer; right: Integer; bottom: Integer; top: Integer; zNear: Integer; zFar: Integer); cdecl;
procedure glPixelStorei(pname: Integer; param: Integer); cdecl;
procedure glPointSize(size: Single); cdecl;
procedure glPointSizex(size: Integer); cdecl;
procedure glPolygonOffset(factor: Single; units: Single); cdecl;
procedure glPolygonOffsetx(factor: Integer; units: Integer); cdecl;
procedure glPopMatrix; cdecl;
procedure glPushMatrix; cdecl;
procedure glReadPixels(x: Integer; y: Integer; width: Integer; height: Integer; format: Integer; type_: Integer; pixels: JBuffer); cdecl;
procedure glRotatef(angle: Single; x: Single; y: Single; z: Single); cdecl;
procedure glRotatex(angle: Integer; x: Integer; y: Integer; z: Integer); cdecl;
procedure glSampleCoverage(value: Single; invert: Boolean); cdecl;
procedure glSampleCoveragex(value: Integer; invert: Boolean); cdecl;
procedure glScalef(x: Single; y: Single; z: Single); cdecl;
procedure glScalex(x: Integer; y: Integer; z: Integer); cdecl;
procedure glScissor(x: Integer; y: Integer; width: Integer; height: Integer); cdecl;
procedure glShadeModel(mode: Integer); cdecl;
procedure glStencilFunc(func: Integer; ref: Integer; mask: Integer); cdecl;
procedure glStencilMask(mask: Integer); cdecl;
procedure glStencilOp(fail: Integer; zfail: Integer; zpass: Integer); cdecl;
procedure glTexCoordPointer(size: Integer; type_: Integer; stride: Integer; pointer: JBuffer); cdecl;
procedure glTexEnvf(target: Integer; pname: Integer; param: Single); cdecl;
procedure glTexEnvfv(target: Integer; pname: Integer; params: TJavaArray<Single>; offset: Integer); cdecl; overload;
procedure glTexEnvfv(target: Integer; pname: Integer; params: JFloatBuffer); cdecl; overload;
procedure glTexEnvx(target: Integer; pname: Integer; param: Integer); cdecl;
procedure glTexEnvxv(target: Integer; pname: Integer; params: TJavaArray<Integer>; offset: Integer); cdecl; overload;
procedure glTexEnvxv(target: Integer; pname: Integer; params: JIntBuffer); cdecl; overload;
procedure glTexImage2D(target: Integer; level: Integer; internalformat: Integer; width: Integer; height: Integer; border: Integer; format: Integer; type_: Integer; pixels: JBuffer); cdecl;
procedure glTexParameterf(target: Integer; pname: Integer; param: Single); cdecl;
procedure glTexParameterx(target: Integer; pname: Integer; param: Integer); cdecl;
procedure glTexSubImage2D(target: Integer; level: Integer; xoffset: Integer; yoffset: Integer; width: Integer; height: Integer; format: Integer; type_: Integer; pixels: JBuffer); cdecl;
procedure glTranslatef(x: Single; y: Single; z: Single); cdecl;
procedure glTranslatex(x: Integer; y: Integer; z: Integer); cdecl;
procedure glVertexPointer(size: Integer; type_: Integer; stride: Integer; pointer: JBuffer); cdecl;
procedure glViewport(x: Integer; y: Integer; width: Integer; height: Integer); cdecl;
end;
TJGL10 = class(TJavaGenericImport<JGL10Class, JGL10>) end;
JJSONArrayClass = interface(JObjectClass)
['{34FBA399-2B13-49B4-BD53-5BDFE4653285}']
{class} function init: JJSONArray; cdecl; overload;
{class} function init(copyFrom: JCollection): JJSONArray; cdecl; overload;
{class} function init(readFrom: JJSONTokener): JJSONArray; cdecl; overload;
{class} function init(json: JString): JJSONArray; cdecl; overload;
{class} function init(array_: JObject): JJSONArray; cdecl; overload;
end;
[JavaSignature('org/json/JSONArray')]
JJSONArray = interface(JObject)
['{34738D80-ED10-413D-9467-36A3785DBFF4}']
function equals(o: JObject): Boolean; cdecl;
function &get(index: Integer): JObject; cdecl;
function getBoolean(index: Integer): Boolean; cdecl;
function getDouble(index: Integer): Double; cdecl;
function getInt(index: Integer): Integer; cdecl;
function getJSONArray(index: Integer): JJSONArray; cdecl;
function getJSONObject(index: Integer): JJSONObject; cdecl;
function getLong(index: Integer): Int64; cdecl;
function getString(index: Integer): JString; cdecl;
function hashCode: Integer; cdecl;
function isNull(index: Integer): Boolean; cdecl;
function join(separator: JString): JString; cdecl;
function length: Integer; cdecl;
function opt(index: Integer): JObject; cdecl;
function optBoolean(index: Integer): Boolean; cdecl; overload;
function optBoolean(index: Integer; fallback: Boolean): Boolean; cdecl; overload;
function optDouble(index: Integer): Double; cdecl; overload;
function optDouble(index: Integer; fallback: Double): Double; cdecl; overload;
function optInt(index: Integer): Integer; cdecl; overload;
function optInt(index: Integer; fallback: Integer): Integer; cdecl; overload;
function optJSONArray(index: Integer): JJSONArray; cdecl;
function optJSONObject(index: Integer): JJSONObject; cdecl;
function optLong(index: Integer): Int64; cdecl; overload;
function optLong(index: Integer; fallback: Int64): Int64; cdecl; overload;
function optString(index: Integer): JString; cdecl; overload;
function optString(index: Integer; fallback: JString): JString; cdecl; overload;
function put(value: Boolean): JJSONArray; cdecl; overload;
function put(value: Double): JJSONArray; cdecl; overload;
function put(value: Integer): JJSONArray; cdecl; overload;
function put(value: Int64): JJSONArray; cdecl; overload;
function put(value: JObject): JJSONArray; cdecl; overload;
function put(index: Integer; value: Boolean): JJSONArray; cdecl; overload;
function put(index: Integer; value: Double): JJSONArray; cdecl; overload;
function put(index: Integer; value: Integer): JJSONArray; cdecl; overload;
function put(index: Integer; value: Int64): JJSONArray; cdecl; overload;
function put(index: Integer; value: JObject): JJSONArray; cdecl; overload;
function remove(index: Integer): JObject; cdecl;
function toJSONObject(names: JJSONArray): JJSONObject; cdecl;
function toString: JString; cdecl; overload;
function toString(indentSpaces: Integer): JString; cdecl; overload;
end;
TJJSONArray = class(TJavaGenericImport<JJSONArrayClass, JJSONArray>) end;
JJSONExceptionClass = interface(JExceptionClass)
['{D92F06D5-D459-4309-AE86-21A7EF971C64}']
{class} function init(s: JString): JJSONException; cdecl;
end;
[JavaSignature('org/json/JSONException')]
JJSONException = interface(JException)
['{236AB196-CC66-40D5-91E5-C3D202A9293C}']
end;
TJJSONException = class(TJavaGenericImport<JJSONExceptionClass, JJSONException>) end;
JJSONObjectClass = interface(JObjectClass)
['{32FBF926-19C3-45AF-A29E-C312D95B34CC}']
{class} function _GetNULL: JObject; cdecl;
{class} function init: JJSONObject; cdecl; overload;
{class} function init(copyFrom: JMap): JJSONObject; cdecl; overload;
{class} function init(readFrom: JJSONTokener): JJSONObject; cdecl; overload;
{class} function init(json: JString): JJSONObject; cdecl; overload;
{class} function init(copyFrom: JJSONObject; names: TJavaObjectArray<JString>): JJSONObject; cdecl; overload;
{class} function numberToString(number: JNumber): JString; cdecl;
{class} function quote(data: JString): JString; cdecl;
{class} function wrap(o: JObject): JObject; cdecl;
{class}
end;
[JavaSignature('org/json/JSONObject')]
JJSONObject = interface(JObject)
['{7B4F68E8-ADFC-40EC-A119-37FA9778A11C}']
function accumulate(name: JString; value: JObject): JJSONObject; cdecl;
function &get(name: JString): JObject; cdecl;
function getBoolean(name: JString): Boolean; cdecl;
function getDouble(name: JString): Double; cdecl;
function getInt(name: JString): Integer; cdecl;
function getJSONArray(name: JString): JJSONArray; cdecl;
function getJSONObject(name: JString): JJSONObject; cdecl;
function getLong(name: JString): Int64; cdecl;
function getString(name: JString): JString; cdecl;
function has(name: JString): Boolean; cdecl;
function isNull(name: JString): Boolean; cdecl;
function keys: JIterator; cdecl;
function length: Integer; cdecl;
function names: JJSONArray; cdecl;
function opt(name: JString): JObject; cdecl;
function optBoolean(name: JString): Boolean; cdecl; overload;
function optBoolean(name: JString; fallback: Boolean): Boolean; cdecl; overload;
function optDouble(name: JString): Double; cdecl; overload;
function optDouble(name: JString; fallback: Double): Double; cdecl; overload;
function optInt(name: JString): Integer; cdecl; overload;
function optInt(name: JString; fallback: Integer): Integer; cdecl; overload;
function optJSONArray(name: JString): JJSONArray; cdecl;
function optJSONObject(name: JString): JJSONObject; cdecl;
function optLong(name: JString): Int64; cdecl; overload;
function optLong(name: JString; fallback: Int64): Int64; cdecl; overload;
function optString(name: JString): JString; cdecl; overload;
function optString(name: JString; fallback: JString): JString; cdecl; overload;
function put(name: JString; value: Boolean): JJSONObject; cdecl; overload;
function put(name: JString; value: Double): JJSONObject; cdecl; overload;
function put(name: JString; value: Integer): JJSONObject; cdecl; overload;
function put(name: JString; value: Int64): JJSONObject; cdecl; overload;
function put(name: JString; value: JObject): JJSONObject; cdecl; overload;
function putOpt(name: JString; value: JObject): JJSONObject; cdecl;
function remove(name: JString): JObject; cdecl;
function toJSONArray(names: JJSONArray): JJSONArray; cdecl;
function toString: JString; cdecl; overload;
function toString(indentSpaces: Integer): JString; cdecl; overload;
end;
TJJSONObject = class(TJavaGenericImport<JJSONObjectClass, JJSONObject>) end;
JJSONTokenerClass = interface(JObjectClass)
['{CFDB19D3-6222-4DBF-9012-1EF6EA1D518D}']
{class} function init(in_: JString): JJSONTokener; cdecl;
{class} function dehexchar(hex: Char): Integer; cdecl;
end;
[JavaSignature('org/json/JSONTokener')]
JJSONTokener = interface(JObject)
['{A7330D36-4304-4864-BACD-547E8AF8AAAD}']
procedure back; cdecl;
function more: Boolean; cdecl;
function next: Char; cdecl; overload;
function next(c: Char): Char; cdecl; overload;
function next(length: Integer): JString; cdecl; overload;
function nextClean: Char; cdecl;
function nextString(quote: Char): JString; cdecl;
function nextTo(excluded: JString): JString; cdecl; overload;
function nextTo(excluded: Char): JString; cdecl; overload;
function nextValue: JObject; cdecl;
procedure skipPast(thru: JString); cdecl;
function skipTo(to_: Char): Char; cdecl;
function syntaxError(message: JString): JJSONException; cdecl;
function toString: JString; cdecl;
end;
TJJSONTokener = class(TJavaGenericImport<JJSONTokenerClass, JJSONTokener>) end;
JXmlPullParserClass = interface(IJavaClass)
['{932020CD-42E1-42D5-A33D-5190366B7EE1}']
{class} function _GetCDSECT: Integer; cdecl;
{class} function _GetCOMMENT: Integer; cdecl;
{class} function _GetDOCDECL: Integer; cdecl;
{class} function _GetEND_DOCUMENT: Integer; cdecl;
{class} function _GetEND_TAG: Integer; cdecl;
{class} function _GetENTITY_REF: Integer; cdecl;
{class} function _GetFEATURE_PROCESS_DOCDECL: JString; cdecl;
{class} function _GetFEATURE_PROCESS_NAMESPACES: JString; cdecl;
{class} function _GetFEATURE_REPORT_NAMESPACE_ATTRIBUTES: JString; cdecl;
{class} function _GetFEATURE_VALIDATION: JString; cdecl;
{class} function _GetIGNORABLE_WHITESPACE: Integer; cdecl;
{class} function _GetNO_NAMESPACE: JString; cdecl;
{class} function _GetPROCESSING_INSTRUCTION: Integer; cdecl;
{class} function _GetSTART_DOCUMENT: Integer; cdecl;
{class} function _GetSTART_TAG: Integer; cdecl;
{class} function _GetTEXT: Integer; cdecl;
{class} function _GetTYPES: TJavaObjectArray<JString>; cdecl;
{class} property CDSECT: Integer read _GetCDSECT;
{class} property COMMENT: Integer read _GetCOMMENT;
{class} property DOCDECL: Integer read _GetDOCDECL;
{class} property END_DOCUMENT: Integer read _GetEND_DOCUMENT;
{class} property END_TAG: Integer read _GetEND_TAG;
{class} property ENTITY_REF: Integer read _GetENTITY_REF;
{class} property FEATURE_PROCESS_DOCDECL: JString read _GetFEATURE_PROCESS_DOCDECL;
{class} property FEATURE_PROCESS_NAMESPACES: JString read _GetFEATURE_PROCESS_NAMESPACES;
{class} property FEATURE_REPORT_NAMESPACE_ATTRIBUTES: JString read _GetFEATURE_REPORT_NAMESPACE_ATTRIBUTES;
{class} property FEATURE_VALIDATION: JString read _GetFEATURE_VALIDATION;
{class} property IGNORABLE_WHITESPACE: Integer read _GetIGNORABLE_WHITESPACE;
{class} property NO_NAMESPACE: JString read _GetNO_NAMESPACE;
{class} property PROCESSING_INSTRUCTION: Integer read _GetPROCESSING_INSTRUCTION;
{class} property START_DOCUMENT: Integer read _GetSTART_DOCUMENT;
{class} property START_TAG: Integer read _GetSTART_TAG;
{class} property TEXT: Integer read _GetTEXT;
{class} property TYPES: TJavaObjectArray<JString> read _GetTYPES;
end;
[JavaSignature('org/xmlpull/v1/XmlPullParser')]
JXmlPullParser = interface(IJavaInstance)
['{047BC31A-D436-4663-A1F8-E304CC9B5CFE}']
procedure defineEntityReplacementText(entityName: JString; replacementText: JString); cdecl;
function getAttributeCount: Integer; cdecl;
function getAttributeName(index: Integer): JString; cdecl;
function getAttributeNamespace(index: Integer): JString; cdecl;
function getAttributePrefix(index: Integer): JString; cdecl;
function getAttributeType(index: Integer): JString; cdecl;
function getAttributeValue(index: Integer): JString; cdecl; overload;
function getAttributeValue(namespace: JString; name: JString): JString; cdecl; overload;
function getColumnNumber: Integer; cdecl;
function getDepth: Integer; cdecl;
function getEventType: Integer; cdecl;
function getFeature(name: JString): Boolean; cdecl;
function getInputEncoding: JString; cdecl;
function getLineNumber: Integer; cdecl;
function getName: JString; cdecl;
function getNamespace(prefix: JString): JString; cdecl; overload;
function getNamespace: JString; cdecl; overload;
function getNamespaceCount(depth: Integer): Integer; cdecl;
function getNamespacePrefix(pos: Integer): JString; cdecl;
function getNamespaceUri(pos: Integer): JString; cdecl;
function getPositionDescription: JString; cdecl;
function getPrefix: JString; cdecl;
function getProperty(name: JString): JObject; cdecl;
function getText: JString; cdecl;
function getTextCharacters(holderForStartAndLength: TJavaArray<Integer>): TJavaArray<Char>; cdecl;
function isAttributeDefault(index: Integer): Boolean; cdecl;
function isEmptyElementTag: Boolean; cdecl;
function isWhitespace: Boolean; cdecl;
function next: Integer; cdecl;
function nextTag: Integer; cdecl;
function nextText: JString; cdecl;
function nextToken: Integer; cdecl;
procedure require(type_: Integer; namespace: JString; name: JString); cdecl;
procedure setFeature(name: JString; state: Boolean); cdecl;
procedure setInput(in_: JReader); cdecl; overload;
procedure setInput(inputStream: JInputStream; inputEncoding: JString); cdecl; overload;
procedure setProperty(name: JString; value: JObject); cdecl;
end;
TJXmlPullParser = class(TJavaGenericImport<JXmlPullParserClass, JXmlPullParser>) end;
JXmlSerializerClass = interface(IJavaClass)
['{358A6AC9-1AF2-497F-BFBE-CF975CCAAF07}']
end;
[JavaSignature('org/xmlpull/v1/XmlSerializer')]
JXmlSerializer = interface(IJavaInstance)
['{A16E0414-9A1D-499F-839F-E89BDA70DFB5}']
function attribute(namespace: JString; name: JString; value: JString): JXmlSerializer; cdecl;
procedure cdsect(text: JString); cdecl;
procedure comment(text: JString); cdecl;
procedure docdecl(text: JString); cdecl;
procedure endDocument; cdecl;
function endTag(namespace: JString; name: JString): JXmlSerializer; cdecl;
procedure entityRef(text: JString); cdecl;
procedure flush; cdecl;
function getDepth: Integer; cdecl;
function getFeature(name: JString): Boolean; cdecl;
function getName: JString; cdecl;
function getNamespace: JString; cdecl;
function getPrefix(namespace: JString; generatePrefix: Boolean): JString; cdecl;
function getProperty(name: JString): JObject; cdecl;
procedure ignorableWhitespace(text: JString); cdecl;
procedure processingInstruction(text: JString); cdecl;
procedure setFeature(name: JString; state: Boolean); cdecl;
procedure setOutput(os: JOutputStream; encoding: JString); cdecl; overload;
procedure setOutput(writer: JWriter); cdecl; overload;
procedure setPrefix(prefix: JString; namespace: JString); cdecl;
procedure setProperty(name: JString; value: JObject); cdecl;
procedure startDocument(encoding: JString; standalone: JBoolean); cdecl;
function startTag(namespace: JString; name: JString): JXmlSerializer; cdecl;
function text(text: JString): JXmlSerializer; cdecl; overload;
function text(buf: TJavaArray<Char>; start: Integer; len: Integer): JXmlSerializer; cdecl; overload;
end;
TJXmlSerializer = class(TJavaGenericImport<JXmlSerializerClass, JXmlSerializer>) end;
implementation
procedure RegisterTypes;
begin
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JObject', TypeInfo(Androidapi.JNI.JavaTypes.JObject));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JInputStream', TypeInfo(Androidapi.JNI.JavaTypes.JInputStream));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JByteArrayInputStream', TypeInfo(Androidapi.JNI.JavaTypes.JByteArrayInputStream));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JOutputStream', TypeInfo(Androidapi.JNI.JavaTypes.JOutputStream));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JByteArrayOutputStream', TypeInfo(Androidapi.JNI.JavaTypes.JByteArrayOutputStream));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JAutoCloseable', TypeInfo(Androidapi.JNI.JavaTypes.JAutoCloseable));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JCloseable', TypeInfo(Androidapi.JNI.JavaTypes.JCloseable));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JFile', TypeInfo(Androidapi.JNI.JavaTypes.JFile));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JFileDescriptor', TypeInfo(Androidapi.JNI.JavaTypes.JFileDescriptor));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JFileFilter', TypeInfo(Androidapi.JNI.JavaTypes.JFileFilter));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JFileInputStream', TypeInfo(Androidapi.JNI.JavaTypes.JFileInputStream));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JFileOutputStream', TypeInfo(Androidapi.JNI.JavaTypes.JFileOutputStream));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JFilenameFilter', TypeInfo(Androidapi.JNI.JavaTypes.JFilenameFilter));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JFilterOutputStream', TypeInfo(Androidapi.JNI.JavaTypes.JFilterOutputStream));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JThrowable', TypeInfo(Androidapi.JNI.JavaTypes.JThrowable));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JException', TypeInfo(Androidapi.JNI.JavaTypes.JException));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JIOException', TypeInfo(Androidapi.JNI.JavaTypes.JIOException));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JPrintStream', TypeInfo(Androidapi.JNI.JavaTypes.JPrintStream));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JWriter', TypeInfo(Androidapi.JNI.JavaTypes.JWriter));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JPrintWriter', TypeInfo(Androidapi.JNI.JavaTypes.JPrintWriter));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JRandomAccessFile', TypeInfo(Androidapi.JNI.JavaTypes.JRandomAccessFile));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JReader', TypeInfo(Androidapi.JNI.JavaTypes.JReader));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JSerializable', TypeInfo(Androidapi.JNI.JavaTypes.JSerializable));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JAbstractStringBuilder', TypeInfo(Androidapi.JNI.JavaTypes.JAbstractStringBuilder));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JAppendable', TypeInfo(Androidapi.JNI.JavaTypes.JAppendable));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JBoolean', TypeInfo(Androidapi.JNI.JavaTypes.JBoolean));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JNumber', TypeInfo(Androidapi.JNI.JavaTypes.JNumber));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JByte', TypeInfo(Androidapi.JNI.JavaTypes.JByte));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JCharSequence', TypeInfo(Androidapi.JNI.JavaTypes.JCharSequence));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.Jlang_Class', TypeInfo(Androidapi.JNI.JavaTypes.Jlang_Class));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JClassLoader', TypeInfo(Androidapi.JNI.JavaTypes.JClassLoader));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JCloneable', TypeInfo(Androidapi.JNI.JavaTypes.JCloneable));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JComparable', TypeInfo(Androidapi.JNI.JavaTypes.JComparable));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JDouble', TypeInfo(Androidapi.JNI.JavaTypes.JDouble));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JEnum', TypeInfo(Androidapi.JNI.JavaTypes.JEnum));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JFloat', TypeInfo(Androidapi.JNI.JavaTypes.JFloat));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JRuntimeException', TypeInfo(Androidapi.JNI.JavaTypes.JRuntimeException));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JIllegalStateException', TypeInfo(Androidapi.JNI.JavaTypes.JIllegalStateException));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JInteger', TypeInfo(Androidapi.JNI.JavaTypes.JInteger));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JIterable', TypeInfo(Androidapi.JNI.JavaTypes.JIterable));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JLong', TypeInfo(Androidapi.JNI.JavaTypes.JLong));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JPackage', TypeInfo(Androidapi.JNI.JavaTypes.JPackage));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JRunnable', TypeInfo(Androidapi.JNI.JavaTypes.JRunnable));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JShort', TypeInfo(Androidapi.JNI.JavaTypes.JShort));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JStackTraceElement', TypeInfo(Androidapi.JNI.JavaTypes.JStackTraceElement));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JString', TypeInfo(Androidapi.JNI.JavaTypes.JString));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JStringBuffer', TypeInfo(Androidapi.JNI.JavaTypes.JStringBuffer));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JStringBuilder', TypeInfo(Androidapi.JNI.JavaTypes.JStringBuilder));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JThread', TypeInfo(Androidapi.JNI.JavaTypes.JThread));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JThread_State', TypeInfo(Androidapi.JNI.JavaTypes.JThread_State));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JThread_UncaughtExceptionHandler', TypeInfo(Androidapi.JNI.JavaTypes.JThread_UncaughtExceptionHandler));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JThreadGroup', TypeInfo(Androidapi.JNI.JavaTypes.JThreadGroup));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JAnnotation', TypeInfo(Androidapi.JNI.JavaTypes.JAnnotation));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JAccessibleObject', TypeInfo(Androidapi.JNI.JavaTypes.JAccessibleObject));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JAnnotatedElement', TypeInfo(Androidapi.JNI.JavaTypes.JAnnotatedElement));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JExecutable', TypeInfo(Androidapi.JNI.JavaTypes.JExecutable));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JConstructor', TypeInfo(Androidapi.JNI.JavaTypes.JConstructor));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JField', TypeInfo(Androidapi.JNI.JavaTypes.JField));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JGenericDeclaration', TypeInfo(Androidapi.JNI.JavaTypes.JGenericDeclaration));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JMethod', TypeInfo(Androidapi.JNI.JavaTypes.JMethod));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JParameter', TypeInfo(Androidapi.JNI.JavaTypes.JParameter));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.Jreflect_Type', TypeInfo(Androidapi.JNI.JavaTypes.Jreflect_Type));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JTypeVariable', TypeInfo(Androidapi.JNI.JavaTypes.JTypeVariable));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JBigInteger', TypeInfo(Androidapi.JNI.JavaTypes.JBigInteger));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JBuffer', TypeInfo(Androidapi.JNI.JavaTypes.JBuffer));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JByteBuffer', TypeInfo(Androidapi.JNI.JavaTypes.JByteBuffer));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JByteOrder', TypeInfo(Androidapi.JNI.JavaTypes.JByteOrder));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JCharBuffer', TypeInfo(Androidapi.JNI.JavaTypes.JCharBuffer));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JDoubleBuffer', TypeInfo(Androidapi.JNI.JavaTypes.JDoubleBuffer));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JFloatBuffer', TypeInfo(Androidapi.JNI.JavaTypes.JFloatBuffer));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JIntBuffer', TypeInfo(Androidapi.JNI.JavaTypes.JIntBuffer));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JLongBuffer', TypeInfo(Androidapi.JNI.JavaTypes.JLongBuffer));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JMappedByteBuffer', TypeInfo(Androidapi.JNI.JavaTypes.JMappedByteBuffer));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JShortBuffer', TypeInfo(Androidapi.JNI.JavaTypes.JShortBuffer));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JAsynchronousFileChannel', TypeInfo(Androidapi.JNI.JavaTypes.JAsynchronousFileChannel));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JChannel', TypeInfo(Androidapi.JNI.JavaTypes.JChannel));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JReadableByteChannel', TypeInfo(Androidapi.JNI.JavaTypes.JReadableByteChannel));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JByteChannel', TypeInfo(Androidapi.JNI.JavaTypes.JByteChannel));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JCompletionHandler', TypeInfo(Androidapi.JNI.JavaTypes.JCompletionHandler));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JAbstractInterruptibleChannel', TypeInfo(Androidapi.JNI.JavaTypes.JAbstractInterruptibleChannel));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JSelectableChannel', TypeInfo(Androidapi.JNI.JavaTypes.JSelectableChannel));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JAbstractSelectableChannel', TypeInfo(Androidapi.JNI.JavaTypes.JAbstractSelectableChannel));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JDatagramChannel', TypeInfo(Androidapi.JNI.JavaTypes.JDatagramChannel));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JFileChannel', TypeInfo(Androidapi.JNI.JavaTypes.JFileChannel));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JFileChannel_MapMode', TypeInfo(Androidapi.JNI.JavaTypes.JFileChannel_MapMode));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JFileLock', TypeInfo(Androidapi.JNI.JavaTypes.JFileLock));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JPipe', TypeInfo(Androidapi.JNI.JavaTypes.JPipe));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JPipe_SinkChannel', TypeInfo(Androidapi.JNI.JavaTypes.JPipe_SinkChannel));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JPipe_SourceChannel', TypeInfo(Androidapi.JNI.JavaTypes.JPipe_SourceChannel));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JSeekableByteChannel', TypeInfo(Androidapi.JNI.JavaTypes.JSeekableByteChannel));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JSelectionKey', TypeInfo(Androidapi.JNI.JavaTypes.JSelectionKey));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JSelector', TypeInfo(Androidapi.JNI.JavaTypes.JSelector));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JServerSocketChannel', TypeInfo(Androidapi.JNI.JavaTypes.JServerSocketChannel));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JSocketChannel', TypeInfo(Androidapi.JNI.JavaTypes.JSocketChannel));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JWritableByteChannel', TypeInfo(Androidapi.JNI.JavaTypes.JWritableByteChannel));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JAbstractSelector', TypeInfo(Androidapi.JNI.JavaTypes.JAbstractSelector));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JSelectorProvider', TypeInfo(Androidapi.JNI.JavaTypes.JSelectorProvider));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JCharset', TypeInfo(Androidapi.JNI.JavaTypes.JCharset));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JCharsetDecoder', TypeInfo(Androidapi.JNI.JavaTypes.JCharsetDecoder));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JCharsetEncoder', TypeInfo(Androidapi.JNI.JavaTypes.JCharsetEncoder));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JCoderResult', TypeInfo(Androidapi.JNI.JavaTypes.JCoderResult));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JCodingErrorAction', TypeInfo(Androidapi.JNI.JavaTypes.JCodingErrorAction));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JAccessMode', TypeInfo(Androidapi.JNI.JavaTypes.JAccessMode));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JCopyOption', TypeInfo(Androidapi.JNI.JavaTypes.JCopyOption));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JDirectoryStream', TypeInfo(Androidapi.JNI.JavaTypes.JDirectoryStream));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JDirectoryStream_Filter', TypeInfo(Androidapi.JNI.JavaTypes.JDirectoryStream_Filter));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JFileStore', TypeInfo(Androidapi.JNI.JavaTypes.JFileStore));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JFileSystem', TypeInfo(Androidapi.JNI.JavaTypes.JFileSystem));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JLinkOption', TypeInfo(Androidapi.JNI.JavaTypes.JLinkOption));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JOpenOption', TypeInfo(Androidapi.JNI.JavaTypes.JOpenOption));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.Jfile_Path', TypeInfo(Androidapi.JNI.JavaTypes.Jfile_Path));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JPathMatcher', TypeInfo(Androidapi.JNI.JavaTypes.JPathMatcher));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JWatchEvent_Kind', TypeInfo(Androidapi.JNI.JavaTypes.JWatchEvent_Kind));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JWatchEvent_Modifier', TypeInfo(Androidapi.JNI.JavaTypes.JWatchEvent_Modifier));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JWatchKey', TypeInfo(Androidapi.JNI.JavaTypes.JWatchKey));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JWatchService', TypeInfo(Androidapi.JNI.JavaTypes.JWatchService));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JWatchable', TypeInfo(Androidapi.JNI.JavaTypes.JWatchable));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JAttributeView', TypeInfo(Androidapi.JNI.JavaTypes.JAttributeView));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JBasicFileAttributes', TypeInfo(Androidapi.JNI.JavaTypes.JBasicFileAttributes));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JFileAttribute', TypeInfo(Androidapi.JNI.JavaTypes.JFileAttribute));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JFileAttributeView', TypeInfo(Androidapi.JNI.JavaTypes.JFileAttributeView));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JFileStoreAttributeView', TypeInfo(Androidapi.JNI.JavaTypes.JFileStoreAttributeView));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JFileTime', TypeInfo(Androidapi.JNI.JavaTypes.JFileTime));
//TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JUserPrincipal', TypeInfo(Androidapi.JNI.JavaTypes.JUserPrincipal));
//TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JGroupPrincipal', TypeInfo(Androidapi.JNI.JavaTypes.JGroupPrincipal));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JUserPrincipalLookupService', TypeInfo(Androidapi.JNI.JavaTypes.JUserPrincipalLookupService));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JFileSystemProvider', TypeInfo(Androidapi.JNI.JavaTypes.JFileSystemProvider));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JCharacterIterator', TypeInfo(Androidapi.JNI.JavaTypes.JCharacterIterator));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JAttributedCharacterIterator', TypeInfo(Androidapi.JNI.JavaTypes.JAttributedCharacterIterator));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JAttributedCharacterIterator_Attribute', TypeInfo(Androidapi.JNI.JavaTypes.JAttributedCharacterIterator_Attribute));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JFieldPosition', TypeInfo(Androidapi.JNI.JavaTypes.JFieldPosition));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JFormat', TypeInfo(Androidapi.JNI.JavaTypes.JFormat));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JFormat_Field', TypeInfo(Androidapi.JNI.JavaTypes.JFormat_Field));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JParsePosition', TypeInfo(Androidapi.JNI.JavaTypes.JParsePosition));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JClock', TypeInfo(Androidapi.JNI.JavaTypes.JClock));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JDayOfWeek', TypeInfo(Androidapi.JNI.JavaTypes.JDayOfWeek));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.Jtime_Duration', TypeInfo(Androidapi.JNI.JavaTypes.Jtime_Duration));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JInstant', TypeInfo(Androidapi.JNI.JavaTypes.JInstant));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JLocalDate', TypeInfo(Androidapi.JNI.JavaTypes.JLocalDate));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JLocalDateTime', TypeInfo(Androidapi.JNI.JavaTypes.JLocalDateTime));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JLocalTime', TypeInfo(Androidapi.JNI.JavaTypes.JLocalTime));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JMonth', TypeInfo(Androidapi.JNI.JavaTypes.JMonth));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JOffsetDateTime', TypeInfo(Androidapi.JNI.JavaTypes.JOffsetDateTime));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JOffsetTime', TypeInfo(Androidapi.JNI.JavaTypes.JOffsetTime));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JPeriod', TypeInfo(Androidapi.JNI.JavaTypes.JPeriod));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JZoneId', TypeInfo(Androidapi.JNI.JavaTypes.JZoneId));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JZoneOffset', TypeInfo(Androidapi.JNI.JavaTypes.JZoneOffset));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JZonedDateTime', TypeInfo(Androidapi.JNI.JavaTypes.JZonedDateTime));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JAbstractChronology', TypeInfo(Androidapi.JNI.JavaTypes.JAbstractChronology));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JChronoLocalDate', TypeInfo(Androidapi.JNI.JavaTypes.JChronoLocalDate));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JChronoLocalDateTime', TypeInfo(Androidapi.JNI.JavaTypes.JChronoLocalDateTime));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JTemporalAmount', TypeInfo(Androidapi.JNI.JavaTypes.JTemporalAmount));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JChronoPeriod', TypeInfo(Androidapi.JNI.JavaTypes.JChronoPeriod));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JChronoZonedDateTime', TypeInfo(Androidapi.JNI.JavaTypes.JChronoZonedDateTime));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JChronology', TypeInfo(Androidapi.JNI.JavaTypes.JChronology));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JTemporalAccessor', TypeInfo(Androidapi.JNI.JavaTypes.JTemporalAccessor));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JEra', TypeInfo(Androidapi.JNI.JavaTypes.JEra));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JIsoChronology', TypeInfo(Androidapi.JNI.JavaTypes.JIsoChronology));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JIsoEra', TypeInfo(Androidapi.JNI.JavaTypes.JIsoEra));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JDateTimeFormatter', TypeInfo(Androidapi.JNI.JavaTypes.JDateTimeFormatter));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JDecimalStyle', TypeInfo(Androidapi.JNI.JavaTypes.JDecimalStyle));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JFormatStyle', TypeInfo(Androidapi.JNI.JavaTypes.JFormatStyle));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JResolverStyle', TypeInfo(Androidapi.JNI.JavaTypes.JResolverStyle));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JTextStyle', TypeInfo(Androidapi.JNI.JavaTypes.JTextStyle));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JChronoField', TypeInfo(Androidapi.JNI.JavaTypes.JChronoField));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JTemporal', TypeInfo(Androidapi.JNI.JavaTypes.JTemporal));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JTemporalAdjuster', TypeInfo(Androidapi.JNI.JavaTypes.JTemporalAdjuster));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JTemporalField', TypeInfo(Androidapi.JNI.JavaTypes.JTemporalField));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JTemporalQuery', TypeInfo(Androidapi.JNI.JavaTypes.JTemporalQuery));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JTemporalUnit', TypeInfo(Androidapi.JNI.JavaTypes.JTemporalUnit));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JValueRange', TypeInfo(Androidapi.JNI.JavaTypes.JValueRange));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JZoneOffsetTransition', TypeInfo(Androidapi.JNI.JavaTypes.JZoneOffsetTransition));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JZoneRules', TypeInfo(Androidapi.JNI.JavaTypes.JZoneRules));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JAbstractCollection', TypeInfo(Androidapi.JNI.JavaTypes.JAbstractCollection));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JAbstractList', TypeInfo(Androidapi.JNI.JavaTypes.JAbstractList));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JAbstractMap', TypeInfo(Androidapi.JNI.JavaTypes.JAbstractMap));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JAbstractSet', TypeInfo(Androidapi.JNI.JavaTypes.JAbstractSet));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JArrayList', TypeInfo(Androidapi.JNI.JavaTypes.JArrayList));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JBitSet', TypeInfo(Androidapi.JNI.JavaTypes.JBitSet));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JCalendar', TypeInfo(Androidapi.JNI.JavaTypes.JCalendar));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JCollection', TypeInfo(Androidapi.JNI.JavaTypes.JCollection));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JComparator', TypeInfo(Androidapi.JNI.JavaTypes.JComparator));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JDate', TypeInfo(Androidapi.JNI.JavaTypes.JDate));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JDictionary', TypeInfo(Androidapi.JNI.JavaTypes.JDictionary));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JDoubleSummaryStatistics', TypeInfo(Androidapi.JNI.JavaTypes.JDoubleSummaryStatistics));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JEnumSet', TypeInfo(Androidapi.JNI.JavaTypes.JEnumSet));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JEnumeration', TypeInfo(Androidapi.JNI.JavaTypes.JEnumeration));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JGregorianCalendar', TypeInfo(Androidapi.JNI.JavaTypes.JGregorianCalendar));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JHashMap', TypeInfo(Androidapi.JNI.JavaTypes.JHashMap));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JHashSet', TypeInfo(Androidapi.JNI.JavaTypes.JHashSet));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JHashtable', TypeInfo(Androidapi.JNI.JavaTypes.JHashtable));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JIntSummaryStatistics', TypeInfo(Androidapi.JNI.JavaTypes.JIntSummaryStatistics));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JIterator', TypeInfo(Androidapi.JNI.JavaTypes.JIterator));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JList', TypeInfo(Androidapi.JNI.JavaTypes.JList));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JListIterator', TypeInfo(Androidapi.JNI.JavaTypes.JListIterator));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JLocale', TypeInfo(Androidapi.JNI.JavaTypes.JLocale));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JLocale_Category', TypeInfo(Androidapi.JNI.JavaTypes.JLocale_Category));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JLocale_FilteringMode', TypeInfo(Androidapi.JNI.JavaTypes.JLocale_FilteringMode));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JLongSummaryStatistics', TypeInfo(Androidapi.JNI.JavaTypes.JLongSummaryStatistics));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JMap', TypeInfo(Androidapi.JNI.JavaTypes.JMap));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.Jutil_Observable', TypeInfo(Androidapi.JNI.JavaTypes.Jutil_Observable));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JObserver', TypeInfo(Androidapi.JNI.JavaTypes.JObserver));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JOptional', TypeInfo(Androidapi.JNI.JavaTypes.JOptional));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JOptionalDouble', TypeInfo(Androidapi.JNI.JavaTypes.JOptionalDouble));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JOptionalInt', TypeInfo(Androidapi.JNI.JavaTypes.JOptionalInt));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JOptionalLong', TypeInfo(Androidapi.JNI.JavaTypes.JOptionalLong));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JPrimitiveIterator', TypeInfo(Androidapi.JNI.JavaTypes.JPrimitiveIterator));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JPrimitiveIterator_OfDouble', TypeInfo(Androidapi.JNI.JavaTypes.JPrimitiveIterator_OfDouble));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JPrimitiveIterator_OfInt', TypeInfo(Androidapi.JNI.JavaTypes.JPrimitiveIterator_OfInt));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JPrimitiveIterator_OfLong', TypeInfo(Androidapi.JNI.JavaTypes.JPrimitiveIterator_OfLong));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JProperties', TypeInfo(Androidapi.JNI.JavaTypes.JProperties));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JQueue', TypeInfo(Androidapi.JNI.JavaTypes.JQueue));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JRandom', TypeInfo(Androidapi.JNI.JavaTypes.JRandom));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JSet', TypeInfo(Androidapi.JNI.JavaTypes.JSet));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JSortedMap', TypeInfo(Androidapi.JNI.JavaTypes.JSortedMap));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JSpliterator', TypeInfo(Androidapi.JNI.JavaTypes.JSpliterator));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JSpliterator_OfPrimitive', TypeInfo(Androidapi.JNI.JavaTypes.JSpliterator_OfPrimitive));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JSpliterator_OfDouble', TypeInfo(Androidapi.JNI.JavaTypes.JSpliterator_OfDouble));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JSpliterator_OfInt', TypeInfo(Androidapi.JNI.JavaTypes.JSpliterator_OfInt));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JSpliterator_OfLong', TypeInfo(Androidapi.JNI.JavaTypes.JSpliterator_OfLong));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JTimeZone', TypeInfo(Androidapi.JNI.JavaTypes.JTimeZone));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JTimer', TypeInfo(Androidapi.JNI.JavaTypes.JTimer));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JTimerTask', TypeInfo(Androidapi.JNI.JavaTypes.JTimerTask));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JUUID', TypeInfo(Androidapi.JNI.JavaTypes.JUUID));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JAbstractExecutorService', TypeInfo(Androidapi.JNI.JavaTypes.JAbstractExecutorService));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JBlockingQueue', TypeInfo(Androidapi.JNI.JavaTypes.JBlockingQueue));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JCallable', TypeInfo(Androidapi.JNI.JavaTypes.JCallable));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JCountDownLatch', TypeInfo(Androidapi.JNI.JavaTypes.JCountDownLatch));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JDelayed', TypeInfo(Androidapi.JNI.JavaTypes.JDelayed));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JExecutor', TypeInfo(Androidapi.JNI.JavaTypes.JExecutor));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JExecutorService', TypeInfo(Androidapi.JNI.JavaTypes.JExecutorService));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JFuture', TypeInfo(Androidapi.JNI.JavaTypes.JFuture));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JRejectedExecutionHandler', TypeInfo(Androidapi.JNI.JavaTypes.JRejectedExecutionHandler));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JScheduledFuture', TypeInfo(Androidapi.JNI.JavaTypes.JScheduledFuture));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JThreadPoolExecutor', TypeInfo(Androidapi.JNI.JavaTypes.JThreadPoolExecutor));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JScheduledThreadPoolExecutor', TypeInfo(Androidapi.JNI.JavaTypes.JScheduledThreadPoolExecutor));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JThreadFactory', TypeInfo(Androidapi.JNI.JavaTypes.JThreadFactory));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JTimeUnit', TypeInfo(Androidapi.JNI.JavaTypes.JTimeUnit));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JBiConsumer', TypeInfo(Androidapi.JNI.JavaTypes.JBiConsumer));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JBiFunction', TypeInfo(Androidapi.JNI.JavaTypes.JBiFunction));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JBinaryOperator', TypeInfo(Androidapi.JNI.JavaTypes.JBinaryOperator));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JConsumer', TypeInfo(Androidapi.JNI.JavaTypes.JConsumer));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JDoubleBinaryOperator', TypeInfo(Androidapi.JNI.JavaTypes.JDoubleBinaryOperator));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JDoubleConsumer', TypeInfo(Androidapi.JNI.JavaTypes.JDoubleConsumer));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JDoubleFunction', TypeInfo(Androidapi.JNI.JavaTypes.JDoubleFunction));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JDoublePredicate', TypeInfo(Androidapi.JNI.JavaTypes.JDoublePredicate));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JDoubleSupplier', TypeInfo(Androidapi.JNI.JavaTypes.JDoubleSupplier));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JDoubleToIntFunction', TypeInfo(Androidapi.JNI.JavaTypes.JDoubleToIntFunction));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JDoubleToLongFunction', TypeInfo(Androidapi.JNI.JavaTypes.JDoubleToLongFunction));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JDoubleUnaryOperator', TypeInfo(Androidapi.JNI.JavaTypes.JDoubleUnaryOperator));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JFunction', TypeInfo(Androidapi.JNI.JavaTypes.JFunction));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JIntBinaryOperator', TypeInfo(Androidapi.JNI.JavaTypes.JIntBinaryOperator));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JIntConsumer', TypeInfo(Androidapi.JNI.JavaTypes.JIntConsumer));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JIntFunction', TypeInfo(Androidapi.JNI.JavaTypes.JIntFunction));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JIntPredicate', TypeInfo(Androidapi.JNI.JavaTypes.JIntPredicate));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JIntSupplier', TypeInfo(Androidapi.JNI.JavaTypes.JIntSupplier));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JIntToDoubleFunction', TypeInfo(Androidapi.JNI.JavaTypes.JIntToDoubleFunction));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JIntToLongFunction', TypeInfo(Androidapi.JNI.JavaTypes.JIntToLongFunction));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JIntUnaryOperator', TypeInfo(Androidapi.JNI.JavaTypes.JIntUnaryOperator));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JLongBinaryOperator', TypeInfo(Androidapi.JNI.JavaTypes.JLongBinaryOperator));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JLongConsumer', TypeInfo(Androidapi.JNI.JavaTypes.JLongConsumer));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JLongFunction', TypeInfo(Androidapi.JNI.JavaTypes.JLongFunction));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JLongPredicate', TypeInfo(Androidapi.JNI.JavaTypes.JLongPredicate));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JLongSupplier', TypeInfo(Androidapi.JNI.JavaTypes.JLongSupplier));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JLongToDoubleFunction', TypeInfo(Androidapi.JNI.JavaTypes.JLongToDoubleFunction));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JLongToIntFunction', TypeInfo(Androidapi.JNI.JavaTypes.JLongToIntFunction));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JLongUnaryOperator', TypeInfo(Androidapi.JNI.JavaTypes.JLongUnaryOperator));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JObjDoubleConsumer', TypeInfo(Androidapi.JNI.JavaTypes.JObjDoubleConsumer));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JObjIntConsumer', TypeInfo(Androidapi.JNI.JavaTypes.JObjIntConsumer));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JObjLongConsumer', TypeInfo(Androidapi.JNI.JavaTypes.JObjLongConsumer));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.Jfunction_Predicate', TypeInfo(Androidapi.JNI.JavaTypes.Jfunction_Predicate));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JSupplier', TypeInfo(Androidapi.JNI.JavaTypes.JSupplier));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JToDoubleFunction', TypeInfo(Androidapi.JNI.JavaTypes.JToDoubleFunction));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JToIntFunction', TypeInfo(Androidapi.JNI.JavaTypes.JToIntFunction));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JToLongFunction', TypeInfo(Androidapi.JNI.JavaTypes.JToLongFunction));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JUnaryOperator', TypeInfo(Androidapi.JNI.JavaTypes.JUnaryOperator));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JBaseStream', TypeInfo(Androidapi.JNI.JavaTypes.JBaseStream));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JCollector', TypeInfo(Androidapi.JNI.JavaTypes.JCollector));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JCollector_Characteristics', TypeInfo(Androidapi.JNI.JavaTypes.JCollector_Characteristics));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JDoubleStream', TypeInfo(Androidapi.JNI.JavaTypes.JDoubleStream));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JDoubleStream_Builder', TypeInfo(Androidapi.JNI.JavaTypes.JDoubleStream_Builder));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JIntStream', TypeInfo(Androidapi.JNI.JavaTypes.JIntStream));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JIntStream_Builder', TypeInfo(Androidapi.JNI.JavaTypes.JIntStream_Builder));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JLongStream', TypeInfo(Androidapi.JNI.JavaTypes.JLongStream));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JLongStream_Builder', TypeInfo(Androidapi.JNI.JavaTypes.JLongStream_Builder));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JStream', TypeInfo(Androidapi.JNI.JavaTypes.JStream));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JStream_Builder', TypeInfo(Androidapi.JNI.JavaTypes.JStream_Builder));
//TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JSecretKey', TypeInfo(Androidapi.JNI.JavaTypes.JSecretKey));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JEGL', TypeInfo(Androidapi.JNI.JavaTypes.JEGL));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JEGL10', TypeInfo(Androidapi.JNI.JavaTypes.JEGL10));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JEGLConfig', TypeInfo(Androidapi.JNI.JavaTypes.JEGLConfig));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JEGLContext', TypeInfo(Androidapi.JNI.JavaTypes.JEGLContext));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JEGLDisplay', TypeInfo(Androidapi.JNI.JavaTypes.JEGLDisplay));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JEGLSurface', TypeInfo(Androidapi.JNI.JavaTypes.JEGLSurface));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JGL', TypeInfo(Androidapi.JNI.JavaTypes.JGL));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JGL10', TypeInfo(Androidapi.JNI.JavaTypes.JGL10));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JJSONArray', TypeInfo(Androidapi.JNI.JavaTypes.JJSONArray));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JJSONException', TypeInfo(Androidapi.JNI.JavaTypes.JJSONException));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JJSONObject', TypeInfo(Androidapi.JNI.JavaTypes.JJSONObject));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JJSONTokener', TypeInfo(Androidapi.JNI.JavaTypes.JJSONTokener));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JXmlPullParser', TypeInfo(Androidapi.JNI.JavaTypes.JXmlPullParser));
TRegTypes.RegisterType('Androidapi.JNI.JavaTypes.JXmlSerializer', TypeInfo(Androidapi.JNI.JavaTypes.JXmlSerializer));
end;
initialization
RegisterTypes;
end.
|
unit Annotation.Interfaces;
interface
uses
Generics.Collections, AnnotatedImage, System.Types, Vcl.Graphics,
Annotation.Action, Classes, Vcl.Controls, Forms;
type
TPresentMode = (prmdOriginal, prmdCombined, prmdMask);
TImageInfo = record
FileName: string;
Width: integer;
Height: integer;
end;
TLoadImageMethod = procedure(const FileName: TStrings) of object;
IImageAnnotationView = interface
procedure RenderBitmap(const ABitmap: TBitmap);
procedure RenderZoomBox(const ABitmap: TBitmap);
procedure ShowImageInfo(const ImageInfo: TImageInfo);
procedure ShowImageCount(const ACurrentIndex, ACount: integer);
procedure ShowHistory(const AnnotationActions: TList<IAnnotationAction>; const ACurrentActionIndex: integer);
procedure Clear;
function GetZoomFactor: integer;
procedure SetMagnifierTopLeft(const Top, Left: integer);
function GetZoomBoxWidth: integer;
function GetZoomBoxHeight: integer;
procedure ToggleMagnifier;
// View actions
procedure SetActionSaveAllAnnotationsExecute(Event: TNotifyEvent);
procedure SetActionClearMarkersExecute(Event: TNotifyEvent);
procedure SetActionCloseCurrentImageExecute(Event: TNotifyEvent);
procedure SetActionLoadAnnotationsAccept(Event: TNotifyEvent);
procedure SetActionNextImageExecute(Event: TNotifyEvent);
procedure SetActionPresentationModeCombinedExecute(Event: TNotifyEvent);
procedure SetActionPresentationModeMaskExecute(Event: TNotifyEvent);
procedure SetActionPresentationModeOriginalExecute(Event: TNotifyEvent);
procedure SetActionPreviousImageExecute(Event: TNotifyEvent);
procedure SetActionSaveCurrentAnnotationExecute(Event: TNotifyEvent);
procedure SetActionZoomFactorChangeExecute(Event: TNotifyEvent);
procedure SetFormCloseQuery(Event: TCloseQueryEvent);
procedure SetImageContainerMouseMoveEvent(Event: TMouseMoveEvent);
procedure SetImageCOntainerMouseDownEvent(Event: TMouseEvent);
procedure SetHistoryBoxOnclickEvent(Event: TNotifyEvent);
procedure SetLoadImageMethod(Method: TLoadImageMethod);
procedure SetShowSettingsExecute(Event: TNotifyEvent);
end;
implementation
end.
|
unit Ths.Erp.Database.Table.Attribute;
interface
{$I ThsERP.inc}
implementation
type
AttTableName = class(TCustomAttribute)
private
FName: string;
public
property Name: string read FName write FName;
constructor Create(AValue: string);
end;
type
AttFieldName = class(TCustomAttribute)
private
FName: String;
// FFK: Boolean;
// FAutoInc: Boolean;
// FPK: Boolean;
public
property Name: String read FName write FName;
// property PK: Boolean read FPK write FPK;
// property AutoInc: Boolean read FAutoInc write FAutoInc;
// property FK: Boolean read FFK write FFK;
constructor Create(const AValue: string);
// constructor Create(const AValue: String; const APK: Boolean = False;
// const AAutoInc: Boolean = false; const AFK: Boolean = False);
end;
//type
// AttFildNameHelper = class Helper for TCustomAttribute
// public
// function getFieldName(pFieldName: string): string;
// end;
{ AttTableName }
constructor AttTableName.Create(AValue: string);
begin
FName := AValue;
end;
{ AttFieldName }
constructor AttFieldName.Create(const AValue: string);// const APK, AAutoInc,
//AFK: Boolean);
begin
FName := AValue;
// FPK := APK;
// FAutoInc := AAutoInc;
// FFK := AFK;
end;
{ AttFildNameHelper }
//function AttFildNameHelper.getFieldName(pFieldName: string): string;
//begin
// Result := '';
// if Self is AttFieldName then
// if AttFieldName(Self).FName = pFieldName then
// Result := AttFieldName(Self).FName;
//end;
end.
|
{$R-}
{$Q-}
unit ncEncRipemd128;
// To disable as much of RTTI as possible (Delphi 2009/2010),
// Note: There is a bug if $RTTI is used before the "unit <unitname>;" section of a unit, hence the position
{$IF CompilerVersion >= 21.0}
{$WEAKLINKRTTI ON}
{$RTTI EXPLICIT METHODS([]) PROPERTIES([]) FIELDS([])}
{$ENDIF}
interface
uses
System.Classes, System.Sysutils, ncEnccrypt2;
type
TncEnc_ripemd128 = class(TncEnc_hash)
protected
LenHi, LenLo: longword;
Index: DWord;
CurrentHash: array [0 .. 3] of DWord;
HashBuffer: array [0 .. 63] of byte;
procedure Compress;
public
class function GetAlgorithm: string; override;
class function GetHashSize: integer; override;
class function SelfTest: boolean; override;
procedure Init; override;
procedure Burn; override;
procedure Update(const Buffer; Size: longword); override;
procedure Final(var Digest); override;
end;
{ ****************************************************************************** }
{ ****************************************************************************** }
implementation
uses ncEncryption;
procedure TncEnc_ripemd128.Compress;
var
X: array [0 .. 15] of DWord;
a, aa, b, bb, c, cc, d, dd, t: DWord;
begin
Move(HashBuffer, X, Sizeof(X));
a := CurrentHash[0];
aa := a;
b := CurrentHash[1];
bb := b;
c := CurrentHash[2];
cc := c;
d := CurrentHash[3];
dd := d;
t := a + (b xor c xor d) + X[0];
a := (t shl 11) or (t shr (32 - 11));
t := d + (a xor b xor c) + X[1];
d := (t shl 14) or (t shr (32 - 14));
t := c + (d xor a xor b) + X[2];
c := (t shl 15) or (t shr (32 - 15));
t := b + (c xor d xor a) + X[3];
b := (t shl 12) or (t shr (32 - 12));
t := a + (b xor c xor d) + X[4];
a := (t shl 5) or (t shr (32 - 5));
t := d + (a xor b xor c) + X[5];
d := (t shl 8) or (t shr (32 - 8));
t := c + (d xor a xor b) + X[6];
c := (t shl 7) or (t shr (32 - 7));
t := b + (c xor d xor a) + X[7];
b := (t shl 9) or (t shr (32 - 9));
t := a + (b xor c xor d) + X[8];
a := (t shl 11) or (t shr (32 - 11));
t := d + (a xor b xor c) + X[9];
d := (t shl 13) or (t shr (32 - 13));
t := c + (d xor a xor b) + X[10];
c := (t shl 14) or (t shr (32 - 14));
t := b + (c xor d xor a) + X[11];
b := (t shl 15) or (t shr (32 - 15));
t := a + (b xor c xor d) + X[12];
a := (t shl 6) or (t shr (32 - 6));
t := d + (a xor b xor c) + X[13];
d := (t shl 7) or (t shr (32 - 7));
t := c + (d xor a xor b) + X[14];
c := (t shl 9) or (t shr (32 - 9));
t := b + (c xor d xor a) + X[15];
b := (t shl 8) or (t shr (32 - 8));
t := a + ((b and c) or (not b and d)) + X[7] + $5A827999;
a := (t shl 7) or (t shr (32 - 7));
t := d + ((a and b) or (not a and c)) + X[4] + $5A827999;
d := (t shl 6) or (t shr (32 - 6));
t := c + ((d and a) or (not d and b)) + X[13] + $5A827999;
c := (t shl 8) or (t shr (32 - 8));
t := b + ((c and d) or (not c and a)) + X[1] + $5A827999;
b := (t shl 13) or (t shr (32 - 13));
t := a + ((b and c) or (not b and d)) + X[10] + $5A827999;
a := (t shl 11) or (t shr (32 - 11));
t := d + ((a and b) or (not a and c)) + X[6] + $5A827999;
d := (t shl 9) or (t shr (32 - 9));
t := c + ((d and a) or (not d and b)) + X[15] + $5A827999;
c := (t shl 7) or (t shr (32 - 7));
t := b + ((c and d) or (not c and a)) + X[3] + $5A827999;
b := (t shl 15) or (t shr (32 - 15));
t := a + ((b and c) or (not b and d)) + X[12] + $5A827999;
a := (t shl 7) or (t shr (32 - 7));
t := d + ((a and b) or (not a and c)) + X[0] + $5A827999;
d := (t shl 12) or (t shr (32 - 12));
t := c + ((d and a) or (not d and b)) + X[9] + $5A827999;
c := (t shl 15) or (t shr (32 - 15));
t := b + ((c and d) or (not c and a)) + X[5] + $5A827999;
b := (t shl 9) or (t shr (32 - 9));
t := a + ((b and c) or (not b and d)) + X[2] + $5A827999;
a := (t shl 11) or (t shr (32 - 11));
t := d + ((a and b) or (not a and c)) + X[14] + $5A827999;
d := (t shl 7) or (t shr (32 - 7));
t := c + ((d and a) or (not d and b)) + X[11] + $5A827999;
c := (t shl 13) or (t shr (32 - 13));
t := b + ((c and d) or (not c and a)) + X[8] + $5A827999;
b := (t shl 12) or (t shr (32 - 12));
t := a + ((b or not c) xor d) + X[3] + $6ED9EBA1;
a := (t shl 11) or (t shr (32 - 11));
t := d + ((a or not b) xor c) + X[10] + $6ED9EBA1;
d := (t shl 13) or (t shr (32 - 13));
t := c + ((d or not a) xor b) + X[14] + $6ED9EBA1;
c := (t shl 6) or (t shr (32 - 6));
t := b + ((c or not d) xor a) + X[4] + $6ED9EBA1;
b := (t shl 7) or (t shr (32 - 7));
t := a + ((b or not c) xor d) + X[9] + $6ED9EBA1;
a := (t shl 14) or (t shr (32 - 14));
t := d + ((a or not b) xor c) + X[15] + $6ED9EBA1;
d := (t shl 9) or (t shr (32 - 9));
t := c + ((d or not a) xor b) + X[8] + $6ED9EBA1;
c := (t shl 13) or (t shr (32 - 13));
t := b + ((c or not d) xor a) + X[1] + $6ED9EBA1;
b := (t shl 15) or (t shr (32 - 15));
t := a + ((b or not c) xor d) + X[2] + $6ED9EBA1;
a := (t shl 14) or (t shr (32 - 14));
t := d + ((a or not b) xor c) + X[7] + $6ED9EBA1;
d := (t shl 8) or (t shr (32 - 8));
t := c + ((d or not a) xor b) + X[0] + $6ED9EBA1;
c := (t shl 13) or (t shr (32 - 13));
t := b + ((c or not d) xor a) + X[6] + $6ED9EBA1;
b := (t shl 6) or (t shr (32 - 6));
t := a + ((b or not c) xor d) + X[13] + $6ED9EBA1;
a := (t shl 5) or (t shr (32 - 5));
t := d + ((a or not b) xor c) + X[11] + $6ED9EBA1;
d := (t shl 12) or (t shr (32 - 12));
t := c + ((d or not a) xor b) + X[5] + $6ED9EBA1;
c := (t shl 7) or (t shr (32 - 7));
t := b + ((c or not d) xor a) + X[12] + $6ED9EBA1;
b := (t shl 5) or (t shr (32 - 5));
t := a + ((b and d) or (c and not d)) + X[1] + $8F1BBCDC;
a := (t shl 11) or (t shr (32 - 11));
t := d + ((a and c) or (b and not c)) + X[9] + $8F1BBCDC;
d := (t shl 12) or (t shr (32 - 12));
t := c + ((d and b) or (a and not b)) + X[11] + $8F1BBCDC;
c := (t shl 14) or (t shr (32 - 14));
t := b + ((c and a) or (d and not a)) + X[10] + $8F1BBCDC;
b := (t shl 15) or (t shr (32 - 15));
t := a + ((b and d) or (c and not d)) + X[0] + $8F1BBCDC;
a := (t shl 14) or (t shr (32 - 14));
t := d + ((a and c) or (b and not c)) + X[8] + $8F1BBCDC;
d := (t shl 15) or (t shr (32 - 15));
t := c + ((d and b) or (a and not b)) + X[12] + $8F1BBCDC;
c := (t shl 9) or (t shr (32 - 9));
t := b + ((c and a) or (d and not a)) + X[4] + $8F1BBCDC;
b := (t shl 8) or (t shr (32 - 8));
t := a + ((b and d) or (c and not d)) + X[13] + $8F1BBCDC;
a := (t shl 9) or (t shr (32 - 9));
t := d + ((a and c) or (b and not c)) + X[3] + $8F1BBCDC;
d := (t shl 14) or (t shr (32 - 14));
t := c + ((d and b) or (a and not b)) + X[7] + $8F1BBCDC;
c := (t shl 5) or (t shr (32 - 5));
t := b + ((c and a) or (d and not a)) + X[15] + $8F1BBCDC;
b := (t shl 6) or (t shr (32 - 6));
t := a + ((b and d) or (c and not d)) + X[14] + $8F1BBCDC;
a := (t shl 8) or (t shr (32 - 8));
t := d + ((a and c) or (b and not c)) + X[5] + $8F1BBCDC;
d := (t shl 6) or (t shr (32 - 6));
t := c + ((d and b) or (a and not b)) + X[6] + $8F1BBCDC;
c := (t shl 5) or (t shr (32 - 5));
t := b + ((c and a) or (d and not a)) + X[2] + $8F1BBCDC;
b := (t shl 12) or (t shr (32 - 12));
t := aa + ((bb and dd) or (cc and not dd)) + X[5] + $50A28BE6;
aa := (t shl 8) or (t shr (32 - 8));
t := dd + ((aa and cc) or (bb and not cc)) + X[14] + $50A28BE6;
dd := (t shl 9) or (t shr (32 - 9));
t := cc + ((dd and bb) or (aa and not bb)) + X[7] + $50A28BE6;
cc := (t shl 9) or (t shr (32 - 9));
t := bb + ((cc and aa) or (dd and not aa)) + X[0] + $50A28BE6;
bb := (t shl 11) or (t shr (32 - 11));
t := aa + ((bb and dd) or (cc and not dd)) + X[9] + $50A28BE6;
aa := (t shl 13) or (t shr (32 - 13));
t := dd + ((aa and cc) or (bb and not cc)) + X[2] + $50A28BE6;
dd := (t shl 15) or (t shr (32 - 15));
t := cc + ((dd and bb) or (aa and not bb)) + X[11] + $50A28BE6;
cc := (t shl 15) or (t shr (32 - 15));
t := bb + ((cc and aa) or (dd and not aa)) + X[4] + $50A28BE6;
bb := (t shl 5) or (t shr (32 - 5));
t := aa + ((bb and dd) or (cc and not dd)) + X[13] + $50A28BE6;
aa := (t shl 7) or (t shr (32 - 7));
t := dd + ((aa and cc) or (bb and not cc)) + X[6] + $50A28BE6;
dd := (t shl 7) or (t shr (32 - 7));
t := cc + ((dd and bb) or (aa and not bb)) + X[15] + $50A28BE6;
cc := (t shl 8) or (t shr (32 - 8));
t := bb + ((cc and aa) or (dd and not aa)) + X[8] + $50A28BE6;
bb := (t shl 11) or (t shr (32 - 11));
t := aa + ((bb and dd) or (cc and not dd)) + X[1] + $50A28BE6;
aa := (t shl 14) or (t shr (32 - 14));
t := dd + ((aa and cc) or (bb and not cc)) + X[10] + $50A28BE6;
dd := (t shl 14) or (t shr (32 - 14));
t := cc + ((dd and bb) or (aa and not bb)) + X[3] + $50A28BE6;
cc := (t shl 12) or (t shr (32 - 12));
t := bb + ((cc and aa) or (dd and not aa)) + X[12] + $50A28BE6;
bb := (t shl 6) or (t shr (32 - 6));
t := aa + ((bb or not cc) xor dd) + X[6] + $5C4DD124;
aa := (t shl 9) or (t shr (32 - 9));
t := dd + ((aa or not bb) xor cc) + X[11] + $5C4DD124;
dd := (t shl 13) or (t shr (32 - 13));
t := cc + ((dd or not aa) xor bb) + X[3] + $5C4DD124;
cc := (t shl 15) or (t shr (32 - 15));
t := bb + ((cc or not dd) xor aa) + X[7] + $5C4DD124;
bb := (t shl 7) or (t shr (32 - 7));
t := aa + ((bb or not cc) xor dd) + X[0] + $5C4DD124;
aa := (t shl 12) or (t shr (32 - 12));
t := dd + ((aa or not bb) xor cc) + X[13] + $5C4DD124;
dd := (t shl 8) or (t shr (32 - 8));
t := cc + ((dd or not aa) xor bb) + X[5] + $5C4DD124;
cc := (t shl 9) or (t shr (32 - 9));
t := bb + ((cc or not dd) xor aa) + X[10] + $5C4DD124;
bb := (t shl 11) or (t shr (32 - 11));
t := aa + ((bb or not cc) xor dd) + X[14] + $5C4DD124;
aa := (t shl 7) or (t shr (32 - 7));
t := dd + ((aa or not bb) xor cc) + X[15] + $5C4DD124;
dd := (t shl 7) or (t shr (32 - 7));
t := cc + ((dd or not aa) xor bb) + X[8] + $5C4DD124;
cc := (t shl 12) or (t shr (32 - 12));
t := bb + ((cc or not dd) xor aa) + X[12] + $5C4DD124;
bb := (t shl 7) or (t shr (32 - 7));
t := aa + ((bb or not cc) xor dd) + X[4] + $5C4DD124;
aa := (t shl 6) or (t shr (32 - 6));
t := dd + ((aa or not bb) xor cc) + X[9] + $5C4DD124;
dd := (t shl 15) or (t shr (32 - 15));
t := cc + ((dd or not aa) xor bb) + X[1] + $5C4DD124;
cc := (t shl 13) or (t shr (32 - 13));
t := bb + ((cc or not dd) xor aa) + X[2] + $5C4DD124;
bb := (t shl 11) or (t shr (32 - 11));
t := aa + ((bb and cc) or (not bb and dd)) + X[15] + $6D703EF3;
aa := (t shl 9) or (t shr (32 - 9));
t := dd + ((aa and bb) or (not aa and cc)) + X[5] + $6D703EF3;
dd := (t shl 7) or (t shr (32 - 7));
t := cc + ((dd and aa) or (not dd and bb)) + X[1] + $6D703EF3;
cc := (t shl 15) or (t shr (32 - 15));
t := bb + ((cc and dd) or (not cc and aa)) + X[3] + $6D703EF3;
bb := (t shl 11) or (t shr (32 - 11));
t := aa + ((bb and cc) or (not bb and dd)) + X[7] + $6D703EF3;
aa := (t shl 8) or (t shr (32 - 8));
t := dd + ((aa and bb) or (not aa and cc)) + X[14] + $6D703EF3;
dd := (t shl 6) or (t shr (32 - 6));
t := cc + ((dd and aa) or (not dd and bb)) + X[6] + $6D703EF3;
cc := (t shl 6) or (t shr (32 - 6));
t := bb + ((cc and dd) or (not cc and aa)) + X[9] + $6D703EF3;
bb := (t shl 14) or (t shr (32 - 14));
t := aa + ((bb and cc) or (not bb and dd)) + X[11] + $6D703EF3;
aa := (t shl 12) or (t shr (32 - 12));
t := dd + ((aa and bb) or (not aa and cc)) + X[8] + $6D703EF3;
dd := (t shl 13) or (t shr (32 - 13));
t := cc + ((dd and aa) or (not dd and bb)) + X[12] + $6D703EF3;
cc := (t shl 5) or (t shr (32 - 5));
t := bb + ((cc and dd) or (not cc and aa)) + X[2] + $6D703EF3;
bb := (t shl 14) or (t shr (32 - 14));
t := aa + ((bb and cc) or (not bb and dd)) + X[10] + $6D703EF3;
aa := (t shl 13) or (t shr (32 - 13));
t := dd + ((aa and bb) or (not aa and cc)) + X[0] + $6D703EF3;
dd := (t shl 13) or (t shr (32 - 13));
t := cc + ((dd and aa) or (not dd and bb)) + X[4] + $6D703EF3;
cc := (t shl 7) or (t shr (32 - 7));
t := bb + ((cc and dd) or (not cc and aa)) + X[13] + $6D703EF3;
bb := (t shl 5) or (t shr (32 - 5));
t := aa + (bb xor cc xor dd) + X[8];
aa := (t shl 15) or (t shr (32 - 15));
t := dd + (aa xor bb xor cc) + X[6];
dd := (t shl 5) or (t shr (32 - 5));
t := cc + (dd xor aa xor bb) + X[4];
cc := (t shl 8) or (t shr (32 - 8));
t := bb + (cc xor dd xor aa) + X[1];
bb := (t shl 11) or (t shr (32 - 11));
t := aa + (bb xor cc xor dd) + X[3];
aa := (t shl 14) or (t shr (32 - 14));
t := dd + (aa xor bb xor cc) + X[11];
dd := (t shl 14) or (t shr (32 - 14));
t := cc + (dd xor aa xor bb) + X[15];
cc := (t shl 6) or (t shr (32 - 6));
t := bb + (cc xor dd xor aa) + X[0];
bb := (t shl 14) or (t shr (32 - 14));
t := aa + (bb xor cc xor dd) + X[5];
aa := (t shl 6) or (t shr (32 - 6));
t := dd + (aa xor bb xor cc) + X[12];
dd := (t shl 9) or (t shr (32 - 9));
t := cc + (dd xor aa xor bb) + X[2];
cc := (t shl 12) or (t shr (32 - 12));
t := bb + (cc xor dd xor aa) + X[13];
bb := (t shl 9) or (t shr (32 - 9));
t := aa + (bb xor cc xor dd) + X[9];
aa := (t shl 12) or (t shr (32 - 12));
t := dd + (aa xor bb xor cc) + X[7];
dd := (t shl 5) or (t shr (32 - 5));
t := cc + (dd xor aa xor bb) + X[10];
cc := (t shl 15) or (t shr (32 - 15));
t := bb + (cc xor dd xor aa) + X[14];
bb := (t shl 8) or (t shr (32 - 8));
Inc(dd, c + CurrentHash[1]);
CurrentHash[1] := CurrentHash[2] + d + aa;
CurrentHash[2] := CurrentHash[3] + a + bb;
CurrentHash[3] := CurrentHash[0] + b + cc;
CurrentHash[0] := dd;
FillChar(X, Sizeof(X), 0);
Index := 0;
FillChar(HashBuffer, Sizeof(HashBuffer), 0);
end;
class function TncEnc_ripemd128.GetHashSize: integer;
begin
Result := 128;
end;
class function TncEnc_ripemd128.GetAlgorithm: string;
begin
Result := 'RipeMD-128';
end;
class function TncEnc_ripemd128.SelfTest: boolean;
const
Test1Out: array [0 .. 15] of byte = ($86, $BE, $7A, $FA, $33, $9D, $0F, $C7, $CF, $C7, $85, $E7, $2F, $57, $8D, $33);
Test2Out: array [0 .. 15] of byte = ($FD, $2A, $A6, $07, $F7, $1D, $C8, $F5, $10, $71, $49, $22, $B3, $71, $83, $4E);
var
TestHash: TncEnc_ripemd128;
TestOut: array [0 .. 15] of byte;
begin
TestHash := TncEnc_ripemd128.Create(nil);
TestHash.Init;
TestHash.UpdateStr('a');
TestHash.Final(TestOut);
Result := CompareMem(@TestOut, @Test1Out, Sizeof(Test1Out));
TestHash.Init;
TestHash.UpdateStr('abcdefghijklmnopqrstuvwxyz');
TestHash.Final(TestOut);
Result := CompareMem(@TestOut, @Test2Out, Sizeof(Test2Out)) and Result;
TestHash.Free;
end;
procedure TncEnc_ripemd128.Init;
begin
Burn;
CurrentHash[0] := $67452301;
CurrentHash[1] := $EFCDAB89;
CurrentHash[2] := $98BADCFE;
CurrentHash[3] := $10325476;
fInitialized := true;
end;
procedure TncEnc_ripemd128.Burn;
begin
LenHi := 0;
LenLo := 0;
Index := 0;
FillChar(HashBuffer, Sizeof(HashBuffer), 0);
FillChar(CurrentHash, Sizeof(CurrentHash), 0);
fInitialized := false;
end;
procedure TncEnc_ripemd128.Update(const Buffer; Size: longword);
var
PBuf: ^byte;
begin
if not fInitialized then
raise EncEnc_hash.Create('Hash not initialized');
Inc(LenHi, Size shr 29);
Inc(LenLo, Size * 8);
if LenLo < (Size * 8) then
Inc(LenHi);
PBuf := @Buffer;
while Size > 0 do
begin
if (Sizeof(HashBuffer) - Index) <= DWord(Size) then
begin
Move(PBuf^, HashBuffer[Index], Sizeof(HashBuffer) - Index);
Dec(Size, Sizeof(HashBuffer) - Index);
Inc(PBuf, Sizeof(HashBuffer) - Index);
Compress;
end
else
begin
Move(PBuf^, HashBuffer[Index], Size);
Inc(Index, Size);
Size := 0;
end;
end;
end;
procedure TncEnc_ripemd128.Final(var Digest);
begin
if not fInitialized then
raise EncEnc_hash.Create('Hash not initialized');
HashBuffer[Index] := $80;
if Index >= 56 then
Compress;
PDWord(@HashBuffer[56])^ := LenLo;
PDWord(@HashBuffer[60])^ := LenHi;
Compress;
Move(CurrentHash, Digest, Sizeof(CurrentHash));
Burn;
end;
end.
|
//28Feb1999 - modified getFirstToken to handle TABs as well
// - now triming the remaining of s and the function return value in all functions
// - adding the getFirstTokenUsingSeparators routine
// - now getFirstToken is implemented a getFirstTokenUsingSeparators call (for SPACE and TAB)
unit Tokenizer;
interface
uses SysUtils;
function GetFirstToken(var s:string):string;
function checkFirst(const t:string):string;
function GetFirstTokenUsingSeparator(var s:string;separator:char):string;
function GetFirstTokenUsingSeparators(var s:string;separators:string):string;
procedure ParsingError(e:Exception);
var parseLine,parseToken:integer;
implementation
uses Dialogs,ac_Strings;
const TAB=#9;
procedure ParsingError;
begin
ShowMessage('Parsing error at line: '+IntToStr(parseLine)+', token position: '+IntToStr(parseToken)+#13+'Message was: '+e.message);
end;
function checkFirst;
var i:integer;
s:string;
begin
s:=TrimLeft(t);
i:=FindChars(s,' '+TAB,1); //s must be the 1st param
if i=0 then result:=trim(s) else result:=trim(copy(s,1,i-1));
end;
function GetFirstTokenUsingSeparator;
var i:integer;
begin
s:=TrimLeft(s); //maybe should be TrimLeftUsingSeparator(?) [or remove this, cause may eat up wanted control chars]
inc(parseToken);
i:=pos(separator,s);
if i=0 then begin result:=trim(s); s:=''; end
else begin result:=trim(copy(s,1,i-1)); s:=trim(copy(s,i+1,length(s)-i)); end;
end;
function GetFirstTokenUsingSeparators;
var i:integer;
begin
s:=TrimLeft(s); //maybe should be TrimLeftUsingSeparator(?) [or remove this, cause may eat up wanted control chars]
inc(parseToken);
i:=FindChars(s,separators,1);
if i=0 then begin result:=trim(s); s:=''; end
else begin result:=trim(copy(s,1,i-1)); s:=trim(copy(s,i+1,length(s)-i)); end;
end;
function GetFirstToken;
begin
result:=GetFirstTokenUsingSeparators(s,' '+TAB);
end;
end.
|
unit UTool;
interface
uses system.Classes, system.Threading,System.StrUtils,System.Types,System.SysUtils;
type
TLoadThread = class(TThread)
private
FProgressDialogThread: TThread;
procedure DoProcessing;
public
ID: integer;
Lastname: string;
Firstname: string;
Age: integer;
constructor Create(const aID: integer; const aLastname, aFirstname: string; const aAge: integer); reintroduce;
protected
procedure Execute; override;
end;
implementation
procedure CreateLogfile;
var
F: TextFile;
FN: String;
begin
FN := ChangeFileExt(ParamStr(0), '.log');
AssignFile(F, FN);
Rewrite(F);
Append(F);
WriteLn(F,sLineBreak);
WriteLn(F, 'This Logfile was created on ' + DateTimeToStr(Now));
WriteLn(F, sLineBreak);
WriteLn(F, '');
CloseFile(F);
end;
// Procedure for appending a Message to an existing logfile with current Date and Time **
procedure WriteToLog(aLogMessage: String);
var
F: TextFile;
FN: String;
begin
FN := ChangeFileExt(ParamStr(0), '.log');
if (not FileExists(FN)) then
begin
CreateLogfile;
end;
AssignFile(F, FN);
Append(F);
WriteLn(F, DateTimeToStr(Now) + ': ' + aLogMessage);
CloseFile(F)
end;
constructor TLoadThread.Create(const aID: integer; const aLastname, aFirstname: string; const aAge: integer);
begin
inherited Create(True);
FreeOnTerminate := True;
ID := aID;
Lastname := aLastname;
Firstname := aFirstname;
Age := aAge;
end;
procedure TLoadThread.DoProcessing;
var
slog:string;
begin
// do processing adding log
slog:='(ID) '+'" '+ID.tostring+' "'+char(9)+'- Lastname : '+Lastname+char(9)
+'- Firstname : '+firstname+char(9)+'- Age : '+Age.ToString+char(9)+'.';
WriteToLog(slog);
// Create separated thread for long operations
end;
procedure TLoadThread.Execute;
begin
// do processing
// Synchronize( procedure
// update main form
// end);
// do processing
// FreeOnTerminate:= true;
Synchronize(DoProcessing);
end;
end.
|
unit uVeiculo;
interface
uses uiVeiculo;
type
TVeiculo = class(TInterfacedObject, iVeiculo)
private
{ private declarations }
FkmInicial: Integer;
FkmFinal: Integer;
FquantLitros: Currency;
FvalorCombustivel: Currency;
FcapacidadeTanque: Currency;
function GetKmInicial: Integer;
function GetKmFinal: Integer;
function GetQuantLitros: Currency;
function GetValorCombustivel: Currency;
function GetCapacidadeTanque: Currency;
public
{ public declarations }
constructor Create( pckmInicial,
pckmFinal: Integer;
pcquantLitros,
pcvalorCombustivel,
pccapacidadeTanque: Currency);
property kmInicial: Integer read GetKmInicial;
property kmFinal: Integer read GetKmFinal;
property quantLitros: Currency read GetQuantLitros;
property valorCombustivel: Currency read GetValorCombustivel;
property capacidadeTanque: Currency read GetCapacidadeTanque;
function QuilometragemRodada: Currency;
function QuilometrosPorLitro: Currency;
function CustoDaViagem: Currency;
function Autonomia: Currency;
end;
implementation
{ TVeiculo }
function TVeiculo.Autonomia: Currency;
begin
Result := QuilometrosPorLitro * FcapacidadeTanque;
end;
constructor TVeiculo.Create(
pckmInicial,
pckmFinal: Integer;
pcquantLitros,
pcvalorCombustivel,
pccapacidadeTanque: Currency);
begin
FkmInicial := pckmInicial;
FkmFinal := pckmFinal;
FquantLitros := pcquantLitros;
FvalorCombustivel := pcvalorCombustivel;
FcapacidadeTanque := pccapacidadeTanque;
end;
function TVeiculo.CustoDaViagem: Currency;
begin
Result := QuilometragemRodada * FvalorCombustivel;
end;
function TVeiculo.GetCapacidadeTanque: Currency;
begin
Result := FcapacidadeTanque;
end;
function TVeiculo.GetKmFinal: Integer;
begin
Result := FkmFinal;
end;
function TVeiculo.GetKmInicial: Integer;
begin
Result := FkmInicial;
end;
function TVeiculo.GetQuantLitros: Currency;
begin
Result := FquantLitros;
end;
function TVeiculo.GetValorCombustivel: Currency;
begin
Result := FvalorCombustivel;
end;
function TVeiculo.QuilometragemRodada: Currency;
begin
Result := FkmFinal - FkmInicial;
end;
function TVeiculo.QuilometrosPorLitro: Currency;
begin
Result := QuilometragemRodada / FquantLitros;
end;
end.
|
unit MediaProcessing.Convertor.RGB.VFW.Impl;
interface
uses SysUtils,Windows,Classes, MediaProcessing.Definitions,MediaProcessing.Global, MediaProcessing.Convertor.RGB.VFW, VFW,JPeg;
type
TMediaProcessor_Convertor_Rgb_Vfw_Impl =class (TMediaProcessor_Convertor_Rgb_Vfw,IMediaProcessorImpl)
private
FInInfo : TBitmapInfo;
FOutInfo: PBitmapInfo;
FCVInited: boolean;
FCV: TCOMPVARS;
procedure InitCompressor(const aSourceInfo: TMediaStreamDataHeader;aInDataSize:cardinal);
procedure DeinitCompressor;
protected
procedure Prepare; override;
procedure Process(aInData: pointer; aInDataSize:cardinal; const aInFormat: TMediaStreamDataHeader; aInfo: pointer; aInfoSize: cardinal;
out aOutData: pointer; out aOutDataSize: cardinal; out aOutFormat: TMediaStreamDataHeader; out aOutInfo: pointer; out aOutInfoSize: cardinal); override;
public
constructor Create; override;
destructor Destroy; override;
end;
implementation
uses uBaseClasses;
constructor TMediaProcessor_Convertor_Rgb_Vfw_Impl.Create;
begin
inherited;
end;
destructor TMediaProcessor_Convertor_Rgb_Vfw_Impl.Destroy;
var
aHandle: THandle;
begin
DeinitCompressor;
if FCV.hic<>0 then
try
aHandle:=FCV.hic;
ICCompressorFree(@FCV);
ICClose(aHandle);
except
end;
inherited;
end;
procedure TMediaProcessor_Convertor_Rgb_Vfw_Impl.InitCompressor(const aSourceInfo: TMediaStreamDataHeader;aInDataSize:cardinal);
var
aOutFormatSize : cardinal;
begin
Assert(FCV.hic<>0);
//Инициализируем ввод
ZeroMemory(@FInInfo,sizeof(FInInfo));
FInInfo.bmiHeader:=aSourceInfo.ToBitmapInfoHeader(aInDataSize);
//Получаем размер выходного буфера
aOutFormatSize:=ICCompressGetFormatSize(FCV.hic,@FInInfo);
if integer(aOutFormatSize)<=0 then
RaiseLastOSError;
//... и сам буфер для формата
FOutInfo:=AllocMem(aOutFormatSize);
ICCheck(ICCompressGetFormat(FCV.hic,@FInInfo.bmiHeader,@FOutInfo.bmiHeader));
//FOutBufferSize:=ICCompressGetSize(aHic,@FInInfo.bmiHeader,@FOutInfo.bmiHeader);
//Запускаем процесс
FCV.dwFlags:=ICMF_COMPVARS_VALID;
FCV.cbSize:=sizeof(FCV);
FCV.cbState:=0;
FCV.fccHandler:=FCodecFCC;
FCV.fccType:=ICTYPE_VIDEO;
FCV.lDataRate:=0;//780;
FCV.lFrame:=0;
FCV.lKey:=ICGetDefaultKeyFrameRate(FCV.hic);
FCV.lKeyCount:=0;
FCV.lpbiIn:=nil;
FCV.lpBitsOut:=nil;
FCV.lpBitsPrev:=nil;
FCV.lpState:=nil;
FCV.lQ:=ICGetDefaultQuality(FCV.hic);
if not ICSeqCompressFrameStart(@FCV,@FInInfo) then
RaiseLastOSError;
Set8087CW($133f);
FCVInited:=true;
end;
procedure TMediaProcessor_Convertor_Rgb_Vfw_Impl.DeinitCompressor;
begin
if FCVInited then
begin
ICSeqCompressFrameEnd(@FCV);
end;
FreeMem(FOutInfo);
FOutInfo:=nil;
FCVInited:=false;
end;
procedure TMediaProcessor_Convertor_Rgb_Vfw_Impl.Process(aInData: pointer; aInDataSize:cardinal; const aInFormat: TMediaStreamDataHeader; aInfo: pointer; aInfoSize: cardinal;
out aOutData: pointer; out aOutDataSize: cardinal; out aOutFormat: TMediaStreamDataHeader; out aOutInfo: pointer; out aOutInfoSize: cardinal);
var
bKeyFrame: boolean;
begin
TArgumentValidation.NotNil(aInData);
Assert(aInFormat.biStreamType=stRGB);
aOutData:=nil;
aOutDataSize:=0;
aOutInfo:=nil;
aOutInfoSize:=0;
if (FInInfo.bmiHeader.biWidth<>aInFormat.VideoWidth) or
(FInInfo.bmiHeader.biHeight<>aInFormat.VideoHeight) or
(FInInfo.bmiHeader.biBitCount<>aInFormat.VideoBitCount) then
DeinitCompressor;
if not FCVInited then
InitCompressor(aInFormat,aInDataSize);
//m_OutActSize:=FInInfo.bmiHeader.biSizeImage;
aOutData:=ICSeqCompressFrame(@FCV,0,aInData,@bKeyFrame,@aOutDataSize);
aOutFormat.Assign(FOutInfo.bmiHeader);
aOutFormat.Channel:=aInFormat.Channel;
aOutFormat.TimeStamp:=aInFormat.TimeStamp;
aOutFormat.TimeKoeff:=aInFormat.TimeKoeff;
if bKeyFrame then
Include(aOutFormat.biFrameFlags,ffKeyFrame)
else
Exclude(aOutFormat.biFrameFlags,ffKeyFrame);
end;
procedure TMediaProcessor_Convertor_Rgb_Vfw_Impl.Prepare;
var
aHic: THandle;
x: cardinal;
begin
inherited;
if FCodecFCC=0 then
raise Exception.Create('Не указан кодек');
//Открываем компрессор
if FCodecMode=cmRealTime then
x:=ICMODE_FASTCOMPRESS
else
x:=ICMODE_COMPRESS;
aHic:=ICOpen(ICTYPE_VIDEO,FCodecFCC,x);
if aHic=0 then
RaiseLastOSError;
try
if Length(FCodecState)>0 then
ICSetState(aHic,FCodecState,Length(FCodecState));
except
ICClose(FCV.hic);
raise;
end;
ZeroMemory(@FCV,sizeof(FCV));
FCV.hic:=aHic;
end;
initialization
MediaProceccorFactory.RegisterMediaProcessorImplementation(TMediaProcessor_Convertor_Rgb_Vfw_Impl);
end.
|
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdIOHandler, IdIOHandlerSocket, IdIOHandlerStack, IdSSL,
IdSSLOpenSSL, IdMessage, IdBaseComponent, IdComponent, IdTCPConnection,
IdTCPClient, IdExplicitTLSClientServerBase, IdMessageClient, IdPOP3, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
POP3: TIdPOP3;
IdMessage1: TIdMessage;
IO_OpenSSL: TIdSSLIOHandlerSocketOpenSSL;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
Var
lMsg: TIdMessage;
i: Integer;
iMsgs: Integer;
begin
//http://www.devmedia.com.br/forum/ler-receber-e-mail-com-indy/385697
//Configurações
with POP3 do begin
IOHandler := IO_OpenSSL;
AutoLogin := True;
Host := 'pop.googlemail.com';
Username := 'xxx@xxxxxxxx.com.br';
UseTLS := utUseImplicitTLS;
Password := 'dsf3d93d0';
Port := 995;
end;
with IO_OpenSSL do begin
Destination := 'pop.googlemail.com:995';
Host := 'pop.googlemail.com';
Port := 995;
SSLOptions.Method := sslvSSLv23;
SSLOptions.Mode := sslmClient;
end;
//Conectando
if not POP3.Connected then
POP3.Connect;
//testa a conexão
if not POP3.Connected then
Begin
ShowMessage('Conexão não realizada!');
Exit;
End;
//Pega a qtd de msg que há na caixa de entrada
iMsgs := POP3.CheckMessages;
end;
end.
|
unit RMD160;
{RIPEMD-160 - 160 bit Secure Hash Function}
interface
(*************************************************************************
DESCRIPTION : RIPEMD-160 - 160 bit Secure Hash Function
REQUIREMENTS : TP5-7, D1-D7/D9-D10/D12/D17-D18/D25S, FPC, VP
EXTERNAL DATA : ---
MEMORY USAGE : ---
DISPLAY MODE : ---
REFERENCES : - H.Dobbertin, A.Bosselaers, B.Preneel: RIPEMD-160, a strengthened version of RIPEMD,
from http://www.esat.kuleuven.ac.be/~cosicart/pdf/AB-9601/AB-9601.pdf
- A.Bosselaers' page at http://homes.esat.kuleuven.be/~bosselae/ripemd160.html
- Crypto++: http://www.eskimo.com/~weidai/cryptlib.html
Version Date Author Modification
------- -------- ------- ------------------------------------------
0.10 31.01.06 W.Ehrhardt Initial version based on SHA1 layout
0.11 31.01.06 we BASM16 and TP5/5.5
0.12 31.01.06 we Compress with 2 parameters, no local copy for BIT32
0.13 01.02.06 we RL10 for TP5.x
0.14 01.02.06 we Speedup for Delphi32 by factor 2.5
0.15 11.02.06 we Descriptor as typed const
0.16 28.03.06 we Removed $ifdef StrictLong
0.17 07.08.06 we $ifdef BIT32: (const fname: shortstring...)
0.18 22.02.07 we values for OID vector
0.19 30.06.07 we Use conditional define FPC_ProcVar
0.20 04.10.07 we FPC: {$asmmode intel}
0.21 03.05.08 we Bit-API: RMD160FinalBits/Ex
0.22 05.05.08 we THashDesc constant with HFinalBit field
0.23 12.05.08 we Test vectors for regression testing
0.24 20.05.08 we Undo change 'RMD160' instead of 'RIPEMD160'
0.25 12.11.08 we uses BTypes, Ptr2Inc and/or Str255/Str127
0.26 26.12.12 we D17 and PurePascal
0.27 16.08.15 we Removed $ifdef DLL / stdcall
0.28 28.03.17 we No '$asmmode intel' for CPUARM
0.29 15.05.17 we adjust OID to new MaxOIDLen
0.30 29.11.17 we RMD160File - fname: string
**************************************************************************)
(*-------------------------------------------------------------------------
(C) Copyright 2006-2017 Wolfgang Ehrhardt
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from
the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software in
a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
----------------------------------------------------------------------------*)
{$i STD.INC}
{$ifdef BIT64}
{$ifndef PurePascal}
{$define PurePascal}
{$endif}
{$endif}
uses
BTypes,Hash;
procedure RMD160Init(var Context: THashContext);
{-initialize context}
procedure RMD160Update(var Context: THashContext; Msg: pointer; Len: word);
{-update context with Msg data}
procedure RMD160UpdateXL(var Context: THashContext; Msg: pointer; Len: longint);
{-update context with Msg data}
procedure RMD160Final(var Context: THashContext; var Digest: TRMD160Digest);
{-finalize RMD160 calculation, clear context}
procedure RMD160FinalEx(var Context: THashContext; var Digest: THashDigest);
{-finalize RMD160 calculation, clear context}
procedure RMD160FinalBitsEx(var Context: THashContext; var Digest: THashDigest; BData: byte; bitlen: integer);
{-finalize RMD160 calculation with bitlen bits from BData (big-endian), clear context}
procedure RMD160FinalBits(var Context: THashContext; var Digest: TRMD160Digest; BData: byte; bitlen: integer);
{-finalize RMD160 calculation with bitlen bits from BData (big-endian), clear context}
function RMD160SelfTest: boolean;
{-self test for strings from RMD160 page}
procedure RMD160Full(var Digest: TRMD160Digest; Msg: pointer; Len: word);
{-RMD160 of Msg with init/update/final}
procedure RMD160FullXL(var Digest: TRMD160Digest; Msg: pointer; Len: longint);
{-RMD160 of Msg with init/update/final}
procedure RMD160File({$ifdef CONST} const {$endif} fname: string;
var Digest: TRMD160Digest; var buf; bsize: word; var Err: word);
{-RMD160 of file, buf: buffer with at least bsize bytes}
implementation
{$ifdef FPC}
{$ifndef CPUARM}
{$asmmode intel}
{$endif}
{$endif}
{$ifdef BIT16}
{$F-}
{$endif}
const
RMD160_BlockLen = 64;
const
k1 = longint($5a827999); {2^30*2^(1/2)}
k2 = longint($6ed9eba1); {2^30*3^(1/2)}
k3 = longint($8f1bbcdc); {2^30*5^(1/2)}
k4 = longint($a953fd4e); {2^30*7^(1/2)}
k5 = longint($50a28be6); {2^30*2^(1/3)}
k6 = longint($5c4dd124); {2^30*3^(1/3)}
k7 = longint($6d703ef3); {2^30*5^(1/3)}
k8 = longint($7a6d76e9); {2^30*7^(1/3)}
{1.3.36.3.2.1}
{iso(1) identified-organization(3) teletrust(36) algorithm(3) hashAlgorithm(2) ripemd160(1)}
const
RMD160_OID : TOID_Vec = (1,3,36,3,2,1,-1,-1,-1,-1,-1); {Len=6}
{$ifndef VER5X}
const
RMD160_Desc: THashDesc = (
HSig : C_HashSig;
HDSize : sizeof(THashDesc);
HDVersion : C_HashVers;
HBlockLen : RMD160_BlockLen;
HDigestlen: sizeof(TRMD160Digest);
{$ifdef FPC_ProcVar}
HInit : @RMD160Init;
HFinal : @RMD160FinalEx;
HUpdateXL : @RMD160UpdateXL;
{$else}
HInit : RMD160Init;
HFinal : RMD160FinalEx;
HUpdateXL : RMD160UpdateXL;
{$endif}
HAlgNum : longint(_RIPEMD160);
HName : 'RIPEMD160';
HPtrOID : @RMD160_OID;
HLenOID : 6;
HFill : 0;
{$ifdef FPC_ProcVar}
HFinalBit : @RMD160FinalBitsEx;
{$else}
HFinalBit : RMD160FinalBitsEx;
{$endif}
HReserved : (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
);
{$else}
var
RMD160_Desc: THashDesc;
{$endif}
{$ifndef BIT16}
{$ifdef PurePascal}
{---------------------------------------------------------------------------}
procedure UpdateLen(var whi, wlo: longint; BLen: longint);
{-Add BLen to 64 bit value (wlo, whi)}
var
tmp: int64;
begin
tmp := int64(cardinal(wlo))+Blen;
wlo := longint(tmp and $FFFFFFFF);
inc(whi,longint(tmp shr 32));
end;
{$else}
{---------------------------------------------------------------------------}
procedure UpdateLen(var whi, wlo: longint; BLen: longint);
{-Add BLen to 64 bit value (wlo, whi)}
begin
asm
mov edx, [wlo]
mov ecx, [whi]
mov eax, [Blen]
add [edx], eax
adc dword ptr [ecx], 0
end;
end;
{$endif}
{$else}
{$ifdef BASM16}
{TP5-7/Delphi1 for 386+}
{---------------------------------------------------------------------------}
procedure UpdateLen(var whi, wlo: longint; BLen: longint); assembler;
{-Add BLen to 64 bit value (wlo, whi)}
asm
les di,[wlo]
db $66; mov ax,word ptr [BLen]
db $66; sub dx,dx
db $66; add es:[di],ax
les di,[whi]
db $66; adc es:[di],dx
end;
{$else}
{TP5/5.5}
{---------------------------------------------------------------------------}
procedure UpdateLen(var whi, wlo: longint; BLen: longint);
{-Add BLen to 64 bit value (wlo, whi)}
inline(
$58/ {pop ax }
$5A/ {pop dx }
$5B/ {pop bx }
$07/ {pop es }
$26/$01/$07/ {add es:[bx],ax }
$26/$11/$57/$02/ {adc es:[bx+02],dx}
$5B/ {pop bx }
$07/ {pop es }
$26/$83/$17/$00/ {adc es:[bx],0 }
$26/$83/$57/$02/$00);{adc es:[bx+02],0 }
{$endif BASM16}
{$endif BIT16}
{Note: The functions f2 and f4 from the specification }
{ f2(x, y, z) = (x and y) or (not x and z) }
{ f4(x, y, z) = (x and z) or (y and not z) }
{can be optimized as follows }
{ f2(x, y, z) = (z xor (x and (y xor z))) }
{ f4(x, y, z) = (y xor (z and (x xor y))) }
{found for example in Wei Dai's Crypto++ Library 5.2.1}
{$ifndef BIT16}
{---------------------------------------------------------------------------}
procedure RMD160Compress(var Data: THashState; const Buf: THashBuffer);
{-Actual hashing function}
var
a,b,c,d,e,a1,b1,c1,d1,e1: longint;
X: THashBuf32 absolute Buf;
begin
{Optimization info V0.14: Use the variables a,b,c,d,e in both}
{parallel parts. Delphi32 optimizers keep these variables in }
{registers, in the 'standard' version only a1,..,e1 are kept }
{in registers. With VP/FPC the effect is smaller or vanishing}
{Speedup: 79.6 -> 32.4 Cycles/Byte for D6 / 1.8 GHz P4 Win98}
{ 112.7 -> 93,8 for VP, 126.8 --> 126.8 for FPC 2.0.2}
{Assign old working hash to working variables}
a := Data[0];
b := Data[1];
c := Data[2];
d := Data[3];
e := Data[4];
inc(a,(b xor c xor d)+X[ 0]); a:=(a shl 11 or a shr (32-11))+e; c:=(c shl 10 or c shr (32-10));
inc(e,(a xor b xor c)+X[ 1]); e:=(e shl 14 or e shr (32-14))+d; b:=(b shl 10 or b shr (32-10));
inc(d,(e xor a xor b)+X[ 2]); d:=(d shl 15 or d shr (32-15))+c; a:=(a shl 10 or a shr (32-10));
inc(c,(d xor e xor a)+X[ 3]); c:=(c shl 12 or c shr (32-12))+b; e:=(e shl 10 or e shr (32-10));
inc(b,(c xor d xor e)+X[ 4]); b:=(b shl 5 or b shr (32- 5))+a; d:=(d shl 10 or d shr (32-10));
inc(a,(b xor c xor d)+X[ 5]); a:=(a shl 8 or a shr (32- 8))+e; c:=(c shl 10 or c shr (32-10));
inc(e,(a xor b xor c)+X[ 6]); e:=(e shl 7 or e shr (32- 7))+d; b:=(b shl 10 or b shr (32-10));
inc(d,(e xor a xor b)+X[ 7]); d:=(d shl 9 or d shr (32- 9))+c; a:=(a shl 10 or a shr (32-10));
inc(c,(d xor e xor a)+X[ 8]); c:=(c shl 11 or c shr (32-11))+b; e:=(e shl 10 or e shr (32-10));
inc(b,(c xor d xor e)+X[ 9]); b:=(b shl 13 or b shr (32-13))+a; d:=(d shl 10 or d shr (32-10));
inc(a,(b xor c xor d)+X[10]); a:=(a shl 14 or a shr (32-14))+e; c:=(c shl 10 or c shr (32-10));
inc(e,(a xor b xor c)+X[11]); e:=(e shl 15 or e shr (32-15))+d; b:=(b shl 10 or b shr (32-10));
inc(d,(e xor a xor b)+X[12]); d:=(d shl 6 or d shr (32- 6))+c; a:=(a shl 10 or a shr (32-10));
inc(c,(d xor e xor a)+X[13]); c:=(c shl 7 or c shr (32- 7))+b; e:=(e shl 10 or e shr (32-10));
inc(b,(c xor d xor e)+X[14]); b:=(b shl 9 or b shr (32- 9))+a; d:=(d shl 10 or d shr (32-10));
inc(a,(b xor c xor d)+X[15]); a:=(a shl 8 or a shr (32- 8))+e; c:=(c shl 10 or c shr (32-10));
inc(e,(c xor (a and (b xor c)))+X[ 7]+k1); e:=(e shl 7 or e shr (32- 7))+d; b:=(b shl 10 or b shr (32-10));
inc(d,(b xor (e and (a xor b)))+X[ 4]+k1); d:=(d shl 6 or d shr (32- 6))+c; a:=(a shl 10 or a shr (32-10));
inc(c,(a xor (d and (e xor a)))+X[13]+k1); c:=(c shl 8 or c shr (32- 8))+b; e:=(e shl 10 or e shr (32-10));
inc(b,(e xor (c and (d xor e)))+X[ 1]+k1); b:=(b shl 13 or b shr (32-13))+a; d:=(d shl 10 or d shr (32-10));
inc(a,(d xor (b and (c xor d)))+X[10]+k1); a:=(a shl 11 or a shr (32-11))+e; c:=(c shl 10 or c shr (32-10));
inc(e,(c xor (a and (b xor c)))+X[ 6]+k1); e:=(e shl 9 or e shr (32- 9))+d; b:=(b shl 10 or b shr (32-10));
inc(d,(b xor (e and (a xor b)))+X[15]+k1); d:=(d shl 7 or d shr (32- 7))+c; a:=(a shl 10 or a shr (32-10));
inc(c,(a xor (d and (e xor a)))+X[ 3]+k1); c:=(c shl 15 or c shr (32-15))+b; e:=(e shl 10 or e shr (32-10));
inc(b,(e xor (c and (d xor e)))+X[12]+k1); b:=(b shl 7 or b shr (32- 7))+a; d:=(d shl 10 or d shr (32-10));
inc(a,(d xor (b and (c xor d)))+X[ 0]+k1); a:=(a shl 12 or a shr (32-12))+e; c:=(c shl 10 or c shr (32-10));
inc(e,(c xor (a and (b xor c)))+X[ 9]+k1); e:=(e shl 15 or e shr (32-15))+d; b:=(b shl 10 or b shr (32-10));
inc(d,(b xor (e and (a xor b)))+X[ 5]+k1); d:=(d shl 9 or d shr (32- 9))+c; a:=(a shl 10 or a shr (32-10));
inc(c,(a xor (d and (e xor a)))+X[ 2]+k1); c:=(c shl 11 or c shr (32-11))+b; e:=(e shl 10 or e shr (32-10));
inc(b,(e xor (c and (d xor e)))+X[14]+k1); b:=(b shl 7 or b shr (32- 7))+a; d:=(d shl 10 or d shr (32-10));
inc(a,(d xor (b and (c xor d)))+X[11]+k1); a:=(a shl 13 or a shr (32-13))+e; c:=(c shl 10 or c shr (32-10));
inc(e,(c xor (a and (b xor c)))+X[ 8]+k1); e:=(e shl 12 or e shr (32-12))+d; b:=(b shl 10 or b shr (32-10));
inc(d,(b xor (e or (not a)))+X[ 3]+k2); d:=(d shl 11 or d shr (32-11))+c; a:=(a shl 10 or a shr (32-10));
inc(c,(a xor (d or (not e)))+X[10]+k2); c:=(c shl 13 or c shr (32-13))+b; e:=(e shl 10 or e shr (32-10));
inc(b,(e xor (c or (not d)))+X[14]+k2); b:=(b shl 6 or b shr (32- 6))+a; d:=(d shl 10 or d shr (32-10));
inc(a,(d xor (b or (not c)))+X[ 4]+k2); a:=(a shl 7 or a shr (32- 7))+e; c:=(c shl 10 or c shr (32-10));
inc(e,(c xor (a or (not b)))+X[ 9]+k2); e:=(e shl 14 or e shr (32-14))+d; b:=(b shl 10 or b shr (32-10));
inc(d,(b xor (e or (not a)))+X[15]+k2); d:=(d shl 9 or d shr (32- 9))+c; a:=(a shl 10 or a shr (32-10));
inc(c,(a xor (d or (not e)))+X[ 8]+k2); c:=(c shl 13 or c shr (32-13))+b; e:=(e shl 10 or e shr (32-10));
inc(b,(e xor (c or (not d)))+X[ 1]+k2); b:=(b shl 15 or b shr (32-15))+a; d:=(d shl 10 or d shr (32-10));
inc(a,(d xor (b or (not c)))+X[ 2]+k2); a:=(a shl 14 or a shr (32-14))+e; c:=(c shl 10 or c shr (32-10));
inc(e,(c xor (a or (not b)))+X[ 7]+k2); e:=(e shl 8 or e shr (32- 8))+d; b:=(b shl 10 or b shr (32-10));
inc(d,(b xor (e or (not a)))+X[ 0]+k2); d:=(d shl 13 or d shr (32-13))+c; a:=(a shl 10 or a shr (32-10));
inc(c,(a xor (d or (not e)))+X[ 6]+k2); c:=(c shl 6 or c shr (32- 6))+b; e:=(e shl 10 or e shr (32-10));
inc(b,(e xor (c or (not d)))+X[13]+k2); b:=(b shl 5 or b shr (32- 5))+a; d:=(d shl 10 or d shr (32-10));
inc(a,(d xor (b or (not c)))+X[11]+k2); a:=(a shl 12 or a shr (32-12))+e; c:=(c shl 10 or c shr (32-10));
inc(e,(c xor (a or (not b)))+X[ 5]+k2); e:=(e shl 7 or e shr (32- 7))+d; b:=(b shl 10 or b shr (32-10));
inc(d,(b xor (e or (not a)))+X[12]+k2); d:=(d shl 5 or d shr (32- 5))+c; a:=(a shl 10 or a shr (32-10));
inc(c,(e xor (a and (d xor e)))+X[ 1]+k3); c:=(c shl 11 or c shr (32-11))+b; e:=(e shl 10 or e shr (32-10));
inc(b,(d xor (e and (c xor d)))+X[ 9]+k3); b:=(b shl 12 or b shr (32-12))+a; d:=(d shl 10 or d shr (32-10));
inc(a,(c xor (d and (b xor c)))+X[11]+k3); a:=(a shl 14 or a shr (32-14))+e; c:=(c shl 10 or c shr (32-10));
inc(e,(b xor (c and (a xor b)))+X[10]+k3); e:=(e shl 15 or e shr (32-15))+d; b:=(b shl 10 or b shr (32-10));
inc(d,(a xor (b and (e xor a)))+X[ 0]+k3); d:=(d shl 14 or d shr (32-14))+c; a:=(a shl 10 or a shr (32-10));
inc(c,(e xor (a and (d xor e)))+X[ 8]+k3); c:=(c shl 15 or c shr (32-15))+b; e:=(e shl 10 or e shr (32-10));
inc(b,(d xor (e and (c xor d)))+X[12]+k3); b:=(b shl 9 or b shr (32- 9))+a; d:=(d shl 10 or d shr (32-10));
inc(a,(c xor (d and (b xor c)))+X[ 4]+k3); a:=(a shl 8 or a shr (32- 8))+e; c:=(c shl 10 or c shr (32-10));
inc(e,(b xor (c and (a xor b)))+X[13]+k3); e:=(e shl 9 or e shr (32- 9))+d; b:=(b shl 10 or b shr (32-10));
inc(d,(a xor (b and (e xor a)))+X[ 3]+k3); d:=(d shl 14 or d shr (32-14))+c; a:=(a shl 10 or a shr (32-10));
inc(c,(e xor (a and (d xor e)))+X[ 7]+k3); c:=(c shl 5 or c shr (32- 5))+b; e:=(e shl 10 or e shr (32-10));
inc(b,(d xor (e and (c xor d)))+X[15]+k3); b:=(b shl 6 or b shr (32- 6))+a; d:=(d shl 10 or d shr (32-10));
inc(a,(c xor (d and (b xor c)))+X[14]+k3); a:=(a shl 8 or a shr (32- 8))+e; c:=(c shl 10 or c shr (32-10));
inc(e,(b xor (c and (a xor b)))+X[ 5]+k3); e:=(e shl 6 or e shr (32- 6))+d; b:=(b shl 10 or b shr (32-10));
inc(d,(a xor (b and (e xor a)))+X[ 6]+k3); d:=(d shl 5 or d shr (32- 5))+c; a:=(a shl 10 or a shr (32-10));
inc(c,(e xor (a and (d xor e)))+X[ 2]+k3); c:=(c shl 12 or c shr (32-12))+b; e:=(e shl 10 or e shr (32-10));
inc(b,(c xor (d or (not e)))+X[ 4]+k4); b:=(b shl 9 or b shr (32- 9))+a; d:=(d shl 10 or d shr (32-10));
inc(a,(b xor (c or (not d)))+X[ 0]+k4); a:=(a shl 15 or a shr (32-15))+e; c:=(c shl 10 or c shr (32-10));
inc(e,(a xor (b or (not c)))+X[ 5]+k4); e:=(e shl 5 or e shr (32- 5))+d; b:=(b shl 10 or b shr (32-10));
inc(d,(e xor (a or (not b)))+X[ 9]+k4); d:=(d shl 11 or d shr (32-11))+c; a:=(a shl 10 or a shr (32-10));
inc(c,(d xor (e or (not a)))+X[ 7]+k4); c:=(c shl 6 or c shr (32- 6))+b; e:=(e shl 10 or e shr (32-10));
inc(b,(c xor (d or (not e)))+X[12]+k4); b:=(b shl 8 or b shr (32- 8))+a; d:=(d shl 10 or d shr (32-10));
inc(a,(b xor (c or (not d)))+X[ 2]+k4); a:=(a shl 13 or a shr (32-13))+e; c:=(c shl 10 or c shr (32-10));
inc(e,(a xor (b or (not c)))+X[10]+k4); e:=(e shl 12 or e shr (32-12))+d; b:=(b shl 10 or b shr (32-10));
inc(d,(e xor (a or (not b)))+X[14]+k4); d:=(d shl 5 or d shr (32- 5))+c; a:=(a shl 10 or a shr (32-10));
inc(c,(d xor (e or (not a)))+X[ 1]+k4); c:=(c shl 12 or c shr (32-12))+b; e:=(e shl 10 or e shr (32-10));
inc(b,(c xor (d or (not e)))+X[ 3]+k4); b:=(b shl 13 or b shr (32-13))+a; d:=(d shl 10 or d shr (32-10));
inc(a,(b xor (c or (not d)))+X[ 8]+k4); a:=(a shl 14 or a shr (32-14))+e; c:=(c shl 10 or c shr (32-10));
inc(e,(a xor (b or (not c)))+X[11]+k4); e:=(e shl 11 or e shr (32-11))+d; b:=(b shl 10 or b shr (32-10));
inc(d,(e xor (a or (not b)))+X[ 6]+k4); d:=(d shl 8 or d shr (32- 8))+c; a:=(a shl 10 or a shr (32-10));
inc(c,(d xor (e or (not a)))+X[15]+k4); c:=(c shl 5 or c shr (32- 5))+b; e:=(e shl 10 or e shr (32-10));
inc(b,(c xor (d or (not e)))+X[13]+k4); b:=(b shl 6 or b shr (32- 6))+a; d:=(d shl 10 or d shr (32-10));
{Save result of first part}
a1 := a;
b1 := b;
c1 := c;
d1 := d;
e1 := e;
{Initialize for second part}
a := Data[0];
b := Data[1];
c := Data[2];
d := Data[3];
e := Data[4];
inc(a,(b xor (c or (not d)))+X[ 5]+k5); a:=(a shl 8 or a shr (32- 8))+e; c:=(c shl 10 or c shr (32-10));
inc(e,(a xor (b or (not c)))+X[14]+k5); e:=(e shl 9 or e shr (32- 9))+d; b:=(b shl 10 or b shr (32-10));
inc(d,(e xor (a or (not b)))+X[ 7]+k5); d:=(d shl 9 or d shr (32- 9))+c; a:=(a shl 10 or a shr (32-10));
inc(c,(d xor (e or (not a)))+X[ 0]+k5); c:=(c shl 11 or c shr (32-11))+b; e:=(e shl 10 or e shr (32-10));
inc(b,(c xor (d or (not e)))+X[ 9]+k5); b:=(b shl 13 or b shr (32-13))+a; d:=(d shl 10 or d shr (32-10));
inc(a,(b xor (c or (not d)))+X[ 2]+k5); a:=(a shl 15 or a shr (32-15))+e; c:=(c shl 10 or c shr (32-10));
inc(e,(a xor (b or (not c)))+X[11]+k5); e:=(e shl 15 or e shr (32-15))+d; b:=(b shl 10 or b shr (32-10));
inc(d,(e xor (a or (not b)))+X[ 4]+k5); d:=(d shl 5 or d shr (32- 5))+c; a:=(a shl 10 or a shr (32-10));
inc(c,(d xor (e or (not a)))+X[13]+k5); c:=(c shl 7 or c shr (32- 7))+b; e:=(e shl 10 or e shr (32-10));
inc(b,(c xor (d or (not e)))+X[ 6]+k5); b:=(b shl 7 or b shr (32- 7))+a; d:=(d shl 10 or d shr (32-10));
inc(a,(b xor (c or (not d)))+X[15]+k5); a:=(a shl 8 or a shr (32- 8))+e; c:=(c shl 10 or c shr (32-10));
inc(e,(a xor (b or (not c)))+X[ 8]+k5); e:=(e shl 11 or e shr (32-11))+d; b:=(b shl 10 or b shr (32-10));
inc(d,(e xor (a or (not b)))+X[ 1]+k5); d:=(d shl 14 or d shr (32-14))+c; a:=(a shl 10 or a shr (32-10));
inc(c,(d xor (e or (not a)))+X[10]+k5); c:=(c shl 14 or c shr (32-14))+b; e:=(e shl 10 or e shr (32-10));
inc(b,(c xor (d or (not e)))+X[ 3]+k5); b:=(b shl 12 or b shr (32-12))+a; d:=(d shl 10 or d shr (32-10));
inc(a,(b xor (c or (not d)))+X[12]+k5); a:=(a shl 6 or a shr (32- 6))+e; c:=(c shl 10 or c shr (32-10));
inc(e,(b xor (c and (a xor b)))+X[ 6]+k6); e:=(e shl 9 or e shr (32- 9))+d; b:=(b shl 10 or b shr (32-10));
inc(d,(a xor (b and (e xor a)))+X[11]+k6); d:=(d shl 13 or d shr (32-13))+c; a:=(a shl 10 or a shr (32-10));
inc(c,(e xor (a and (d xor e)))+X[ 3]+k6); c:=(c shl 15 or c shr (32-15))+b; e:=(e shl 10 or e shr (32-10));
inc(b,(d xor (e and (c xor d)))+X[ 7]+k6); b:=(b shl 7 or b shr (32- 7))+a; d:=(d shl 10 or d shr (32-10));
inc(a,(c xor (d and (b xor c)))+X[ 0]+k6); a:=(a shl 12 or a shr (32-12))+e; c:=(c shl 10 or c shr (32-10));
inc(e,(b xor (c and (a xor b)))+X[13]+k6); e:=(e shl 8 or e shr (32- 8))+d; b:=(b shl 10 or b shr (32-10));
inc(d,(a xor (b and (e xor a)))+X[ 5]+k6); d:=(d shl 9 or d shr (32- 9))+c; a:=(a shl 10 or a shr (32-10));
inc(c,(e xor (a and (d xor e)))+X[10]+k6); c:=(c shl 11 or c shr (32-11))+b; e:=(e shl 10 or e shr (32-10));
inc(b,(d xor (e and (c xor d)))+X[14]+k6); b:=(b shl 7 or b shr (32- 7))+a; d:=(d shl 10 or d shr (32-10));
inc(a,(c xor (d and (b xor c)))+X[15]+k6); a:=(a shl 7 or a shr (32- 7))+e; c:=(c shl 10 or c shr (32-10));
inc(e,(b xor (c and (a xor b)))+X[ 8]+k6); e:=(e shl 12 or e shr (32-12))+d; b:=(b shl 10 or b shr (32-10));
inc(d,(a xor (b and (e xor a)))+X[12]+k6); d:=(d shl 7 or d shr (32- 7))+c; a:=(a shl 10 or a shr (32-10));
inc(c,(e xor (a and (d xor e)))+X[ 4]+k6); c:=(c shl 6 or c shr (32- 6))+b; e:=(e shl 10 or e shr (32-10));
inc(b,(d xor (e and (c xor d)))+X[ 9]+k6); b:=(b shl 15 or b shr (32-15))+a; d:=(d shl 10 or d shr (32-10));
inc(a,(c xor (d and (b xor c)))+X[ 1]+k6); a:=(a shl 13 or a shr (32-13))+e; c:=(c shl 10 or c shr (32-10));
inc(e,(b xor (c and (a xor b)))+X[ 2]+k6); e:=(e shl 11 or e shr (32-11))+d; b:=(b shl 10 or b shr (32-10));
inc(d,(b xor (e or (not a)))+X[15]+k7); d:=(d shl 9 or d shr (32- 9))+c; a:=(a shl 10 or a shr (32-10));
inc(c,(a xor (d or (not e)))+X[ 5]+k7); c:=(c shl 7 or c shr (32- 7))+b; e:=(e shl 10 or e shr (32-10));
inc(b,(e xor (c or (not d)))+X[ 1]+k7); b:=(b shl 15 or b shr (32-15))+a; d:=(d shl 10 or d shr (32-10));
inc(a,(d xor (b or (not c)))+X[ 3]+k7); a:=(a shl 11 or a shr (32-11))+e; c:=(c shl 10 or c shr (32-10));
inc(e,(c xor (a or (not b)))+X[ 7]+k7); e:=(e shl 8 or e shr (32- 8))+d; b:=(b shl 10 or b shr (32-10));
inc(d,(b xor (e or (not a)))+X[14]+k7); d:=(d shl 6 or d shr (32- 6))+c; a:=(a shl 10 or a shr (32-10));
inc(c,(a xor (d or (not e)))+X[ 6]+k7); c:=(c shl 6 or c shr (32- 6))+b; e:=(e shl 10 or e shr (32-10));
inc(b,(e xor (c or (not d)))+X[ 9]+k7); b:=(b shl 14 or b shr (32-14))+a; d:=(d shl 10 or d shr (32-10));
inc(a,(d xor (b or (not c)))+X[11]+k7); a:=(a shl 12 or a shr (32-12))+e; c:=(c shl 10 or c shr (32-10));
inc(e,(c xor (a or (not b)))+X[ 8]+k7); e:=(e shl 13 or e shr (32-13))+d; b:=(b shl 10 or b shr (32-10));
inc(d,(b xor (e or (not a)))+X[12]+k7); d:=(d shl 5 or d shr (32- 5))+c; a:=(a shl 10 or a shr (32-10));
inc(c,(a xor (d or (not e)))+X[ 2]+k7); c:=(c shl 14 or c shr (32-14))+b; e:=(e shl 10 or e shr (32-10));
inc(b,(e xor (c or (not d)))+X[10]+k7); b:=(b shl 13 or b shr (32-13))+a; d:=(d shl 10 or d shr (32-10));
inc(a,(d xor (b or (not c)))+X[ 0]+k7); a:=(a shl 13 or a shr (32-13))+e; c:=(c shl 10 or c shr (32-10));
inc(e,(c xor (a or (not b)))+X[ 4]+k7); e:=(e shl 7 or e shr (32- 7))+d; b:=(b shl 10 or b shr (32-10));
inc(d,(b xor (e or (not a)))+X[13]+k7); d:=(d shl 5 or d shr (32- 5))+c; a:=(a shl 10 or a shr (32-10));
inc(c,(a xor (d and (e xor a)))+X[ 8]+k8); c:=(c shl 15 or c shr (32-15))+b; e:=(e shl 10 or e shr (32-10));
inc(b,(e xor (c and (d xor e)))+X[ 6]+k8); b:=(b shl 5 or b shr (32- 5))+a; d:=(d shl 10 or d shr (32-10));
inc(a,(d xor (b and (c xor d)))+X[ 4]+k8); a:=(a shl 8 or a shr (32- 8))+e; c:=(c shl 10 or c shr (32-10));
inc(e,(c xor (a and (b xor c)))+X[ 1]+k8); e:=(e shl 11 or e shr (32-11))+d; b:=(b shl 10 or b shr (32-10));
inc(d,(b xor (e and (a xor b)))+X[ 3]+k8); d:=(d shl 14 or d shr (32-14))+c; a:=(a shl 10 or a shr (32-10));
inc(c,(a xor (d and (e xor a)))+X[11]+k8); c:=(c shl 14 or c shr (32-14))+b; e:=(e shl 10 or e shr (32-10));
inc(b,(e xor (c and (d xor e)))+X[15]+k8); b:=(b shl 6 or b shr (32- 6))+a; d:=(d shl 10 or d shr (32-10));
inc(a,(d xor (b and (c xor d)))+X[ 0]+k8); a:=(a shl 14 or a shr (32-14))+e; c:=(c shl 10 or c shr (32-10));
inc(e,(c xor (a and (b xor c)))+X[ 5]+k8); e:=(e shl 6 or e shr (32- 6))+d; b:=(b shl 10 or b shr (32-10));
inc(d,(b xor (e and (a xor b)))+X[12]+k8); d:=(d shl 9 or d shr (32- 9))+c; a:=(a shl 10 or a shr (32-10));
inc(c,(a xor (d and (e xor a)))+X[ 2]+k8); c:=(c shl 12 or c shr (32-12))+b; e:=(e shl 10 or e shr (32-10));
inc(b,(e xor (c and (d xor e)))+X[13]+k8); b:=(b shl 9 or b shr (32- 9))+a; d:=(d shl 10 or d shr (32-10));
inc(a,(d xor (b and (c xor d)))+X[ 9]+k8); a:=(a shl 12 or a shr (32-12))+e; c:=(c shl 10 or c shr (32-10));
inc(e,(c xor (a and (b xor c)))+X[ 7]+k8); e:=(e shl 5 or e shr (32- 5))+d; b:=(b shl 10 or b shr (32-10));
inc(d,(b xor (e and (a xor b)))+X[10]+k8); d:=(d shl 15 or d shr (32-15))+c; a:=(a shl 10 or a shr (32-10));
inc(c,(a xor (d and (e xor a)))+X[14]+k8); c:=(c shl 8 or c shr (32- 8))+b; e:=(e shl 10 or e shr (32-10));
inc(b,(c xor d xor e)+X[12]); b:=(b shl 8 or b shr (32- 8))+a; d:=(d shl 10 or d shr (32-10));
inc(a,(b xor c xor d)+X[15]); a:=(a shl 5 or a shr (32- 5))+e; c:=(c shl 10 or c shr (32-10));
inc(e,(a xor b xor c)+X[10]); e:=(e shl 12 or e shr (32-12))+d; b:=(b shl 10 or b shr (32-10));
inc(d,(e xor a xor b)+X[ 4]); d:=(d shl 9 or d shr (32- 9))+c; a:=(a shl 10 or a shr (32-10));
inc(c,(d xor e xor a)+X[ 1]); c:=(c shl 12 or c shr (32-12))+b; e:=(e shl 10 or e shr (32-10));
inc(b,(c xor d xor e)+X[ 5]); b:=(b shl 5 or b shr (32- 5))+a; d:=(d shl 10 or d shr (32-10));
inc(a,(b xor c xor d)+X[ 8]); a:=(a shl 14 or a shr (32-14))+e; c:=(c shl 10 or c shr (32-10));
inc(e,(a xor b xor c)+X[ 7]); e:=(e shl 6 or e shr (32- 6))+d; b:=(b shl 10 or b shr (32-10));
inc(d,(e xor a xor b)+X[ 6]); d:=(d shl 8 or d shr (32- 8))+c; a:=(a shl 10 or a shr (32-10));
inc(c,(d xor e xor a)+X[ 2]); c:=(c shl 13 or c shr (32-13))+b; e:=(e shl 10 or e shr (32-10));
inc(b,(c xor d xor e)+X[13]); b:=(b shl 6 or b shr (32- 6))+a; d:=(d shl 10 or d shr (32-10));
inc(a,(b xor c xor d)+X[14]); a:=(a shl 5 or a shr (32- 5))+e; c:=(c shl 10 or c shr (32-10));
inc(e,(a xor b xor c)+X[ 0]); e:=(e shl 15 or e shr (32-15))+d; b:=(b shl 10 or b shr (32-10));
inc(d,(e xor a xor b)+X[ 3]); d:=(d shl 13 or d shr (32-13))+c; a:=(a shl 10 or a shr (32-10));
inc(c,(d xor e xor a)+X[ 9]); c:=(c shl 11 or c shr (32-11))+b; e:=(e shl 10 or e shr (32-10));
inc(b,(c xor d xor e)+X[11]); b:=(b shl 11 or b shr (32-11))+a; d:=(d shl 10 or d shr (32-10));
{Combine parts 1 and 2}
d := Data[1] + c1 + d;
Data[1] := Data[2] + d1 + e;
Data[2] := Data[3] + e1 + a;
Data[3] := Data[4] + a1 + b;
Data[4] := Data[0] + b1 + c;
Data[0] := d;
end;
{$else}
{$ifdef BASM16}
{---------------------------------------------------------------------------}
procedure RMD160Compress(var Data: THashState; var Buf: THashBuffer);
{-Actual hashing function}
var
a1, b1, c1, d1, e1, a2, b2, c2, d2, e2: longint;
X: THashBuf32;
begin
{Assign old working hash to working variables}
a1 := Data[0];
b1 := Data[1];
c1 := Data[2];
d1 := Data[3];
e1 := Data[4];
a2 := a1;
b2 := b1;
c2 := c1;
d2 := d1;
e2 := e1;
{Using local copy is faster}
asm
{dest = X}
mov dx, ds
mov ax, ss
mov es, ax
lea di, [X]
{src = Buf}
mov dx, ds
lds si, [Buf]
{move words, movsd is slower!}
mov cx, RMD160_BlockLen/2;
cld
rep movsw
{restore ds}
mov ds,dx
end;
inc(a1,(b1 xor c1 xor d1)+X[ 0]); asm db $66; rol word(a1),11; db $66;rol word(c1),10 end; inc(a1,e1);
inc(e1,(a1 xor b1 xor c1)+X[ 1]); asm db $66; rol word(e1),14; db $66;rol word(b1),10 end; inc(e1,d1);
inc(d1,(e1 xor a1 xor b1)+X[ 2]); asm db $66; rol word(d1),15; db $66;rol word(a1),10 end; inc(d1,c1);
inc(c1,(d1 xor e1 xor a1)+X[ 3]); asm db $66; rol word(c1),12; db $66;rol word(e1),10 end; inc(c1,b1);
inc(b1,(c1 xor d1 xor e1)+X[ 4]); asm db $66; rol word(b1), 5; db $66;rol word(d1),10 end; inc(b1,a1);
inc(a1,(b1 xor c1 xor d1)+X[ 5]); asm db $66; rol word(a1), 8; db $66;rol word(c1),10 end; inc(a1,e1);
inc(e1,(a1 xor b1 xor c1)+X[ 6]); asm db $66; rol word(e1), 7; db $66;rol word(b1),10 end; inc(e1,d1);
inc(d1,(e1 xor a1 xor b1)+X[ 7]); asm db $66; rol word(d1), 9; db $66;rol word(a1),10 end; inc(d1,c1);
inc(c1,(d1 xor e1 xor a1)+X[ 8]); asm db $66; rol word(c1),11; db $66;rol word(e1),10 end; inc(c1,b1);
inc(b1,(c1 xor d1 xor e1)+X[ 9]); asm db $66; rol word(b1),13; db $66;rol word(d1),10 end; inc(b1,a1);
inc(a1,(b1 xor c1 xor d1)+X[10]); asm db $66; rol word(a1),14; db $66;rol word(c1),10 end; inc(a1,e1);
inc(e1,(a1 xor b1 xor c1)+X[11]); asm db $66; rol word(e1),15; db $66;rol word(b1),10 end; inc(e1,d1);
inc(d1,(e1 xor a1 xor b1)+X[12]); asm db $66; rol word(d1), 6; db $66;rol word(a1),10 end; inc(d1,c1);
inc(c1,(d1 xor e1 xor a1)+X[13]); asm db $66; rol word(c1), 7; db $66;rol word(e1),10 end; inc(c1,b1);
inc(b1,(c1 xor d1 xor e1)+X[14]); asm db $66; rol word(b1), 9; db $66;rol word(d1),10 end; inc(b1,a1);
inc(a1,(b1 xor c1 xor d1)+X[15]); asm db $66; rol word(a1), 8; db $66;rol word(c1),10 end; inc(a1,e1);
inc(e1,(c1 xor (a1 and (b1 xor c1)))+X[ 7]+k1); asm db $66; rol word(e1), 7; db $66;rol word(b1),10 end; inc(e1,d1);
inc(d1,(b1 xor (e1 and (a1 xor b1)))+X[ 4]+k1); asm db $66; rol word(d1), 6; db $66;rol word(a1),10 end; inc(d1,c1);
inc(c1,(a1 xor (d1 and (e1 xor a1)))+X[13]+k1); asm db $66; rol word(c1), 8; db $66;rol word(e1),10 end; inc(c1,b1);
inc(b1,(e1 xor (c1 and (d1 xor e1)))+X[ 1]+k1); asm db $66; rol word(b1),13; db $66;rol word(d1),10 end; inc(b1,a1);
inc(a1,(d1 xor (b1 and (c1 xor d1)))+X[10]+k1); asm db $66; rol word(a1),11; db $66;rol word(c1),10 end; inc(a1,e1);
inc(e1,(c1 xor (a1 and (b1 xor c1)))+X[ 6]+k1); asm db $66; rol word(e1), 9; db $66;rol word(b1),10 end; inc(e1,d1);
inc(d1,(b1 xor (e1 and (a1 xor b1)))+X[15]+k1); asm db $66; rol word(d1), 7; db $66;rol word(a1),10 end; inc(d1,c1);
inc(c1,(a1 xor (d1 and (e1 xor a1)))+X[ 3]+k1); asm db $66; rol word(c1),15; db $66;rol word(e1),10 end; inc(c1,b1);
inc(b1,(e1 xor (c1 and (d1 xor e1)))+X[12]+k1); asm db $66; rol word(b1), 7; db $66;rol word(d1),10 end; inc(b1,a1);
inc(a1,(d1 xor (b1 and (c1 xor d1)))+X[ 0]+k1); asm db $66; rol word(a1),12; db $66;rol word(c1),10 end; inc(a1,e1);
inc(e1,(c1 xor (a1 and (b1 xor c1)))+X[ 9]+k1); asm db $66; rol word(e1),15; db $66;rol word(b1),10 end; inc(e1,d1);
inc(d1,(b1 xor (e1 and (a1 xor b1)))+X[ 5]+k1); asm db $66; rol word(d1), 9; db $66;rol word(a1),10 end; inc(d1,c1);
inc(c1,(a1 xor (d1 and (e1 xor a1)))+X[ 2]+k1); asm db $66; rol word(c1),11; db $66;rol word(e1),10 end; inc(c1,b1);
inc(b1,(e1 xor (c1 and (d1 xor e1)))+X[14]+k1); asm db $66; rol word(b1), 7; db $66;rol word(d1),10 end; inc(b1,a1);
inc(a1,(d1 xor (b1 and (c1 xor d1)))+X[11]+k1); asm db $66; rol word(a1),13; db $66;rol word(c1),10 end; inc(a1,e1);
inc(e1,(c1 xor (a1 and (b1 xor c1)))+X[ 8]+k1); asm db $66; rol word(e1),12; db $66;rol word(b1),10 end; inc(e1,d1);
inc(d1,(b1 xor (e1 or (not a1)))+X[ 3]+k2); asm db $66; rol word(d1),11; db $66;rol word(a1),10 end; inc(d1,c1);
inc(c1,(a1 xor (d1 or (not e1)))+X[10]+k2); asm db $66; rol word(c1),13; db $66;rol word(e1),10 end; inc(c1,b1);
inc(b1,(e1 xor (c1 or (not d1)))+X[14]+k2); asm db $66; rol word(b1), 6; db $66;rol word(d1),10 end; inc(b1,a1);
inc(a1,(d1 xor (b1 or (not c1)))+X[ 4]+k2); asm db $66; rol word(a1), 7; db $66;rol word(c1),10 end; inc(a1,e1);
inc(e1,(c1 xor (a1 or (not b1)))+X[ 9]+k2); asm db $66; rol word(e1),14; db $66;rol word(b1),10 end; inc(e1,d1);
inc(d1,(b1 xor (e1 or (not a1)))+X[15]+k2); asm db $66; rol word(d1), 9; db $66;rol word(a1),10 end; inc(d1,c1);
inc(c1,(a1 xor (d1 or (not e1)))+X[ 8]+k2); asm db $66; rol word(c1),13; db $66;rol word(e1),10 end; inc(c1,b1);
inc(b1,(e1 xor (c1 or (not d1)))+X[ 1]+k2); asm db $66; rol word(b1),15; db $66;rol word(d1),10 end; inc(b1,a1);
inc(a1,(d1 xor (b1 or (not c1)))+X[ 2]+k2); asm db $66; rol word(a1),14; db $66;rol word(c1),10 end; inc(a1,e1);
inc(e1,(c1 xor (a1 or (not b1)))+X[ 7]+k2); asm db $66; rol word(e1), 8; db $66;rol word(b1),10 end; inc(e1,d1);
inc(d1,(b1 xor (e1 or (not a1)))+X[ 0]+k2); asm db $66; rol word(d1),13; db $66;rol word(a1),10 end; inc(d1,c1);
inc(c1,(a1 xor (d1 or (not e1)))+X[ 6]+k2); asm db $66; rol word(c1), 6; db $66;rol word(e1),10 end; inc(c1,b1);
inc(b1,(e1 xor (c1 or (not d1)))+X[13]+k2); asm db $66; rol word(b1), 5; db $66;rol word(d1),10 end; inc(b1,a1);
inc(a1,(d1 xor (b1 or (not c1)))+X[11]+k2); asm db $66; rol word(a1),12; db $66;rol word(c1),10 end; inc(a1,e1);
inc(e1,(c1 xor (a1 or (not b1)))+X[ 5]+k2); asm db $66; rol word(e1), 7; db $66;rol word(b1),10 end; inc(e1,d1);
inc(d1,(b1 xor (e1 or (not a1)))+X[12]+k2); asm db $66; rol word(d1), 5; db $66;rol word(a1),10 end; inc(d1,c1);
inc(c1,(e1 xor (a1 and (d1 xor e1)))+X[ 1]+k3); asm db $66; rol word(c1),11; db $66;rol word(e1),10 end; inc(c1,b1);
inc(b1,(d1 xor (e1 and (c1 xor d1)))+X[ 9]+k3); asm db $66; rol word(b1),12; db $66;rol word(d1),10 end; inc(b1,a1);
inc(a1,(c1 xor (d1 and (b1 xor c1)))+X[11]+k3); asm db $66; rol word(a1),14; db $66;rol word(c1),10 end; inc(a1,e1);
inc(e1,(b1 xor (c1 and (a1 xor b1)))+X[10]+k3); asm db $66; rol word(e1),15; db $66;rol word(b1),10 end; inc(e1,d1);
inc(d1,(a1 xor (b1 and (e1 xor a1)))+X[ 0]+k3); asm db $66; rol word(d1),14; db $66;rol word(a1),10 end; inc(d1,c1);
inc(c1,(e1 xor (a1 and (d1 xor e1)))+X[ 8]+k3); asm db $66; rol word(c1),15; db $66;rol word(e1),10 end; inc(c1,b1);
inc(b1,(d1 xor (e1 and (c1 xor d1)))+X[12]+k3); asm db $66; rol word(b1), 9; db $66;rol word(d1),10 end; inc(b1,a1);
inc(a1,(c1 xor (d1 and (b1 xor c1)))+X[ 4]+k3); asm db $66; rol word(a1), 8; db $66;rol word(c1),10 end; inc(a1,e1);
inc(e1,(b1 xor (c1 and (a1 xor b1)))+X[13]+k3); asm db $66; rol word(e1), 9; db $66;rol word(b1),10 end; inc(e1,d1);
inc(d1,(a1 xor (b1 and (e1 xor a1)))+X[ 3]+k3); asm db $66; rol word(d1),14; db $66;rol word(a1),10 end; inc(d1,c1);
inc(c1,(e1 xor (a1 and (d1 xor e1)))+X[ 7]+k3); asm db $66; rol word(c1), 5; db $66;rol word(e1),10 end; inc(c1,b1);
inc(b1,(d1 xor (e1 and (c1 xor d1)))+X[15]+k3); asm db $66; rol word(b1), 6; db $66;rol word(d1),10 end; inc(b1,a1);
inc(a1,(c1 xor (d1 and (b1 xor c1)))+X[14]+k3); asm db $66; rol word(a1), 8; db $66;rol word(c1),10 end; inc(a1,e1);
inc(e1,(b1 xor (c1 and (a1 xor b1)))+X[ 5]+k3); asm db $66; rol word(e1), 6; db $66;rol word(b1),10 end; inc(e1,d1);
inc(d1,(a1 xor (b1 and (e1 xor a1)))+X[ 6]+k3); asm db $66; rol word(d1), 5; db $66;rol word(a1),10 end; inc(d1,c1);
inc(c1,(e1 xor (a1 and (d1 xor e1)))+X[ 2]+k3); asm db $66; rol word(c1),12; db $66;rol word(e1),10 end; inc(c1,b1);
inc(b1,(c1 xor (d1 or (not e1)))+X[ 4]+k4); asm db $66; rol word(b1), 9; db $66;rol word(d1),10 end; inc(b1,a1);
inc(a1,(b1 xor (c1 or (not d1)))+X[ 0]+k4); asm db $66; rol word(a1),15; db $66;rol word(c1),10 end; inc(a1,e1);
inc(e1,(a1 xor (b1 or (not c1)))+X[ 5]+k4); asm db $66; rol word(e1), 5; db $66;rol word(b1),10 end; inc(e1,d1);
inc(d1,(e1 xor (a1 or (not b1)))+X[ 9]+k4); asm db $66; rol word(d1),11; db $66;rol word(a1),10 end; inc(d1,c1);
inc(c1,(d1 xor (e1 or (not a1)))+X[ 7]+k4); asm db $66; rol word(c1), 6; db $66;rol word(e1),10 end; inc(c1,b1);
inc(b1,(c1 xor (d1 or (not e1)))+X[12]+k4); asm db $66; rol word(b1), 8; db $66;rol word(d1),10 end; inc(b1,a1);
inc(a1,(b1 xor (c1 or (not d1)))+X[ 2]+k4); asm db $66; rol word(a1),13; db $66;rol word(c1),10 end; inc(a1,e1);
inc(e1,(a1 xor (b1 or (not c1)))+X[10]+k4); asm db $66; rol word(e1),12; db $66;rol word(b1),10 end; inc(e1,d1);
inc(d1,(e1 xor (a1 or (not b1)))+X[14]+k4); asm db $66; rol word(d1), 5; db $66;rol word(a1),10 end; inc(d1,c1);
inc(c1,(d1 xor (e1 or (not a1)))+X[ 1]+k4); asm db $66; rol word(c1),12; db $66;rol word(e1),10 end; inc(c1,b1);
inc(b1,(c1 xor (d1 or (not e1)))+X[ 3]+k4); asm db $66; rol word(b1),13; db $66;rol word(d1),10 end; inc(b1,a1);
inc(a1,(b1 xor (c1 or (not d1)))+X[ 8]+k4); asm db $66; rol word(a1),14; db $66;rol word(c1),10 end; inc(a1,e1);
inc(e1,(a1 xor (b1 or (not c1)))+X[11]+k4); asm db $66; rol word(e1),11; db $66;rol word(b1),10 end; inc(e1,d1);
inc(d1,(e1 xor (a1 or (not b1)))+X[ 6]+k4); asm db $66; rol word(d1), 8; db $66;rol word(a1),10 end; inc(d1,c1);
inc(c1,(d1 xor (e1 or (not a1)))+X[15]+k4); asm db $66; rol word(c1), 5; db $66;rol word(e1),10 end; inc(c1,b1);
inc(b1,(c1 xor (d1 or (not e1)))+X[13]+k4); asm db $66; rol word(b1), 6; db $66;rol word(d1),10 end; inc(b1,a1);
inc(a2,(b2 xor (c2 or (not d2)))+X[ 5]+k5); asm db $66; rol word(a2), 8; db $66;rol word(c2),10 end; inc(a2,e2);
inc(e2,(a2 xor (b2 or (not c2)))+X[14]+k5); asm db $66; rol word(e2), 9; db $66;rol word(b2),10 end; inc(e2,d2);
inc(d2,(e2 xor (a2 or (not b2)))+X[ 7]+k5); asm db $66; rol word(d2), 9; db $66;rol word(a2),10 end; inc(d2,c2);
inc(c2,(d2 xor (e2 or (not a2)))+X[ 0]+k5); asm db $66; rol word(c2),11; db $66;rol word(e2),10 end; inc(c2,b2);
inc(b2,(c2 xor (d2 or (not e2)))+X[ 9]+k5); asm db $66; rol word(b2),13; db $66;rol word(d2),10 end; inc(b2,a2);
inc(a2,(b2 xor (c2 or (not d2)))+X[ 2]+k5); asm db $66; rol word(a2),15; db $66;rol word(c2),10 end; inc(a2,e2);
inc(e2,(a2 xor (b2 or (not c2)))+X[11]+k5); asm db $66; rol word(e2),15; db $66;rol word(b2),10 end; inc(e2,d2);
inc(d2,(e2 xor (a2 or (not b2)))+X[ 4]+k5); asm db $66; rol word(d2), 5; db $66;rol word(a2),10 end; inc(d2,c2);
inc(c2,(d2 xor (e2 or (not a2)))+X[13]+k5); asm db $66; rol word(c2), 7; db $66;rol word(e2),10 end; inc(c2,b2);
inc(b2,(c2 xor (d2 or (not e2)))+X[ 6]+k5); asm db $66; rol word(b2), 7; db $66;rol word(d2),10 end; inc(b2,a2);
inc(a2,(b2 xor (c2 or (not d2)))+X[15]+k5); asm db $66; rol word(a2), 8; db $66;rol word(c2),10 end; inc(a2,e2);
inc(e2,(a2 xor (b2 or (not c2)))+X[ 8]+k5); asm db $66; rol word(e2),11; db $66;rol word(b2),10 end; inc(e2,d2);
inc(d2,(e2 xor (a2 or (not b2)))+X[ 1]+k5); asm db $66; rol word(d2),14; db $66;rol word(a2),10 end; inc(d2,c2);
inc(c2,(d2 xor (e2 or (not a2)))+X[10]+k5); asm db $66; rol word(c2),14; db $66;rol word(e2),10 end; inc(c2,b2);
inc(b2,(c2 xor (d2 or (not e2)))+X[ 3]+k5); asm db $66; rol word(b2),12; db $66;rol word(d2),10 end; inc(b2,a2);
inc(a2,(b2 xor (c2 or (not d2)))+X[12]+k5); asm db $66; rol word(a2), 6; db $66;rol word(c2),10 end; inc(a2,e2);
inc(e2,(b2 xor (c2 and (a2 xor b2)))+X[ 6]+k6); asm db $66; rol word(e2), 9; db $66;rol word(b2),10 end; inc(e2,d2);
inc(d2,(a2 xor (b2 and (e2 xor a2)))+X[11]+k6); asm db $66; rol word(d2),13; db $66;rol word(a2),10 end; inc(d2,c2);
inc(c2,(e2 xor (a2 and (d2 xor e2)))+X[ 3]+k6); asm db $66; rol word(c2),15; db $66;rol word(e2),10 end; inc(c2,b2);
inc(b2,(d2 xor (e2 and (c2 xor d2)))+X[ 7]+k6); asm db $66; rol word(b2), 7; db $66;rol word(d2),10 end; inc(b2,a2);
inc(a2,(c2 xor (d2 and (b2 xor c2)))+X[ 0]+k6); asm db $66; rol word(a2),12; db $66;rol word(c2),10 end; inc(a2,e2);
inc(e2,(b2 xor (c2 and (a2 xor b2)))+X[13]+k6); asm db $66; rol word(e2), 8; db $66;rol word(b2),10 end; inc(e2,d2);
inc(d2,(a2 xor (b2 and (e2 xor a2)))+X[ 5]+k6); asm db $66; rol word(d2), 9; db $66;rol word(a2),10 end; inc(d2,c2);
inc(c2,(e2 xor (a2 and (d2 xor e2)))+X[10]+k6); asm db $66; rol word(c2),11; db $66;rol word(e2),10 end; inc(c2,b2);
inc(b2,(d2 xor (e2 and (c2 xor d2)))+X[14]+k6); asm db $66; rol word(b2), 7; db $66;rol word(d2),10 end; inc(b2,a2);
inc(a2,(c2 xor (d2 and (b2 xor c2)))+X[15]+k6); asm db $66; rol word(a2), 7; db $66;rol word(c2),10 end; inc(a2,e2);
inc(e2,(b2 xor (c2 and (a2 xor b2)))+X[ 8]+k6); asm db $66; rol word(e2),12; db $66;rol word(b2),10 end; inc(e2,d2);
inc(d2,(a2 xor (b2 and (e2 xor a2)))+X[12]+k6); asm db $66; rol word(d2), 7; db $66;rol word(a2),10 end; inc(d2,c2);
inc(c2,(e2 xor (a2 and (d2 xor e2)))+X[ 4]+k6); asm db $66; rol word(c2), 6; db $66;rol word(e2),10 end; inc(c2,b2);
inc(b2,(d2 xor (e2 and (c2 xor d2)))+X[ 9]+k6); asm db $66; rol word(b2),15; db $66;rol word(d2),10 end; inc(b2,a2);
inc(a2,(c2 xor (d2 and (b2 xor c2)))+X[ 1]+k6); asm db $66; rol word(a2),13; db $66;rol word(c2),10 end; inc(a2,e2);
inc(e2,(b2 xor (c2 and (a2 xor b2)))+X[ 2]+k6); asm db $66; rol word(e2),11; db $66;rol word(b2),10 end; inc(e2,d2);
inc(d2,(b2 xor (e2 or (not a2)))+X[15]+k7); asm db $66; rol word(d2), 9; db $66;rol word(a2),10 end; inc(d2,c2);
inc(c2,(a2 xor (d2 or (not e2)))+X[ 5]+k7); asm db $66; rol word(c2), 7; db $66;rol word(e2),10 end; inc(c2,b2);
inc(b2,(e2 xor (c2 or (not d2)))+X[ 1]+k7); asm db $66; rol word(b2),15; db $66;rol word(d2),10 end; inc(b2,a2);
inc(a2,(d2 xor (b2 or (not c2)))+X[ 3]+k7); asm db $66; rol word(a2),11; db $66;rol word(c2),10 end; inc(a2,e2);
inc(e2,(c2 xor (a2 or (not b2)))+X[ 7]+k7); asm db $66; rol word(e2), 8; db $66;rol word(b2),10 end; inc(e2,d2);
inc(d2,(b2 xor (e2 or (not a2)))+X[14]+k7); asm db $66; rol word(d2), 6; db $66;rol word(a2),10 end; inc(d2,c2);
inc(c2,(a2 xor (d2 or (not e2)))+X[ 6]+k7); asm db $66; rol word(c2), 6; db $66;rol word(e2),10 end; inc(c2,b2);
inc(b2,(e2 xor (c2 or (not d2)))+X[ 9]+k7); asm db $66; rol word(b2),14; db $66;rol word(d2),10 end; inc(b2,a2);
inc(a2,(d2 xor (b2 or (not c2)))+X[11]+k7); asm db $66; rol word(a2),12; db $66;rol word(c2),10 end; inc(a2,e2);
inc(e2,(c2 xor (a2 or (not b2)))+X[ 8]+k7); asm db $66; rol word(e2),13; db $66;rol word(b2),10 end; inc(e2,d2);
inc(d2,(b2 xor (e2 or (not a2)))+X[12]+k7); asm db $66; rol word(d2), 5; db $66;rol word(a2),10 end; inc(d2,c2);
inc(c2,(a2 xor (d2 or (not e2)))+X[ 2]+k7); asm db $66; rol word(c2),14; db $66;rol word(e2),10 end; inc(c2,b2);
inc(b2,(e2 xor (c2 or (not d2)))+X[10]+k7); asm db $66; rol word(b2),13; db $66;rol word(d2),10 end; inc(b2,a2);
inc(a2,(d2 xor (b2 or (not c2)))+X[ 0]+k7); asm db $66; rol word(a2),13; db $66;rol word(c2),10 end; inc(a2,e2);
inc(e2,(c2 xor (a2 or (not b2)))+X[ 4]+k7); asm db $66; rol word(e2), 7; db $66;rol word(b2),10 end; inc(e2,d2);
inc(d2,(b2 xor (e2 or (not a2)))+X[13]+k7); asm db $66; rol word(d2), 5; db $66;rol word(a2),10 end; inc(d2,c2);
inc(c2,(a2 xor (d2 and (e2 xor a2)))+X[ 8]+k8); asm db $66; rol word(c2),15; db $66;rol word(e2),10 end; inc(c2,b2);
inc(b2,(e2 xor (c2 and (d2 xor e2)))+X[ 6]+k8); asm db $66; rol word(b2), 5; db $66;rol word(d2),10 end; inc(b2,a2);
inc(a2,(d2 xor (b2 and (c2 xor d2)))+X[ 4]+k8); asm db $66; rol word(a2), 8; db $66;rol word(c2),10 end; inc(a2,e2);
inc(e2,(c2 xor (a2 and (b2 xor c2)))+X[ 1]+k8); asm db $66; rol word(e2),11; db $66;rol word(b2),10 end; inc(e2,d2);
inc(d2,(b2 xor (e2 and (a2 xor b2)))+X[ 3]+k8); asm db $66; rol word(d2),14; db $66;rol word(a2),10 end; inc(d2,c2);
inc(c2,(a2 xor (d2 and (e2 xor a2)))+X[11]+k8); asm db $66; rol word(c2),14; db $66;rol word(e2),10 end; inc(c2,b2);
inc(b2,(e2 xor (c2 and (d2 xor e2)))+X[15]+k8); asm db $66; rol word(b2), 6; db $66;rol word(d2),10 end; inc(b2,a2);
inc(a2,(d2 xor (b2 and (c2 xor d2)))+X[ 0]+k8); asm db $66; rol word(a2),14; db $66;rol word(c2),10 end; inc(a2,e2);
inc(e2,(c2 xor (a2 and (b2 xor c2)))+X[ 5]+k8); asm db $66; rol word(e2), 6; db $66;rol word(b2),10 end; inc(e2,d2);
inc(d2,(b2 xor (e2 and (a2 xor b2)))+X[12]+k8); asm db $66; rol word(d2), 9; db $66;rol word(a2),10 end; inc(d2,c2);
inc(c2,(a2 xor (d2 and (e2 xor a2)))+X[ 2]+k8); asm db $66; rol word(c2),12; db $66;rol word(e2),10 end; inc(c2,b2);
inc(b2,(e2 xor (c2 and (d2 xor e2)))+X[13]+k8); asm db $66; rol word(b2), 9; db $66;rol word(d2),10 end; inc(b2,a2);
inc(a2,(d2 xor (b2 and (c2 xor d2)))+X[ 9]+k8); asm db $66; rol word(a2),12; db $66;rol word(c2),10 end; inc(a2,e2);
inc(e2,(c2 xor (a2 and (b2 xor c2)))+X[ 7]+k8); asm db $66; rol word(e2), 5; db $66;rol word(b2),10 end; inc(e2,d2);
inc(d2,(b2 xor (e2 and (a2 xor b2)))+X[10]+k8); asm db $66; rol word(d2),15; db $66;rol word(a2),10 end; inc(d2,c2);
inc(c2,(a2 xor (d2 and (e2 xor a2)))+X[14]+k8); asm db $66; rol word(c2), 8; db $66;rol word(e2),10 end; inc(c2,b2);
inc(b2,(c2 xor d2 xor e2)+X[12]); asm db $66; rol word(b2), 8; db $66;rol word(d2),10 end; inc(b2,a2);
inc(a2,(b2 xor c2 xor d2)+X[15]); asm db $66; rol word(a2), 5; db $66;rol word(c2),10 end; inc(a2,e2);
inc(e2,(a2 xor b2 xor c2)+X[10]); asm db $66; rol word(e2),12; db $66;rol word(b2),10 end; inc(e2,d2);
inc(d2,(e2 xor a2 xor b2)+X[ 4]); asm db $66; rol word(d2), 9; db $66;rol word(a2),10 end; inc(d2,c2);
inc(c2,(d2 xor e2 xor a2)+X[ 1]); asm db $66; rol word(c2),12; db $66;rol word(e2),10 end; inc(c2,b2);
inc(b2,(c2 xor d2 xor e2)+X[ 5]); asm db $66; rol word(b2), 5; db $66;rol word(d2),10 end; inc(b2,a2);
inc(a2,(b2 xor c2 xor d2)+X[ 8]); asm db $66; rol word(a2),14; db $66;rol word(c2),10 end; inc(a2,e2);
inc(e2,(a2 xor b2 xor c2)+X[ 7]); asm db $66; rol word(e2), 6; db $66;rol word(b2),10 end; inc(e2,d2);
inc(d2,(e2 xor a2 xor b2)+X[ 6]); asm db $66; rol word(d2), 8; db $66;rol word(a2),10 end; inc(d2,c2);
inc(c2,(d2 xor e2 xor a2)+X[ 2]); asm db $66; rol word(c2),13; db $66;rol word(e2),10 end; inc(c2,b2);
inc(b2,(c2 xor d2 xor e2)+X[13]); asm db $66; rol word(b2), 6; db $66;rol word(d2),10 end; inc(b2,a2);
inc(a2,(b2 xor c2 xor d2)+X[14]); asm db $66; rol word(a2), 5; db $66;rol word(c2),10 end; inc(a2,e2);
inc(e2,(a2 xor b2 xor c2)+X[ 0]); asm db $66; rol word(e2),15; db $66;rol word(b2),10 end; inc(e2,d2);
inc(d2,(e2 xor a2 xor b2)+X[ 3]); asm db $66; rol word(d2),13; db $66;rol word(a2),10 end; inc(d2,c2);
inc(c2,(d2 xor e2 xor a2)+X[ 9]); asm db $66; rol word(c2),11; db $66;rol word(e2),10 end; inc(c2,b2);
inc(b2,(c2 xor d2 xor e2)+X[11]); asm db $66; rol word(b2),11; db $66;rol word(d2),10 end; inc(b2,a2);
c1 := Data[1] + c1 + d2;
Data[1] := Data[2] + d1 + e2;
Data[2] := Data[3] + e1 + a2;
Data[3] := Data[4] + a1 + b2;
Data[4] := Data[0] + b1 + c2;
Data[0] := c1;
end;
{$else}
{TP5/5.5}
{---------------------------------------------------------------------------}
function RL(x: longint; c: integer): longint;
{-Rotate x left, c<=16!!}
inline(
$59/ { pop cx }
$58/ { pop ax }
$5A/ { pop dx }
$8B/$DA/ { mov bx,dx}
$D1/$E3/ {L:shl bx,1 }
$D1/$D0/ { rcl ax,1 }
$D1/$D2/ { rcl dx,1 }
$49/ { dec cx }
$75/$F7); { jne L }
{---------------------------------------------------------------------------}
function RL10(x: longint): longint;
{-Rotate x left 10, optimized}
inline(
$58/ { pop ax }
$59/ { pop cx }
$8A/$F1/ { mov dh,cl} {Rotate left 1 byte = 8 bits}
$8A/$D4/ { mov dl,ah}
$8A/$E0/ { mov ah,al}
$8A/$C5/ { mov al,ch}
$D0/$E1/ { shl cl,1 } {Rotate left 2 bits}
$D1/$D0/ { rcl ax,1 }
$D1/$D2/ { rcl dx,1 }
$D0/$E1/ { shl cl,1 }
$D1/$D0/ { rcl ax,1 }
$D1/$D2); { rcl dx,1 }
{---------------------------------------------------------------------------}
procedure RMD160Compress(var Data: THashState; var Buf: THashBuffer);
{-Actual hashing function}
var
a1, b1, c1, d1, e1, a2, b2, c2, d2, e2: longint;
X: THashBuf32;
begin
{Assign old working hash to working variables}
a1 := Data[0];
b1 := Data[1];
c1 := Data[2];
d1 := Data[3];
e1 := Data[4];
a2 := a1;
b2 := b1;
c2 := c1;
d2 := d1;
e2 := e1;
{Using local copy is faster}
move(Buf, X, RMD160_BlockLen);
inc(a1,(b1 xor c1 xor d1)+X[ 0]); a1:=RL(a1,11)+e1; c1:=RL10(c1);
inc(e1,(a1 xor b1 xor c1)+X[ 1]); e1:=RL(e1,14)+d1; b1:=RL10(b1);
inc(d1,(e1 xor a1 xor b1)+X[ 2]); d1:=RL(d1,15)+c1; a1:=RL10(a1);
inc(c1,(d1 xor e1 xor a1)+X[ 3]); c1:=RL(c1,12)+b1; e1:=RL10(e1);
inc(b1,(c1 xor d1 xor e1)+X[ 4]); b1:=RL(b1, 5)+a1; d1:=RL10(d1);
inc(a1,(b1 xor c1 xor d1)+X[ 5]); a1:=RL(a1, 8)+e1; c1:=RL10(c1);
inc(e1,(a1 xor b1 xor c1)+X[ 6]); e1:=RL(e1, 7)+d1; b1:=RL10(b1);
inc(d1,(e1 xor a1 xor b1)+X[ 7]); d1:=RL(d1, 9)+c1; a1:=RL10(a1);
inc(c1,(d1 xor e1 xor a1)+X[ 8]); c1:=RL(c1,11)+b1; e1:=RL10(e1);
inc(b1,(c1 xor d1 xor e1)+X[ 9]); b1:=RL(b1,13)+a1; d1:=RL10(d1);
inc(a1,(b1 xor c1 xor d1)+X[10]); a1:=RL(a1,14)+e1; c1:=RL10(c1);
inc(e1,(a1 xor b1 xor c1)+X[11]); e1:=RL(e1,15)+d1; b1:=RL10(b1);
inc(d1,(e1 xor a1 xor b1)+X[12]); d1:=RL(d1, 6)+c1; a1:=RL10(a1);
inc(c1,(d1 xor e1 xor a1)+X[13]); c1:=RL(c1, 7)+b1; e1:=RL10(e1);
inc(b1,(c1 xor d1 xor e1)+X[14]); b1:=RL(b1, 9)+a1; d1:=RL10(d1);
inc(a1,(b1 xor c1 xor d1)+X[15]); a1:=RL(a1, 8)+e1; c1:=RL10(c1);
inc(e1,(c1 xor (a1 and (b1 xor c1)))+X[ 7]+k1); e1:=RL(e1, 7)+d1; b1:=RL10(b1);
inc(d1,(b1 xor (e1 and (a1 xor b1)))+X[ 4]+k1); d1:=RL(d1, 6)+c1; a1:=RL10(a1);
inc(c1,(a1 xor (d1 and (e1 xor a1)))+X[13]+k1); c1:=RL(c1, 8)+b1; e1:=RL10(e1);
inc(b1,(e1 xor (c1 and (d1 xor e1)))+X[ 1]+k1); b1:=RL(b1,13)+a1; d1:=RL10(d1);
inc(a1,(d1 xor (b1 and (c1 xor d1)))+X[10]+k1); a1:=RL(a1,11)+e1; c1:=RL10(c1);
inc(e1,(c1 xor (a1 and (b1 xor c1)))+X[ 6]+k1); e1:=RL(e1, 9)+d1; b1:=RL10(b1);
inc(d1,(b1 xor (e1 and (a1 xor b1)))+X[15]+k1); d1:=RL(d1, 7)+c1; a1:=RL10(a1);
inc(c1,(a1 xor (d1 and (e1 xor a1)))+X[ 3]+k1); c1:=RL(c1,15)+b1; e1:=RL10(e1);
inc(b1,(e1 xor (c1 and (d1 xor e1)))+X[12]+k1); b1:=RL(b1, 7)+a1; d1:=RL10(d1);
inc(a1,(d1 xor (b1 and (c1 xor d1)))+X[ 0]+k1); a1:=RL(a1,12)+e1; c1:=RL10(c1);
inc(e1,(c1 xor (a1 and (b1 xor c1)))+X[ 9]+k1); e1:=RL(e1,15)+d1; b1:=RL10(b1);
inc(d1,(b1 xor (e1 and (a1 xor b1)))+X[ 5]+k1); d1:=RL(d1, 9)+c1; a1:=RL10(a1);
inc(c1,(a1 xor (d1 and (e1 xor a1)))+X[ 2]+k1); c1:=RL(c1,11)+b1; e1:=RL10(e1);
inc(b1,(e1 xor (c1 and (d1 xor e1)))+X[14]+k1); b1:=RL(b1, 7)+a1; d1:=RL10(d1);
inc(a1,(d1 xor (b1 and (c1 xor d1)))+X[11]+k1); a1:=RL(a1,13)+e1; c1:=RL10(c1);
inc(e1,(c1 xor (a1 and (b1 xor c1)))+X[ 8]+k1); e1:=RL(e1,12)+d1; b1:=RL10(b1);
inc(d1,(b1 xor (e1 or (not a1)))+X[ 3]+k2); d1:=RL(d1,11)+c1; a1:=RL10(a1);
inc(c1,(a1 xor (d1 or (not e1)))+X[10]+k2); c1:=RL(c1,13)+b1; e1:=RL10(e1);
inc(b1,(e1 xor (c1 or (not d1)))+X[14]+k2); b1:=RL(b1, 6)+a1; d1:=RL10(d1);
inc(a1,(d1 xor (b1 or (not c1)))+X[ 4]+k2); a1:=RL(a1, 7)+e1; c1:=RL10(c1);
inc(e1,(c1 xor (a1 or (not b1)))+X[ 9]+k2); e1:=RL(e1,14)+d1; b1:=RL10(b1);
inc(d1,(b1 xor (e1 or (not a1)))+X[15]+k2); d1:=RL(d1, 9)+c1; a1:=RL10(a1);
inc(c1,(a1 xor (d1 or (not e1)))+X[ 8]+k2); c1:=RL(c1,13)+b1; e1:=RL10(e1);
inc(b1,(e1 xor (c1 or (not d1)))+X[ 1]+k2); b1:=RL(b1,15)+a1; d1:=RL10(d1);
inc(a1,(d1 xor (b1 or (not c1)))+X[ 2]+k2); a1:=RL(a1,14)+e1; c1:=RL10(c1);
inc(e1,(c1 xor (a1 or (not b1)))+X[ 7]+k2); e1:=RL(e1, 8)+d1; b1:=RL10(b1);
inc(d1,(b1 xor (e1 or (not a1)))+X[ 0]+k2); d1:=RL(d1,13)+c1; a1:=RL10(a1);
inc(c1,(a1 xor (d1 or (not e1)))+X[ 6]+k2); c1:=RL(c1, 6)+b1; e1:=RL10(e1);
inc(b1,(e1 xor (c1 or (not d1)))+X[13]+k2); b1:=RL(b1, 5)+a1; d1:=RL10(d1);
inc(a1,(d1 xor (b1 or (not c1)))+X[11]+k2); a1:=RL(a1,12)+e1; c1:=RL10(c1);
inc(e1,(c1 xor (a1 or (not b1)))+X[ 5]+k2); e1:=RL(e1, 7)+d1; b1:=RL10(b1);
inc(d1,(b1 xor (e1 or (not a1)))+X[12]+k2); d1:=RL(d1, 5)+c1; a1:=RL10(a1);
inc(c1,(e1 xor (a1 and (d1 xor e1)))+X[ 1]+k3); c1:=RL(c1,11)+b1; e1:=RL10(e1);
inc(b1,(d1 xor (e1 and (c1 xor d1)))+X[ 9]+k3); b1:=RL(b1,12)+a1; d1:=RL10(d1);
inc(a1,(c1 xor (d1 and (b1 xor c1)))+X[11]+k3); a1:=RL(a1,14)+e1; c1:=RL10(c1);
inc(e1,(b1 xor (c1 and (a1 xor b1)))+X[10]+k3); e1:=RL(e1,15)+d1; b1:=RL10(b1);
inc(d1,(a1 xor (b1 and (e1 xor a1)))+X[ 0]+k3); d1:=RL(d1,14)+c1; a1:=RL10(a1);
inc(c1,(e1 xor (a1 and (d1 xor e1)))+X[ 8]+k3); c1:=RL(c1,15)+b1; e1:=RL10(e1);
inc(b1,(d1 xor (e1 and (c1 xor d1)))+X[12]+k3); b1:=RL(b1, 9)+a1; d1:=RL10(d1);
inc(a1,(c1 xor (d1 and (b1 xor c1)))+X[ 4]+k3); a1:=RL(a1, 8)+e1; c1:=RL10(c1);
inc(e1,(b1 xor (c1 and (a1 xor b1)))+X[13]+k3); e1:=RL(e1, 9)+d1; b1:=RL10(b1);
inc(d1,(a1 xor (b1 and (e1 xor a1)))+X[ 3]+k3); d1:=RL(d1,14)+c1; a1:=RL10(a1);
inc(c1,(e1 xor (a1 and (d1 xor e1)))+X[ 7]+k3); c1:=RL(c1, 5)+b1; e1:=RL10(e1);
inc(b1,(d1 xor (e1 and (c1 xor d1)))+X[15]+k3); b1:=RL(b1, 6)+a1; d1:=RL10(d1);
inc(a1,(c1 xor (d1 and (b1 xor c1)))+X[14]+k3); a1:=RL(a1, 8)+e1; c1:=RL10(c1);
inc(e1,(b1 xor (c1 and (a1 xor b1)))+X[ 5]+k3); e1:=RL(e1, 6)+d1; b1:=RL10(b1);
inc(d1,(a1 xor (b1 and (e1 xor a1)))+X[ 6]+k3); d1:=RL(d1, 5)+c1; a1:=RL10(a1);
inc(c1,(e1 xor (a1 and (d1 xor e1)))+X[ 2]+k3); c1:=RL(c1,12)+b1; e1:=RL10(e1);
inc(b1,(c1 xor (d1 or (not e1)))+X[ 4]+k4); b1:=RL(b1, 9)+a1; d1:=RL10(d1);
inc(a1,(b1 xor (c1 or (not d1)))+X[ 0]+k4); a1:=RL(a1,15)+e1; c1:=RL10(c1);
inc(e1,(a1 xor (b1 or (not c1)))+X[ 5]+k4); e1:=RL(e1, 5)+d1; b1:=RL10(b1);
inc(d1,(e1 xor (a1 or (not b1)))+X[ 9]+k4); d1:=RL(d1,11)+c1; a1:=RL10(a1);
inc(c1,(d1 xor (e1 or (not a1)))+X[ 7]+k4); c1:=RL(c1, 6)+b1; e1:=RL10(e1);
inc(b1,(c1 xor (d1 or (not e1)))+X[12]+k4); b1:=RL(b1, 8)+a1; d1:=RL10(d1);
inc(a1,(b1 xor (c1 or (not d1)))+X[ 2]+k4); a1:=RL(a1,13)+e1; c1:=RL10(c1);
inc(e1,(a1 xor (b1 or (not c1)))+X[10]+k4); e1:=RL(e1,12)+d1; b1:=RL10(b1);
inc(d1,(e1 xor (a1 or (not b1)))+X[14]+k4); d1:=RL(d1, 5)+c1; a1:=RL10(a1);
inc(c1,(d1 xor (e1 or (not a1)))+X[ 1]+k4); c1:=RL(c1,12)+b1; e1:=RL10(e1);
inc(b1,(c1 xor (d1 or (not e1)))+X[ 3]+k4); b1:=RL(b1,13)+a1; d1:=RL10(d1);
inc(a1,(b1 xor (c1 or (not d1)))+X[ 8]+k4); a1:=RL(a1,14)+e1; c1:=RL10(c1);
inc(e1,(a1 xor (b1 or (not c1)))+X[11]+k4); e1:=RL(e1,11)+d1; b1:=RL10(b1);
inc(d1,(e1 xor (a1 or (not b1)))+X[ 6]+k4); d1:=RL(d1, 8)+c1; a1:=RL10(a1);
inc(c1,(d1 xor (e1 or (not a1)))+X[15]+k4); c1:=RL(c1, 5)+b1; e1:=RL10(e1);
inc(b1,(c1 xor (d1 or (not e1)))+X[13]+k4); b1:=RL(b1, 6)+a1; d1:=RL10(d1);
inc(a2,(b2 xor (c2 or (not d2)))+X[ 5]+k5); a2:=RL(a2, 8)+e2; c2:=RL10(c2);
inc(e2,(a2 xor (b2 or (not c2)))+X[14]+k5); e2:=RL(e2, 9)+d2; b2:=RL10(b2);
inc(d2,(e2 xor (a2 or (not b2)))+X[ 7]+k5); d2:=RL(d2, 9)+c2; a2:=RL10(a2);
inc(c2,(d2 xor (e2 or (not a2)))+X[ 0]+k5); c2:=RL(c2,11)+b2; e2:=RL10(e2);
inc(b2,(c2 xor (d2 or (not e2)))+X[ 9]+k5); b2:=RL(b2,13)+a2; d2:=RL10(d2);
inc(a2,(b2 xor (c2 or (not d2)))+X[ 2]+k5); a2:=RL(a2,15)+e2; c2:=RL10(c2);
inc(e2,(a2 xor (b2 or (not c2)))+X[11]+k5); e2:=RL(e2,15)+d2; b2:=RL10(b2);
inc(d2,(e2 xor (a2 or (not b2)))+X[ 4]+k5); d2:=RL(d2, 5)+c2; a2:=RL10(a2);
inc(c2,(d2 xor (e2 or (not a2)))+X[13]+k5); c2:=RL(c2, 7)+b2; e2:=RL10(e2);
inc(b2,(c2 xor (d2 or (not e2)))+X[ 6]+k5); b2:=RL(b2, 7)+a2; d2:=RL10(d2);
inc(a2,(b2 xor (c2 or (not d2)))+X[15]+k5); a2:=RL(a2, 8)+e2; c2:=RL10(c2);
inc(e2,(a2 xor (b2 or (not c2)))+X[ 8]+k5); e2:=RL(e2,11)+d2; b2:=RL10(b2);
inc(d2,(e2 xor (a2 or (not b2)))+X[ 1]+k5); d2:=RL(d2,14)+c2; a2:=RL10(a2);
inc(c2,(d2 xor (e2 or (not a2)))+X[10]+k5); c2:=RL(c2,14)+b2; e2:=RL10(e2);
inc(b2,(c2 xor (d2 or (not e2)))+X[ 3]+k5); b2:=RL(b2,12)+a2; d2:=RL10(d2);
inc(a2,(b2 xor (c2 or (not d2)))+X[12]+k5); a2:=RL(a2, 6)+e2; c2:=RL10(c2);
inc(e2,(b2 xor (c2 and (a2 xor b2)))+X[ 6]+k6); e2:=RL(e2, 9)+d2; b2:=RL10(b2);
inc(d2,(a2 xor (b2 and (e2 xor a2)))+X[11]+k6); d2:=RL(d2,13)+c2; a2:=RL10(a2);
inc(c2,(e2 xor (a2 and (d2 xor e2)))+X[ 3]+k6); c2:=RL(c2,15)+b2; e2:=RL10(e2);
inc(b2,(d2 xor (e2 and (c2 xor d2)))+X[ 7]+k6); b2:=RL(b2, 7)+a2; d2:=RL10(d2);
inc(a2,(c2 xor (d2 and (b2 xor c2)))+X[ 0]+k6); a2:=RL(a2,12)+e2; c2:=RL10(c2);
inc(e2,(b2 xor (c2 and (a2 xor b2)))+X[13]+k6); e2:=RL(e2, 8)+d2; b2:=RL10(b2);
inc(d2,(a2 xor (b2 and (e2 xor a2)))+X[ 5]+k6); d2:=RL(d2, 9)+c2; a2:=RL10(a2);
inc(c2,(e2 xor (a2 and (d2 xor e2)))+X[10]+k6); c2:=RL(c2,11)+b2; e2:=RL10(e2);
inc(b2,(d2 xor (e2 and (c2 xor d2)))+X[14]+k6); b2:=RL(b2, 7)+a2; d2:=RL10(d2);
inc(a2,(c2 xor (d2 and (b2 xor c2)))+X[15]+k6); a2:=RL(a2, 7)+e2; c2:=RL10(c2);
inc(e2,(b2 xor (c2 and (a2 xor b2)))+X[ 8]+k6); e2:=RL(e2,12)+d2; b2:=RL10(b2);
inc(d2,(a2 xor (b2 and (e2 xor a2)))+X[12]+k6); d2:=RL(d2, 7)+c2; a2:=RL10(a2);
inc(c2,(e2 xor (a2 and (d2 xor e2)))+X[ 4]+k6); c2:=RL(c2, 6)+b2; e2:=RL10(e2);
inc(b2,(d2 xor (e2 and (c2 xor d2)))+X[ 9]+k6); b2:=RL(b2,15)+a2; d2:=RL10(d2);
inc(a2,(c2 xor (d2 and (b2 xor c2)))+X[ 1]+k6); a2:=RL(a2,13)+e2; c2:=RL10(c2);
inc(e2,(b2 xor (c2 and (a2 xor b2)))+X[ 2]+k6); e2:=RL(e2,11)+d2; b2:=RL10(b2);
inc(d2,(b2 xor (e2 or (not a2)))+X[15]+k7); d2:=RL(d2, 9)+c2; a2:=RL10(a2);
inc(c2,(a2 xor (d2 or (not e2)))+X[ 5]+k7); c2:=RL(c2, 7)+b2; e2:=RL10(e2);
inc(b2,(e2 xor (c2 or (not d2)))+X[ 1]+k7); b2:=RL(b2,15)+a2; d2:=RL10(d2);
inc(a2,(d2 xor (b2 or (not c2)))+X[ 3]+k7); a2:=RL(a2,11)+e2; c2:=RL10(c2);
inc(e2,(c2 xor (a2 or (not b2)))+X[ 7]+k7); e2:=RL(e2, 8)+d2; b2:=RL10(b2);
inc(d2,(b2 xor (e2 or (not a2)))+X[14]+k7); d2:=RL(d2, 6)+c2; a2:=RL10(a2);
inc(c2,(a2 xor (d2 or (not e2)))+X[ 6]+k7); c2:=RL(c2, 6)+b2; e2:=RL10(e2);
inc(b2,(e2 xor (c2 or (not d2)))+X[ 9]+k7); b2:=RL(b2,14)+a2; d2:=RL10(d2);
inc(a2,(d2 xor (b2 or (not c2)))+X[11]+k7); a2:=RL(a2,12)+e2; c2:=RL10(c2);
inc(e2,(c2 xor (a2 or (not b2)))+X[ 8]+k7); e2:=RL(e2,13)+d2; b2:=RL10(b2);
inc(d2,(b2 xor (e2 or (not a2)))+X[12]+k7); d2:=RL(d2, 5)+c2; a2:=RL10(a2);
inc(c2,(a2 xor (d2 or (not e2)))+X[ 2]+k7); c2:=RL(c2,14)+b2; e2:=RL10(e2);
inc(b2,(e2 xor (c2 or (not d2)))+X[10]+k7); b2:=RL(b2,13)+a2; d2:=RL10(d2);
inc(a2,(d2 xor (b2 or (not c2)))+X[ 0]+k7); a2:=RL(a2,13)+e2; c2:=RL10(c2);
inc(e2,(c2 xor (a2 or (not b2)))+X[ 4]+k7); e2:=RL(e2, 7)+d2; b2:=RL10(b2);
inc(d2,(b2 xor (e2 or (not a2)))+X[13]+k7); d2:=RL(d2, 5)+c2; a2:=RL10(a2);
inc(c2,(a2 xor (d2 and (e2 xor a2)))+X[ 8]+k8); c2:=RL(c2,15)+b2; e2:=RL10(e2);
inc(b2,(e2 xor (c2 and (d2 xor e2)))+X[ 6]+k8); b2:=RL(b2, 5)+a2; d2:=RL10(d2);
inc(a2,(d2 xor (b2 and (c2 xor d2)))+X[ 4]+k8); a2:=RL(a2, 8)+e2; c2:=RL10(c2);
inc(e2,(c2 xor (a2 and (b2 xor c2)))+X[ 1]+k8); e2:=RL(e2,11)+d2; b2:=RL10(b2);
inc(d2,(b2 xor (e2 and (a2 xor b2)))+X[ 3]+k8); d2:=RL(d2,14)+c2; a2:=RL10(a2);
inc(c2,(a2 xor (d2 and (e2 xor a2)))+X[11]+k8); c2:=RL(c2,14)+b2; e2:=RL10(e2);
inc(b2,(e2 xor (c2 and (d2 xor e2)))+X[15]+k8); b2:=RL(b2, 6)+a2; d2:=RL10(d2);
inc(a2,(d2 xor (b2 and (c2 xor d2)))+X[ 0]+k8); a2:=RL(a2,14)+e2; c2:=RL10(c2);
inc(e2,(c2 xor (a2 and (b2 xor c2)))+X[ 5]+k8); e2:=RL(e2, 6)+d2; b2:=RL10(b2);
inc(d2,(b2 xor (e2 and (a2 xor b2)))+X[12]+k8); d2:=RL(d2, 9)+c2; a2:=RL10(a2);
inc(c2,(a2 xor (d2 and (e2 xor a2)))+X[ 2]+k8); c2:=RL(c2,12)+b2; e2:=RL10(e2);
inc(b2,(e2 xor (c2 and (d2 xor e2)))+X[13]+k8); b2:=RL(b2, 9)+a2; d2:=RL10(d2);
inc(a2,(d2 xor (b2 and (c2 xor d2)))+X[ 9]+k8); a2:=RL(a2,12)+e2; c2:=RL10(c2);
inc(e2,(c2 xor (a2 and (b2 xor c2)))+X[ 7]+k8); e2:=RL(e2, 5)+d2; b2:=RL10(b2);
inc(d2,(b2 xor (e2 and (a2 xor b2)))+X[10]+k8); d2:=RL(d2,15)+c2; a2:=RL10(a2);
inc(c2,(a2 xor (d2 and (e2 xor a2)))+X[14]+k8); c2:=RL(c2, 8)+b2; e2:=RL10(e2);
inc(b2,(c2 xor d2 xor e2)+X[12]); b2:=RL(b2, 8)+a2; d2:=RL10(d2);
inc(a2,(b2 xor c2 xor d2)+X[15]); a2:=RL(a2, 5)+e2; c2:=RL10(c2);
inc(e2,(a2 xor b2 xor c2)+X[10]); e2:=RL(e2,12)+d2; b2:=RL10(b2);
inc(d2,(e2 xor a2 xor b2)+X[ 4]); d2:=RL(d2, 9)+c2; a2:=RL10(a2);
inc(c2,(d2 xor e2 xor a2)+X[ 1]); c2:=RL(c2,12)+b2; e2:=RL10(e2);
inc(b2,(c2 xor d2 xor e2)+X[ 5]); b2:=RL(b2, 5)+a2; d2:=RL10(d2);
inc(a2,(b2 xor c2 xor d2)+X[ 8]); a2:=RL(a2,14)+e2; c2:=RL10(c2);
inc(e2,(a2 xor b2 xor c2)+X[ 7]); e2:=RL(e2, 6)+d2; b2:=RL10(b2);
inc(d2,(e2 xor a2 xor b2)+X[ 6]); d2:=RL(d2, 8)+c2; a2:=RL10(a2);
inc(c2,(d2 xor e2 xor a2)+X[ 2]); c2:=RL(c2,13)+b2; e2:=RL10(e2);
inc(b2,(c2 xor d2 xor e2)+X[13]); b2:=RL(b2, 6)+a2; d2:=RL10(d2);
inc(a2,(b2 xor c2 xor d2)+X[14]); a2:=RL(a2, 5)+e2; c2:=RL10(c2);
inc(e2,(a2 xor b2 xor c2)+X[ 0]); e2:=RL(e2,15)+d2; b2:=RL10(b2);
inc(d2,(e2 xor a2 xor b2)+X[ 3]); d2:=RL(d2,13)+c2; a2:=RL10(a2);
inc(c2,(d2 xor e2 xor a2)+X[ 9]); c2:=RL(c2,11)+b2; e2:=RL10(e2);
inc(b2,(c2 xor d2 xor e2)+X[11]); b2:=RL(b2,11)+a2; d2:=RL10(d2);
c1 := Data[1] + c1 + d2;
Data[1] := Data[2] + d1 + e2;
Data[2] := Data[3] + e1 + a2;
Data[3] := Data[4] + a1 + b2;
Data[4] := Data[0] + b1 + c2;
Data[0] := c1;
end;
{$endif}
{$endif}
{---------------------------------------------------------------------------}
procedure RMD160Init(var Context: THashContext);
{-initialize context}
begin
{Clear context, buffer=0!!}
fillchar(Context,sizeof(Context),0);
with Context do begin
Hash[0] := longint($67452301);
Hash[1] := longint($efcdab89);
Hash[2] := longint($98badcfe);
Hash[3] := longint($10325476);
Hash[4] := longint($c3d2e1f0);
end;
end;
{---------------------------------------------------------------------------}
procedure RMD160UpdateXL(var Context: THashContext; Msg: pointer; Len: longint);
{-update context with Msg data}
var
i: integer;
begin
{Update message bit length}
if Len<=$1FFFFFFF then UpdateLen(Context.MLen[1], Context.MLen[0], Len shl 3)
else begin
for i:=1 to 8 do UpdateLen(Context.MLen[1], Context.MLen[0], Len)
end;
while Len > 0 do begin
{fill block with msg data}
Context.Buffer[Context.Index]:= pByte(Msg)^;
inc(Ptr2Inc(Msg));
inc(Context.Index);
dec(Len);
if Context.Index=RMD160_BlockLen then begin
{If 512 bit transferred, compress a block}
Context.Index:= 0;
RMD160Compress(Context.Hash,Context.Buffer);
while Len>=RMD160_BlockLen do begin
move(Msg^,Context.Buffer,RMD160_BlockLen);
RMD160Compress(Context.Hash,Context.Buffer);
inc(Ptr2Inc(Msg),RMD160_BlockLen);
dec(Len,RMD160_BlockLen);
end;
end;
end;
end;
{---------------------------------------------------------------------------}
procedure RMD160Update(var Context: THashContext; Msg: pointer; Len: word);
{-update context with Msg data}
begin
RMD160UpdateXL(Context, Msg, Len);
end;
{---------------------------------------------------------------------------}
procedure RMD160FinalBitsEx(var Context: THashContext; var Digest: THashDigest; BData: byte; bitlen: integer);
{-finalize RMD160 calculation with bitlen bits from BData (big-endian), clear context}
var
i: integer;
begin
{Message padding}
{append bits from BData and a single '1' bit}
if (bitlen>0) and (bitlen<=7) then begin
Context.Buffer[Context.Index]:= (BData and BitAPI_Mask[bitlen]) or BitAPI_PBit[bitlen];
UpdateLen(Context.MLen[1], Context.MLen[0], bitlen);
end
else Context.Buffer[Context.Index]:= $80;
for i:=Context.Index+1 to 63 do Context.Buffer[i] := 0;
{2. Compress if more than 448 bits, (no room for 64 bit length}
if Context.Index>= 56 then begin
RMD160Compress(Context.Hash,Context.Buffer);
fillchar(Context.Buffer,56,0);
end;
{Write 64 bit msg length into the last bits of the last block}
{(in big endian format) and do a final compress}
THashBuf32(Context.Buffer)[14] := Context.MLen[0];
THashBuf32(Context.Buffer)[15] := Context.MLen[1];
RMD160Compress(Context.Hash,Context.Buffer);
{Transfer Context.Hash to Digest, clear upper part of Digest}
fillchar(Digest[sizeof(TRMD160Digest)], sizeof(Digest)-sizeof(TRMD160Digest), 0);
move(Context.Hash, Digest, sizeof(TRMD160Digest));
{Clear context}
fillchar(Context,sizeof(Context),0);
end;
{---------------------------------------------------------------------------}
procedure RMD160FinalBits(var Context: THashContext; var Digest: TRMD160Digest; BData: byte; bitlen: integer);
{-finalize RMD160 calculation with bitlen bits from BData (big-endian), clear context}
var
tmp: THashDigest;
begin
RMD160FinalBitsEx(Context, tmp, BData, bitlen);
move(tmp, Digest, sizeof(Digest));
end;
{---------------------------------------------------------------------------}
procedure RMD160FinalEx(var Context: THashContext; var Digest: THashDigest);
{-finalize RMD160 calculation, clear context}
begin
RMD160FinalBitsEx(Context,Digest,0,0);
end;
{---------------------------------------------------------------------------}
procedure RMD160Final(var Context: THashContext; var Digest: TRMD160Digest);
{-finalize RMD160 calculation, clear context}
var
tmp: THashDigest;
begin
RMD160FinalBitsEx(Context, tmp, 0, 0);
move(tmp, Digest, sizeof(Digest));
end;
{---------------------------------------------------------------------------}
function RMD160SelfTest: boolean;
{-self test for strings from RMD160 page}
const
s1: string[ 3] = 'abc';
s2: string[56] = 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq';
D1: TRMD160Digest= ($8e,$b2,$08,$f7,$e0,$5d,$98,$7a,$9b,$04,$4a,$8e,$98,$c6,$b0,$87,$f1,$5a,$0b,$fc);
D2: TRMD160Digest= ($12,$a0,$53,$38,$4a,$9c,$0c,$88,$e4,$05,$a0,$6c,$27,$dc,$f4,$9a,$da,$62,$eb,$2b);
D3: TRMD160Digest= ($63,$d0,$36,$56,$71,$3e,$6e,$8e,$a7,$b6,$be,$68,$03,$28,$f9,$50,$1f,$59,$f3,$5e);
D4: TRMD160Digest= ($dd,$bd,$bb,$a7,$86,$27,$4f,$48,$63,$1a,$7d,$d3,$8f,$84,$b0,$b6,$a7,$e5,$53,$67);
var
Context: THashContext;
Digest : TRMD160Digest;
function SingleTest(s: Str127; TDig: TRMD160Digest): boolean;
{-do a single test, const not allowed for VER<7}
{ Two sub tests: 1. whole string, 2. one update per char}
var
i: integer;
begin
SingleTest := false;
{1. Hash complete string}
RMD160Full(Digest, @s[1],length(s));
{Compare with known value}
if not HashSameDigest(@RMD160_Desc, PHashDigest(@Digest), PHashDigest(@TDig)) then exit;
{2. one update call for all chars}
RMD160Init(Context);
for i:=1 to length(s) do RMD160Update(Context,@s[i],1);
RMD160Final(Context,Digest);
{Compare with known value}
if not HashSameDigest(@RMD160_Desc, PHashDigest(@Digest), PHashDigest(@TDig)) then exit;
SingleTest := true;
end;
begin
RMD160SelfTest := false;
{Note: No independent bit level test vector available. But HMAC-RMD160}
{reproduces NESSIE HMAC-Ripemd-160-512.unverified.test-vectors. The }
{following vectors are calculated once and used for regression testing}
RMD160Init(Context);
RMD160FinalBits(Context,Digest,0,1);
if not HashSameDigest(@RMD160_Desc, PHashDigest(@Digest), PHashDigest(@D3)) then exit;
{4 hightest bits of $50, D4 calculated with program shatest from RFC 4634}
RMD160Init(Context);
RMD160FinalBits(Context,Digest,$50,4);
if not HashSameDigest(@RMD160_Desc, PHashDigest(@Digest), PHashDigest(@D4)) then exit;
{strings from RMD160 document}
RMD160SelfTest := SingleTest(s1, D1) and SingleTest(s2, D2)
end;
{---------------------------------------------------------------------------}
procedure RMD160FullXL(var Digest: TRMD160Digest; Msg: pointer; Len: longint);
{-RMD160 of Msg with init/update/final}
var
Context: THashContext;
begin
RMD160Init(Context);
RMD160UpdateXL(Context, Msg, Len);
RMD160Final(Context, Digest);
end;
{---------------------------------------------------------------------------}
procedure RMD160Full(var Digest: TRMD160Digest; Msg: pointer; Len: word);
{-RMD160 of Msg with init/update/final}
begin
RMD160FullXL(Digest, Msg, Len);
end;
{---------------------------------------------------------------------------}
procedure RMD160File({$ifdef CONST} const {$endif} fname: string;
var Digest: TRMD160Digest; var buf; bsize: word; var Err: word);
{-RMD160 of file, buf: buffer with at least bsize bytes}
var
tmp: THashDigest;
begin
HashFile(fname, @RMD160_Desc, tmp, buf, bsize, Err);
move(tmp, Digest, sizeof(Digest));
end;
begin
{$ifdef VER5X}
fillchar(RMD160_Desc, sizeof(RMD160_Desc), 0);
with RMD160_Desc do begin
HSig := C_HashSig;
HDSize := sizeof(THashDesc);
HDVersion := C_HashVers;
HBlockLen := RMD160_BlockLen;
HDigestlen:= sizeof(TRMD160Digest);
HInit := RMD160Init;
HFinal := RMD160FinalEx;
HUpdateXL := RMD160UpdateXL;
HAlgNum := longint(_RIPEMD160);
HName := 'RIPEMD160';
HPtrOID := @RMD160_OID;
HLenOID := 6;
HFinalBit := RMD160FinalBitsEx;
end;
{$endif}
RegisterHash(_RIPEMD160, @RMD160_Desc);
end.
|
unit PaymentListParams;
interface
uses
SysUtils;
type
TPaymentListParams = class
private
FFromDate: TDateTime;
FUntilDate: TDateTime;
FLocationCode: string;
public
property FromDate: TDateTime read FFromDate write FFromDate;
property UntilDate: TDateTime read FUntilDate write FUntilDate;
property LocationCode: string read FLocationCode write FLocationCode;
constructor Create;
destructor Destroy; override;
end;
var
plp: TPaymentListParams;
implementation
uses
IFinanceGlobal;
constructor TPaymentListParams.Create;
begin
if plp <> nil then
Abort
else
begin
plp := self;
FFromDate := ifn.AppDate;
FUntilDate := ifn.AppDate;
FLocationCode := ifn.LocationCode;
end;
end;
destructor TPaymentListParams.Destroy;
begin
if plp = self then
plp := nil;
inherited;
end;
end.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.