WriteChar方法用於寫入字符
procedure TWriter
begin
WriteString(Value)
end;
字符類型的讀寫是用讀寫字符串的方法
⑶ 部件的寫入
TWriter對象中與寫入部件有關的方法有WriteSignature
WriteSignature方法用於往流中寫入Filer對象標簽
procedure TWriter
begin
Write(FilerSignature
end;
FilerStgnature是字符串常量
WritePrefix方法用於在寫入部件前寫入ffInherited和ffChildPos標志
procedure TWriter
var
Prefix: Byte;
begin
if Flags <> [] then
begin
Prefix := $F
Write(Prefix
if ffChildPos in Flags then WriteInteger(AChildPos)
end;
end;
如果ffChildPos置位
WriteComponent方法往流中寫入部件
procedure TWriter
function FindAncestor(const Name: string)
begin
…
end;
begin
Include(Component
if Assigned(FAncestorList) then
Ancestor := FindAncestor(Component
Component
Exclude(Component
end;
方法中用Component的WritState方法寫入部件的屬性
WriteDescendant是根據祖先AAncestor的情況寫入部件Root
procedure TWriter
begin
FRootAncestor := AAncestor;
FAncestor := AAncestor;
FRoot := Root;
WriteSignature;
WriteComponent(Root)
end;
方法先調用WriteSignature方法寫入Filer對象標簽
WriteRootComponent方法則是調用WriteDescendant方法寫入部件
procedure TWriter
begin
WriteDescendent(Root
end;
返回目錄
編輯推薦
Java程序設計培訓視頻教程
J
Visual C++音頻/視頻技術開發與實戰
Oracle索引技術
ORACLE
Java程序性能優化
C嵌入式編程設計模式
Android游戲開發實踐指南
[
From:http://tw.wingwit.com/Article/program/Delphi/201311/25099.html