N
noall
Unregistered / Unconfirmed
GUEST, unregistred user!
aclass := aobject.ClassType;
ClassTypeInfo := aclass.ClassInfo;
ClassTypeData := GetTypeData(ClassTypeInfo);
Proplist := Nil;
FrmProgress.Gauge1.Progress := FrmProgress.Gauge1.Progress + 1;
Try
GetMem(PropList, SizeOf(PPropInfo) * ClassTypeData.PropCount);
getpropinfos(aclass.classinfo, proplist);
For J := 0 To ClassTypeData.PropCount - 1 Do
Begin
Tk := PropList[J]^.PropType^.Kind;
If Tk = tkMethod Then
continue;
{ÏÂÃæÊÇдÈëÊôÐÔÊýÖµ}
Case tk Of
tklstring, tkString, tkWString:
Begin
{ TempInt := 1;
BBstr.Write(TempInt, sizeof(tempint));}
FieldStr := GetStrProp(aobject As aclass,
PropList[J]^.Name);
TempInt := Length(FieldStr);
Bbstr.Write(TempInt, SizeOf(TempInt)); //
Bbstr.Write(FieldStr[1], TempInt);
End;
tkinteger:
Begin
{ TempInt := 2;
BBstr.Write(TempInt, sizeof(tempint)); }
TempInt := GetOrdProp(aobject As aclass,
PropList[J]^.Name);
bbstr.write(TempInt, sizeof(TempInt));
End;
tkFloat:
Begin
Try
TempDou := GetFloatProp(aobject As aclass,
PropList[J]^.Name);
Except
TempDou := 0;
End;
{ TempInt := 3;
BBstr.Write(TempInt, sizeof(tempint));}
bbstr.Write(TempDou, sizeof(TempDou));
End;
tkClass:
Begin
{ TempInt := 5;
BBstr.Write(TempInt, sizeof(tempint));}
childobject := GetObjectProp(aobject As aclass,
PropList[j]^.Name);
apointer := childobject;
atcxbase := TCxList(apointer);
TempStr := Self.GetStrucName;
BBstr.Write(TempStr, WFieldValueLen); //
TempStr := 'nil'; //Èç¹ûΪ¿Õ£¬ÔòÊäÈënil
If atcxbase <> Nil Then
TempStr := atcxbase.GetStrucName;
BBstr.Write(TempStr, WFieldValueLen);
atcxbase.WriteFieldValue(BBstr);
End;
tkEnumeration:
Begin
TempStr := GetEnumProp(aobject As aclass,
PropList[j]^.Name);
len := length(TempStr) + 1;
{ TempInt := 4;
BBstr.Write(TempInt, sizeof(tempint));}
bbstr.write(len, sizeof(integer));
bbstr.Write(TempStr, len);
End;
tkSet:
Begin
{ TempInt := 6;
BBstr.Write(TempInt, sizeof(tempint));}
TempInt := GetOrdProp(aobject As aclass,
PropList[J]^.Name);
bbstr.write(TempInt, sizeof(TempInt));
End;
End; //end case
End; //end for
Finally
FreeMem(PropList, SizeOf(PPropInfo) * ClassTypeData.PropCount);
End;
ClassTypeInfo := aclass.ClassInfo;
ClassTypeData := GetTypeData(ClassTypeInfo);
Proplist := Nil;
FrmProgress.Gauge1.Progress := FrmProgress.Gauge1.Progress + 1;
Try
GetMem(PropList, SizeOf(PPropInfo) * ClassTypeData.PropCount);
getpropinfos(aclass.classinfo, proplist);
For J := 0 To ClassTypeData.PropCount - 1 Do
Begin
Tk := PropList[J]^.PropType^.Kind;
If Tk = tkMethod Then
continue;
{&Iuml;&Acirc;&Atilde;&aelig;&Ecirc;&Ccedil;&ETH;&acute;&Egrave;&euml;&Ecirc;&ocirc;&ETH;&Ocirc;&Ecirc;&yacute;&Ouml;&micro;}
Case tk Of
tklstring, tkString, tkWString:
Begin
{ TempInt := 1;
BBstr.Write(TempInt, sizeof(tempint));}
FieldStr := GetStrProp(aobject As aclass,
PropList[J]^.Name);
TempInt := Length(FieldStr);
Bbstr.Write(TempInt, SizeOf(TempInt)); //
Bbstr.Write(FieldStr[1], TempInt);
End;
tkinteger:
Begin
{ TempInt := 2;
BBstr.Write(TempInt, sizeof(tempint)); }
TempInt := GetOrdProp(aobject As aclass,
PropList[J]^.Name);
bbstr.write(TempInt, sizeof(TempInt));
End;
tkFloat:
Begin
Try
TempDou := GetFloatProp(aobject As aclass,
PropList[J]^.Name);
Except
TempDou := 0;
End;
{ TempInt := 3;
BBstr.Write(TempInt, sizeof(tempint));}
bbstr.Write(TempDou, sizeof(TempDou));
End;
tkClass:
Begin
{ TempInt := 5;
BBstr.Write(TempInt, sizeof(tempint));}
childobject := GetObjectProp(aobject As aclass,
PropList[j]^.Name);
apointer := childobject;
atcxbase := TCxList(apointer);
TempStr := Self.GetStrucName;
BBstr.Write(TempStr, WFieldValueLen); //
TempStr := 'nil'; //&Egrave;&ccedil;&sup1;&ucirc;&Icirc;&ordf;&iquest;&Otilde;&pound;&not;&Ocirc;ò&Ecirc;&auml;&Egrave;&euml;nil
If atcxbase <> Nil Then
TempStr := atcxbase.GetStrucName;
BBstr.Write(TempStr, WFieldValueLen);
atcxbase.WriteFieldValue(BBstr);
End;
tkEnumeration:
Begin
TempStr := GetEnumProp(aobject As aclass,
PropList[j]^.Name);
len := length(TempStr) + 1;
{ TempInt := 4;
BBstr.Write(TempInt, sizeof(tempint));}
bbstr.write(len, sizeof(integer));
bbstr.Write(TempStr, len);
End;
tkSet:
Begin
{ TempInt := 6;
BBstr.Write(TempInt, sizeof(tempint));}
TempInt := GetOrdProp(aobject As aclass,
PropList[J]^.Name);
bbstr.write(TempInt, sizeof(TempInt));
End;
End; //end case
End; //end for
Finally
FreeMem(PropList, SizeOf(PPropInfo) * ClassTypeData.PropCount);
End;