IceORM
TIceSQLCustomTable 增强
看下面代码例子
type [IceSQLTable('test_table_icy',diSqlServer)] TTestTable = class(TIceSQLCustomTable) public [IceSQLField('id','type:int;pk:true;ai:true')] property ID: string index 0 read GetValue write SetValue; [IceSQLField('key_test','type:varchar(50);nn:true;')] property Key: string index 1 read GetValue write SetValue; [IceSQLField('value_test','type:varchar(50);def:'''';')] property value: string index 2 read GetValue write SetValue; [IceSQLField('age','type:int;def:0;')] property Age: string index 3 read GetValue write SetValue; end; TTestValue = record id: Integer; value_test: string; end; procedure IceFearlessly_test.ORM2; var data: TTestValue; List: TIceArrayRecord<TTestValue>; begin with TTestTable.Create(SqlServerDB('SQL_SERVER_CON')) do try Key:= 'meow1'; Value:= '喵喵喵喵喵2'; Age:= 'hj1'; Update('id = ?',1); CreateTable; Key:= 'icy'; Value:= '这是一个测试咯'; Self.WriteLn('记录ID: ' + Insert.ToString); Key:= 'meow'; Value:= '喵喵喵喵喵'; Age:= '21'; Self.WriteLn('记录ID: ' + Insert.ToString); Data:= Take<TTestValue>('id = ?',3); Self.WriteLn(data.id.ToString); Self.WriteLn(data.value_test); List:= Rows('id > 0'); if list.Count > 0 then begin for var P: TTestValue in List do begin Self.WriteLn(p.id.ToString); Self.WriteLn(p.value_test); SELF.WriteLn(''); end; lIST.Clear; end; Self.WriteLn(Scan<string>('key_test', 'id = 1')); finally Free; end; end;
TIceConfig,Ice.Common 的 TIceIniFile
原来的 不支持 ini文件注释的读取 也就是ini 文件有注释会导致读取错误,,,
现已重写读取方法 增加记录类型的读取和写入
具体看下面代码
procedure IceFearlessly_test.IniConfig; type TTestRec = record key_1, Value_2: string; int_2: Integer; end; var test: ttestRec; begin with TIceIniFile.Create do try test.key_1:= 'asasasasghah'; test.Value_2:= '嘿嘿'; test.int_2:= 7171; GetSection('default').FromRecord<TTestrec>(test); fillchar(test,SizeOf(TTestRec),#0); test:= GetSection('default').ToRecord<Ttestrec>(); finally Free; end; end;
ice.http 的 IceHttpRequest
新增http单元 目前主要是 client
下面是例子
procedure IceFearlessly_test.http; var F: TFileStream; begin WriteLn(IceHttpRequest('https://zelig.cn').Get.Content()); F:= TFileStream.Create('C:\test.exe',fmCreate or fmOpenWrite); try WriteLn( IceHttpRequest('https://issuepcdn.baidupcs.com/issue/netdisk/yunguanjia/BaiduNetdisk_7.10.2.8.exe').SetReceiveStream(F).Get.StatusText); finally F.Free; end; end;
Ice.Common 的 TIceValues
新增的 主要自己是工作中使用的 暂无例子 嘿嘿!可以自己声明的一个看看咯
也许也是一个你很需要的功能
Ice-Gallery组件包连接
还没有评论,来说两句吧...