summaryrefslogtreecommitdiff
path: root/rtl/java/objpash.inc
blob: fb40e2174e554ab9f210b202e5952075b7537e4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
{
    This file is part of the Free Pascal run time library.
    Copyright (c) 2011 by Jonas Maebe
    member of the Free Pascal development team.

    This file implements the helper routines for TObject

    See the file COPYING.FPC, included in this distribution,
    for details about the copyright.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

 **********************************************************************
}

type
  TObject = class(JLObject)
   strict private
    DestructorCalled: Boolean;
   public
    procedure Free;
    destructor Destroy; virtual;
    procedure finalize; override;
  end;
  TClass = class of TObject;

  TJClass = class of jlobject;


   const
      vtInteger       = 0;
      vtBoolean       = 1;
      vtChar          = 2;
   {$ifndef FPUNONE}
      vtExtended      = 3;
   {$endif}
      vtString        = 4;
      vtPointer       = 5;
      vtPChar         = 6;
      vtObject        = 7;
      vtClass         = 8;
      vtWideChar      = 9;
      vtPWideChar     = 10;
      vtAnsiString    = 11;
      vtCurrency      = 12;
      vtVariant       = 13;
      vtInterface     = 14;
      vtWideString    = 15;
      vtInt64         = 16;
      vtQWord         = 17;
      vtUnicodeString = 18;

   type
     TVarRec = record
       VType: sizeint;
       Value: JLObject;
       procedure init(l: longint);
       procedure init(b: boolean);
       procedure init(c: ansichar);
       procedure init(w: widechar);
       procedure init(d: extended);
       procedure init(const s: shortstring);
       // pointer = object -> use constref to get different signature
       procedure init(constref p: pointer);
       procedure init(p: pchar);
       procedure init(p: JLObject);
       procedure init(c: TJClass);
       procedure init(p: pwidechar);
       procedure init(const a: ansistring);
       // currency = int64 -> use constref to get different signature
       procedure init(constref c: currency);
       // procedure init(const v: variant);
       // interface = object
       procedure init(const w: widestring);
       procedure init(i: int64);
       // unicodestring = widestring

       // qword = int64 -> extra parameter to solve signature problem
       procedure init(q: qword; unsigned: boolean = true);

       function VInteger: longint;
       function VBoolean: boolean;
       function VChar: ansichar;
       function VWideChar: widechar;
       function VExtended: PExtended;
       function VDouble: double;
       function VString: PShortString;
       function VPointer: pointer;
       function VPChar: PChar;
       function VObject: JLObject;
       function VClass: TJClass;
       function VPWideChar: PWideChar;
       function VAnsiString: Pointer;
       function VCurrency: PCurrency;
       // function VVariant: PVariant;
       function VInterface: JLObject;
       function VWideString: Pointer;
       function VInt64: PInt64;
       function VUnicodeString: Pointer;
       function VQWord: PQWord;
      end;