Einzelnen Beitrag anzeigen

mkinzler
(Moderator)

Registriert seit: 9. Dez 2005
Ort: Heilbronn
39.858 Beiträge
 
Delphi 11 Alexandria
 
#6

AW: BufferedReader in Firemonkey?

  Alt 10. Dez 2014, 16:10
Ich habe den JNI Wrapper mal mit Java2Op erzeugen lassen. Die Konstruktoren sind als init-Methoden implementiert.

Delphi-Quellcode:
{*******************************************************}
{                                                       }
{           CodeGear Delphi Runtime Library             }
{ Copyright(c) 2014 Embarcadero Technologies, Inc.      }
{                                                       }
{*******************************************************}

unit Androidapi.JNI.java.io.BufferedReader;

interface

uses
  Androidapi.JNIBridge,
  Androidapi.JNI.JavaTypes;

type
// ===== Forward declarations =====

  JBufferedReader = interface;//java.io.BufferedReader

// ===== Interface declarations =====

  JBufferedReaderClass = interface(JReaderClass)
    ['{ED860F80-BCB7-4BC0-977F-95DE9CACE248}']
    {class} function init(in_: JReader): JBufferedReader; cdecl; overload;
    {class} function init(in_: JReader; size: Integer): JBufferedReader; cdecl; overload;
  end;

  [JavaSignature('java/io/BufferedReader')]
  JBufferedReader = interface(JReader)
    ['{81A25906-BC48-4F21-B1D4-5FDA81218C63}']
    procedure close; cdecl;
    procedure mark(markLimit: Integer); cdecl;
    function markSupported: Boolean; cdecl;
    function read: Integer; cdecl; overload;
    function read(buffer: TJavaArray<Char>; offset: Integer; length: Integer): Integer; cdecl; overload;
    function readLine: JString; cdecl;
    function ready: Boolean; cdecl;
    procedure reset; cdecl;
    function skip(charCount: Int64): Int64; cdecl;
  end;
  TJBufferedReader = class(TJavaGenericImport<JBufferedReaderClass, JBufferedReader>) end;

implementation

procedure RegisterTypes;
begin
  TRegTypes.RegisterType('Androidapi.JNI.Interfaces.JBufferedReader', TypeInfo(Androidapi.JNI.Interfaces.JBufferedReader));
end;

initialization
  RegisterTypes;
end.
Markus Kinzler
  Mit Zitat antworten Zitat