You are not logged in.
Pages: 1
I review mromot code find TJsonToObject record ,but HandleCollection method can't custom add Tcollectionitem
How can I serialize different TCollectionitem that belong to the same Tcollection and are derived from the same parent class?
example:
my subclass :TCollectionitem1 tcollectionitem2 parent class:Tcollectionionitem
Collection Class:TMyCollection
thanks !
Below is my code for your reference
json:
'[{"Key":"Eric","RowData":["Eric",15]}]'
class function TSpiderDataitem.FVClassReader(const aValue: TObject;
aFrom: PUTF8Char; var aValid: boolean;
aOptions: TJSONToObjectOptions): PUTF8Char;
var
V: TSpiderDataItem absolute aValue;
Doc :TDocVariantData;
Values:array[0..10] of TValuePUTF8Char;
begin
result := JSonDeCode(aFrom, ['Key','RowData'], @Values[0],true);
aValid := (result <> nil);
if aValid then
begin
v.Key :=VAlues[0].ToString;
Doc.InitJSON(Values[1].Value);
V.FRowData :=Doc.Values;
(V.Collection as TSpiderDataCollection).parent.AddHash(
v.Key,V
);
end;
end;
class procedure TSpiderDataItem.FVClassWriter(const aSerializer:
TJSONSerializer; aValue: TObject; aOptions: TTextWriterWriteObjectOptions);
var
V: TSpiderDataItem absolute aValue;
Row:TDocVariantData;
begin
Row.InitArrayFromVariants(v.RowData);
aSerializer.AddJSONEscape(['Key',v.Key,'RowData',Variant(Row)]);
end;
I registered a custom reader and writer
code:
aSerializer.AddJSONEscape(['Key',V.Key,'RowData',v.RowData]);
but return array proptery string is null
{"Key":"Eric","RowData":null}
rowdata is variant type dynamic array
I mean restapi provides asynchronous callbacks
Does mormot support asynchronous access?
@Chaa
I only used sample 09 as an example:
static html is bootstrap template
this is mORMot sample 09 result : http://easystda.com:888/root/index.html
this is IIS result : http://easystda.com/
Momort does not support such this
path http://localhost:888/root/assets/the font - awesome / 4.5.0 / fonts/fontawesome - webfont. Woff?V = 4.5.0
BTW: please send to me a mormot code guide , i'd like to try rewrite it to fits mormot standard
my email is wangchong1104@gmail.com
I used lazarus development, in osx raspberry pie and other Linux systems have been successfully tested
https://github.com/Ericwang1104/SuperCSV
this is my git proejct supercsv It can open csv files larger than 20g in size and with support express filter.
Hello ab I have a csv processing unit. it can filter expressions. If you need it, I can provide it join mormot project.
I tried the following code but it ran out of memory
SQL := 'SELECT ID,HTML FROM TenderData ';
Tbl :=FDB.ExecuteList([TTenderData],SQL);
Pages: 1