我必须使用运行时类型信息构建我的程序,因此检查编译器选项Emit runtime type information。
但是有了这个设置,LockBox3 单元uTPLb_codecIntf.pas
给出了错误E2134 类型在包含实现的行上没有类型信息(参见源代码的底部)。
(LockBox3\run\
源)文件夹位于我的库路径中(由安装指定)。
LockBox DCU 的d:\LockBox3\packages\Sydney\Delphi\Win32\Release\
日期自安装之日起。
我怎样才能摆脱错误消息但 RTTI 可用?
编辑FWIW,这些是以下内容uTPLb_codecIntf.pas
:
interface
uses SysUtils, Classes, uTPLb_StreamCipher, uTPLb_BlockCipher,
uTPLb_CryptographicLibrary;
type
TCodecMode = (cmUnitialized, cmIdle, cmEncrypting, cmDecrypting);
TOnEncDecProgress = function ( Sender: TObject; CountBytesProcessed: int64): boolean of object;
TGenerateAsymetricKeyPairProgress = procedure (
Sender: TObject; CountPrimalityTests: integer;
var doAbort: boolean) of object;
ICodec = interface
['{48B3116A-5681-4E79-9013-8EC89BAC5B35}']
procedure SetStreamCipher( const Value: IStreamCipher);
procedure SetBlockCipher ( const Value: IBlockCipher);
procedure SetChainMode ( const Value: IBlockChainingModel);
function GetMode: TCodecMode;
function GetStreamCipher: IStreamCipher;
function GetBlockCipher : IBlockCipher;
function GetChainMode : IBlockChainingModel;
function GetOnProgress : TOnEncDecProgress;
procedure SetOnProgress( Value: TOnEncDecProgress);
function GetAsymetricKeySizeInBits: cardinal;
procedure SetAsymetricKeySizeInBits( value: cardinal);
function GetAsymGenProgressEvent: TGenerateAsymetricKeyPairProgress;
procedure SetAsymGenProgressEvent( Value: TGenerateAsymetricKeyPairProgress);
function GetKey: TSymetricKey;
function GetCipherDisplayName( Lib: TCryptographicLibrary): string;
procedure Init(const Key: string; AEncoding: TEncoding);
procedure SaveKeyToStream( Store: TStream);
procedure InitFromStream( Store: TStream);
procedure InitFromKey( Key: TSymetricKey); // Transfers ownership.
procedure Reset;
procedure Burn( doIncludeBurnKey: boolean);
// Asymetric support
function isAsymetric: boolean;
procedure InitFromGeneratedAsymetricKeyPair;
procedure Sign(
Document, Signature: TStream;
ProgressSender: TObject;
ProgressEvent: TOnEncDecProgress;
SigningKeys_PrivatePart: TObject; // Must be uTPLb_Asymetric.TAsymtricKeyPart
var wasAborted: boolean);
function VerifySignature(
Document, Signature: TStream;
ProgressSender: TObject;
ProgressEvent: TOnEncDecProgress;
SigningKeys_PublicPart: TObject; // Must be uTPLb_Asymetric.TAsymtricKeyPart
var wasAborted: boolean): boolean;
procedure Begin_EncryptMemory( CipherText{out}: TStream);
procedure EncryptMemory(const Plaintext: TBytes; PlaintextLen: Integer);
procedure End_EncryptMemory;
procedure Begin_DecryptMemory( PlainText{out}: TStream);
procedure DecryptMemory( const CipherText{in}; CiphertextLen: integer);
procedure End_DecryptMemory;
procedure EncryptStream( Plaintext, CipherText: TStream);
procedure DecryptStream( Plaintext, CipherText: TStream);
procedure EncryptFile( const Plaintext_FileName, CipherText_FileName: string);
procedure DecryptFile( const Plaintext_FileName, CipherText_FileName: string);
procedure EncryptString(const Plaintext: string; var CipherText_Base64: string; AEncoding: TEncoding);
procedure DecryptString(var Plaintext: string; const CipherText_Base64: string; AEncoding: TEncoding);
procedure EncryptAnsiString(const Plaintext: string; var CipherText_Base64: string);
procedure DecryptAnsiString(var Plaintext: string; const CipherText_Base64: string);
function GetAborted: boolean;
procedure SetAborted( Value: boolean);
function GetAdvancedOptions2 : TSymetricEncryptionOptionSet;
procedure SetAdvancedOptions2( Value: TSymetricEncryptionOptionSet);
function GetOnSetIV: TSetMemStreamProc;
procedure SetOnSetIV( Value: TSetMemStreamProc);
property Mode: TCodecMode read GetMode;
property Key: TSymetricKey read GetKey;
property StreamCipher: IStreamCipher read GetStreamCipher write SetStreamCipher;
property BlockCipher : IBlockCipher read GetBlockCipher write SetBlockCipher;
property ChainMode : IBlockChainingModel read GetChainMode write SetChainMode;
property OnProgress : TOnEncDecProgress read GetonProgress write SetOnProgress;
property AsymetricKeySizeInBits: cardinal read GetAsymetricKeySizeInBits
write SetAsymetricKeySizeInBits;
property OnAsymGenProgress: TGenerateAsymetricKeyPairProgress
read GetAsymGenProgressEvent write SetAsymGenProgressEvent;
property isUserAborted: boolean read GetAborted write SetAborted;
end;
implementation
end.