Convert any record to a string and back?

前端 未结 1 853
北海茫月
北海茫月 2020-12-31 15:56

How can I convert any record type to a single String and back? Perhaps load the record into a stream and read it as a String? The records I\'m usin

相关标签:
1条回答
  • 2020-12-31 16:00

    You can serialize your record using the RTTI, from here you can use XML, JSON or other format to persist the record data.

    If you don't want write your own method to serialize the records try these alternatives.

    • superobject (using the TSuperRttiContext class you can serialize a record to JSON)
    • TKBDynamic
    • SynCommons unit from Synopse.
    • XmlSerial unit (Object and Record Serialization and De-serialization to XML) from Robert Love
    0 讨论(0)
提交回复
热议问题