-
Notifications
You must be signed in to change notification settings - Fork 4
/
MemoryStream.inc
118 lines (96 loc) · 3.88 KB
/
MemoryStream.inc
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
//----------------------------------------
// ´úÂëÓÉGenlibVcl¹¤¾ß×Ô¶¯Éú³É¡£
// Copyright ? ying32. All Rights Reserved.
//
//----------------------------------------
function MemoryStream_Create: TMemoryStream; cdecl;
begin
Result := TMemoryStream.Create;
end;
procedure MemoryStream_Free(AObj: TMemoryStream); cdecl;
begin
AObj.Free;
end;
procedure MemoryStream_Clear(AObj: TMemoryStream); cdecl;
begin
AObj.Clear;
end;
procedure MemoryStream_LoadFromStream(AObj: TMemoryStream; Stream: TStream); cdecl;
begin
AObj.LoadFromStream(Stream);
end;
procedure MemoryStream_LoadFromFile(AObj: TMemoryStream; FileName: PWideChar); cdecl;
begin
AObj.LoadFromFile(FileName);
end;
procedure MemoryStream_Seek(AObj: TMemoryStream; var Offset: Int64; Origin: TSeekOrigin; var Result: Int64); cdecl;
begin
Result := AObj.Seek(Offset, Origin);
end;
procedure MemoryStream_SaveToStream(AObj: TMemoryStream; Stream: TStream); cdecl;
begin
AObj.SaveToStream(Stream);
end;
procedure MemoryStream_SaveToFile(AObj: TMemoryStream; FileName: PWideChar); cdecl;
begin
AObj.SaveToFile(FileName);
end;
procedure MemoryStream_CopyFrom(AObj: TMemoryStream; Source: TStream; var Count: Int64; var Result: Int64); cdecl;
begin
Result := AObj.CopyFrom(Source, Count);
end;
function MemoryStream_ClassName(AObj: TMemoryStream): PWideChar; cdecl;
begin
Result := ShortstrToPWideChar(AObj.ClassName);
end;
function MemoryStream_Equals(AObj: TMemoryStream; Obj: TObject): LongBool; cdecl;
begin
Result := AObj.Equals(Obj);
end;
function MemoryStream_GetHashCode(AObj: TMemoryStream): Integer; cdecl;
begin
Result := AObj.GetHashCode;
end;
function MemoryStream_ToString(AObj: TMemoryStream): PWideChar; cdecl;
begin
Result := PWideChar(AObj.ToString);
end;
function MemoryStream_GetMemory(AObj: TMemoryStream): Pointer; cdecl;
begin
Result := AObj.Memory;
end;
procedure MemoryStream_GetPosition(AObj: TMemoryStream; var Result: Int64); cdecl;
begin
Result := AObj.Position;
end;
procedure MemoryStream_SetPosition(AObj: TMemoryStream; var AValue: Int64); cdecl;
begin
AObj.Position := AValue;
end;
procedure MemoryStream_GetSize(AObj: TMemoryStream; var Result: Int64); cdecl;
begin
Result := AObj.Size;
end;
procedure MemoryStream_SetSize(AObj: TMemoryStream; var AValue: Int64); cdecl;
begin
AObj.Size := AValue;
end;
exports
MemoryStream_Create {$IFNDEF MSWINDOWS}name '_MemoryStream_Create'{$ENDIF},
MemoryStream_Free {$IFNDEF MSWINDOWS}name '_MemoryStream_Free'{$ENDIF},
MemoryStream_Clear {$IFNDEF MSWINDOWS}name '_MemoryStream_Clear'{$ENDIF},
MemoryStream_LoadFromStream {$IFNDEF MSWINDOWS}name '_MemoryStream_LoadFromStream'{$ENDIF},
MemoryStream_LoadFromFile {$IFNDEF MSWINDOWS}name '_MemoryStream_LoadFromFile'{$ENDIF},
MemoryStream_Seek {$IFNDEF MSWINDOWS}name '_MemoryStream_Seek'{$ENDIF},
MemoryStream_SaveToStream {$IFNDEF MSWINDOWS}name '_MemoryStream_SaveToStream'{$ENDIF},
MemoryStream_SaveToFile {$IFNDEF MSWINDOWS}name '_MemoryStream_SaveToFile'{$ENDIF},
MemoryStream_CopyFrom {$IFNDEF MSWINDOWS}name '_MemoryStream_CopyFrom'{$ENDIF},
MemoryStream_ClassName {$IFNDEF MSWINDOWS}name '_MemoryStream_ClassName'{$ENDIF},
MemoryStream_Equals {$IFNDEF MSWINDOWS}name '_MemoryStream_Equals'{$ENDIF},
MemoryStream_GetHashCode {$IFNDEF MSWINDOWS}name '_MemoryStream_GetHashCode'{$ENDIF},
MemoryStream_ToString {$IFNDEF MSWINDOWS}name '_MemoryStream_ToString'{$ENDIF},
MemoryStream_GetMemory {$IFNDEF MSWINDOWS}name '_MemoryStream_GetMemory'{$ENDIF},
MemoryStream_GetPosition {$IFNDEF MSWINDOWS}name '_MemoryStream_GetPosition'{$ENDIF},
MemoryStream_SetPosition {$IFNDEF MSWINDOWS}name '_MemoryStream_SetPosition'{$ENDIF},
MemoryStream_GetSize {$IFNDEF MSWINDOWS}name '_MemoryStream_GetSize'{$ENDIF},
MemoryStream_SetSize {$IFNDEF MSWINDOWS}name '_MemoryStream_SetSize'{$ENDIF};