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;

最新文章

  1. struts标签
  2. jQuery动画高级用法——详解animation中的.queue()函数
  3. Hadoop-2.X HA模式下的FSImage和EditsLog合并过程
  4. JS的构造及其事件注意点总结
  5. CCNA的RIP路由学习
  6. Spring ProxyFactory
  7. java中super()和this()浅析
  8. 点击鼠标获取元素ID
  9. EasyNet.Solr 4.4.0发布及例子
  10. ng-option小解
  11. Android: DrawerLayout 侧滑菜单栏
  12. java Static的使用
  13. [译]Ocelot - Routing
  14. jenkins grunt 自动构建流程
  15. mysql 变量名称的使用不当的一个错误
  16. TCP三次握手和四次挥手详解
  17. SQL学习笔记二之MySQL的数据库操作
  18. LinuxMint19/LMDE3安装后的设置
  19. PHP 汉字转成拼音
  20. sa learning

热门文章

  1. 非 GUI 模式运行 JMeter 压力测试
  2. C# 使用HttpWebRequest Post提交数据,携带Cookie和相关参数示例
  3. 菜鸟进阶之:VC++之Visual Studio中DLL调用实现
  4. Python的语言特性
  5. 零基础学php的自学
  6. Java Redis 连接池 Jedis 工具类
  7. 堆--LogN的数据结构
  8. tomcat放置静态html页面
  9. js中__proto__和prototype的区别和关系
  10. 一个菜鸟正在用SSH写一个论坛(2)