upgrade
This commit is contained in:
@@ -3,7 +3,7 @@ public
|
||||
function Create();
|
||||
function Init();virtual;
|
||||
function InitZip(zip: ZipFile);
|
||||
function OpenFile(alias: string; file: string; password: string): tableArray;
|
||||
function Open(alias: string; file: string; password: string): tableArray;
|
||||
function Save(): tableArray;
|
||||
function SaveAs(alias: string; file: string): tableArray;
|
||||
function Zip(): ZipFile;
|
||||
@@ -29,7 +29,7 @@ begin
|
||||
zipfile_ := zip;
|
||||
end;
|
||||
|
||||
function TSComponentsBase.OpenFile(alias: string; file: string; password: string): tableArray;
|
||||
function TSComponentsBase.Open(alias: string; file: string; password: string): tableArray;
|
||||
begin
|
||||
{self.}Init();
|
||||
zipfile_ := new ZipFile();
|
||||
|
||||
@@ -5,6 +5,7 @@ public
|
||||
function Add(data: any): boolean;
|
||||
function Append(data: any): boolean;
|
||||
function Insert(data: any): boolean;
|
||||
function InsertAfter(data: any; pos_data: any);
|
||||
function Get(name: string; index: integer);overload;
|
||||
function Get(): array of tslobj;overload;
|
||||
|
||||
@@ -23,6 +24,7 @@ public
|
||||
function Create(name: string);
|
||||
function Set(data: any);
|
||||
function Add(data: any);
|
||||
function InsertAfter(data: any; pos_data: any): boolean;
|
||||
function Name(): string;
|
||||
function Size(): integer;
|
||||
function First(): Node;
|
||||
@@ -113,6 +115,16 @@ begin
|
||||
return ifnil(child_[data.ElementName]) ? {self.}Append(data) : {self.}Add(data);
|
||||
end;
|
||||
|
||||
function TSOfficeContainer.InsertAfter(data: any; pos_data: any);
|
||||
begin
|
||||
for i:=0 to current_index_ do
|
||||
begin
|
||||
obj := bucket_[i];
|
||||
if ifObj(obj) then
|
||||
if obj.InsertAfter(data, pos_data) then break;
|
||||
end
|
||||
end;
|
||||
|
||||
function TSOfficeContainer.Get(): array of tslobj;overload;
|
||||
begin
|
||||
arr := array();
|
||||
@@ -207,6 +219,26 @@ begin
|
||||
size_++;
|
||||
end;
|
||||
|
||||
function LinkList.InsertAfter(data: any; pos_data: any): boolean;
|
||||
begin
|
||||
node := {self.}First();
|
||||
while ifObj(node) do
|
||||
begin
|
||||
if node.data = pos_data then
|
||||
begin
|
||||
new_node := new Node();
|
||||
new_node.data := data;
|
||||
new_node.next := node.next;
|
||||
node.next := new_node;
|
||||
if tail_ = node then tail_ := new_node;
|
||||
size_++;
|
||||
return true;
|
||||
end
|
||||
node := node.next;
|
||||
end
|
||||
return false;
|
||||
end;
|
||||
|
||||
function LinkList.Name(): string;
|
||||
begin
|
||||
return name_;
|
||||
|
||||
Reference in New Issue
Block a user