135 |
|
published |
136 |
|
end; |
137 |
|
|
138 |
< |
TOniDataEmpty = class(TOniData) |
139 |
< |
private |
140 |
< |
protected |
141 |
< |
public |
142 |
< |
constructor Create(OLDBFilename: String; var Result: Boolean); override; |
143 |
< |
procedure Close; override; |
144 |
< |
published |
145 |
< |
end; |
138 |
> |
|
139 |
|
|
140 |
|
const |
141 |
|
ODB_None = -1; |
143 |
|
ODB_ADB = 1; |
144 |
|
|
145 |
|
var |
153 |
– |
// OniDataConnection: TOniData; |
146 |
|
DataConnections: array of TOniData; |
155 |
– |
OniDataConnection: TOniData; |
147 |
|
|
148 |
|
function CreateDataConnection(filename: String; backend: Integer): TOniData; |
149 |
+ |
function ConnectionExists(filename: String): TOniData; |
150 |
|
procedure CloseDataConnection(connection: TOniData); |
151 |
|
function GetEmptyFileInfo: TFileInfo; |
152 |
|
|
204 |
|
Result.src_offset := 0; |
205 |
|
Result.raw_addr := 0; |
206 |
|
Result.raw_size := 0; |
207 |
< |
for i := 0 to High(raw_list) do |
207 |
> |
if Length(raw_list) > 0 then |
208 |
|
begin |
209 |
< |
if raw_list[i].src_offset = dat_offset then |
209 |
> |
for i := 0 to High(raw_list) do |
210 |
|
begin |
211 |
< |
Result.src_id := fileid; |
212 |
< |
Result.src_offset := raw_list[i].src_offset; |
213 |
< |
Result.raw_addr := raw_list[i].raw_addr; |
214 |
< |
Result.raw_size := raw_list[i].raw_size; |
215 |
< |
Result.loc_sep := raw_list[i].loc_sep; |
216 |
< |
Break; |
211 |
> |
if raw_list[i].src_offset = dat_offset then |
212 |
> |
begin |
213 |
> |
Result.src_id := fileid; |
214 |
> |
Result.src_offset := raw_list[i].src_offset; |
215 |
> |
Result.raw_addr := raw_list[i].raw_addr; |
216 |
> |
Result.raw_size := raw_list[i].raw_size; |
217 |
> |
Result.loc_sep := raw_list[i].loc_sep; |
218 |
> |
Break; |
219 |
> |
end; |
220 |
|
end; |
221 |
|
end; |
222 |
|
end; |
1460 |
|
end; |
1461 |
|
|
1462 |
|
|
1463 |
+ |
function ConnectionExists(filename: String): TOniData; |
1464 |
+ |
var |
1465 |
+ |
i: Integer; |
1466 |
+ |
begin |
1467 |
+ |
Result := nil; |
1468 |
+ |
if Length(DataConnections) > 0 then |
1469 |
+ |
for i := 0 to High(DataConnections) do |
1470 |
+ |
if DataConnections[i].FFileName = filename then |
1471 |
+ |
begin |
1472 |
+ |
Result := DataConnections[i]; |
1473 |
+ |
Exit; |
1474 |
+ |
end; |
1475 |
+ |
end; |
1476 |
|
|
1477 |
|
|
1478 |
|
procedure CloseDataConnection(connection: TOniData); |
1520 |
|
end; |
1521 |
|
|
1522 |
|
|
1523 |
< |
|
1516 |
< |
|
1517 |
< |
constructor TOniDataEmpty.Create(OLDBFilename: String; var Result: Boolean); |
1518 |
< |
var |
1519 |
< |
i, j: Byte; |
1520 |
< |
temps: String; |
1521 |
< |
begin |
1522 |
< |
ShowMessage('OLD'); |
1523 |
< |
end; |
1524 |
< |
|
1525 |
< |
procedure TOniDataEmpty.Close; |
1526 |
< |
begin |
1527 |
< |
ShowMessage('OLD'); |
1528 |
< |
end; |
1529 |
< |
|
1530 |
< |
end. |
1523 |
> |
end. |