Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 3 of 3 total |
TReader/TWriter serialisation name maps |
Tue, Apr 26 2016 7:54 AM | Permanent Link |
Matthew Jones | I have some JSON with names like "qty" and "mkup" to keep things small,
since they are repeated hundreds of times in a JSON object (child arrays). Obviously I would like to have my EWB code use names like "Quantity" and "Markup". Is there anything built in to support this? My ideal would be to have an event that the TPersistent streamer calls to map from one name to another, so it would pass in "Quantity" and get back "qty". And probably vice versa for reading. But it also looks like I could cheat, and use the public properties for nice names, and the published properties for the streaming names. Is that going to be stable if I have two properties referring to the same object? It seems to compile okay. Anyone else done anything like this? private m_szHumanDescription : String; public property HumanDescriptionTXT : String read m_szHumanDescription write m_szHumanDescription; published property Desc : String read m_szHumanDescription write m_szHumanDescription; -- Matthew Jones |
Tue, Apr 26 2016 9:22 AM | Permanent Link |
Matthew Jones | Matthew Jones wrote:
> use the public properties for > nice names, and the published properties for the streaming names This appears to work okay. -- Matthew Jones |
Wed, Apr 27 2016 12:41 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Matthew,
<< But it also looks like I could cheat, and use the public properties for nice names, and the published properties for the streaming names. Is that going to be stable if I have two properties referring to the same object? It seems to compile okay. >> Yes, that will work fine and doesn't result in any additional code overhead. Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Thursday, October 10, 2024 at 02:11 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |