TJSONTableObject跨平台解析JSON
TJSONTableObject跨平台解析JSON
USES SynCrossPlatformJSON
TSQLRecordPeoplePersistent = class(TPersistent)
private
fRowID: integer;
fData: TByteDynArray;
fFirstName: string;
fLastName: string;
fYearOfBirth: integer;
fYearOfDeath: word;
published
property RowID: integer read fRowID write fRowID;
property FirstName: string read fFirstName write fFirstName;
property LastName: string read fLastName write fLastName;
property Data: TByteDynArray read fData write fData;
property YearOfBirth: integer read fYearOfBirth write fYearOfBirth;
property YearOfDeath: word read fYearOfDeath write fYearOfDeath;
end;
procedure TTestTableContent.SynopseCrossORM; // by cxg
var json: string;
table: TJSONTableObject;
people: TSQLRecordPeoplePersistent;
begin
json := AnyTextFileToString(fFileName,true);
people := TSQLRecordPeoplePersistent.Create;
Owner.TestTimer.Start;
table := TJSONTableObject.Create(json);
fRunConsoleOccurenceNumber := 0;
while table.StepObject(people) do begin
Check(people.FirstName<>'');
Check(people.LastName<>'');
Check(people.YearOfBirth<10000);
Check((people.YearOfDeath>1400)and(people.YearOfDeath<2000));
Check((people.RowID>11011) or (people.Data<>nil));
inc(fRunConsoleOccurenceNumber);
end;
fRunConsoleMemoryUsed := MemoryUsed-fMemoryAtStart;
table.Free;
people.Free;
end;
最新文章
- struts标签
- jQuery动画高级用法——详解animation中的.queue()函数
- Hadoop-2.X HA模式下的FSImage和EditsLog合并过程
- JS的构造及其事件注意点总结
- CCNA的RIP路由学习
- Spring ProxyFactory
- java中super()和this()浅析
- 点击鼠标获取元素ID
- EasyNet.Solr 4.4.0发布及例子
- ng-option小解
- Android: DrawerLayout 侧滑菜单栏
- java Static的使用
- [译]Ocelot - Routing
- jenkins grunt 自动构建流程
- mysql 变量名称的使用不当的一个错误
- TCP三次握手和四次挥手详解
- SQL学习笔记二之MySQL的数据库操作
- LinuxMint19/LMDE3安装后的设置
- PHP 汉字转成拼音
- sa learning