Home » U++ Library support » U++ Core » ...nize class
...nize class [message #36223] |
Mon, 14 May 2012 13:17 |
|
koldo
Messages: 3357 Registered: August 2008
|
Senior Veteran |
|
|
Hello Mirek
Now the syntax of Xmlize and Jsnize is identical. For example:
void SystemOverview::Xmlize(XmlIO &xml) {
xml
("signature", signature)("biosVersion", biosVersion)("biosSerial", biosSerial)
("biosReleaseDate", biosReleaseDate)("computerName", computerName)("kernel", kernel)
("kerVersion", kerVersion)("kerArchitecture", kerArchitecture)("distro", distro)
("distVersion", distVersion)("desktop", desktop)("deskVersion", deskVersion)
("compilerName", compilerName)("compilerVersion", compilerVersion)
("compilerTime", compilerTime)("compilerMode", compilerMode)
;
}
void SystemOverview::Jsonize(JsonIO& json) {
json
("signature", signature)("biosVersion", biosVersion)("biosSerial", biosSerial)
("biosReleaseDate", biosReleaseDate)("computerName", computerName)("kernel", kernel)
("kerVersion", kerVersion)("kerArchitecture", kerArchitecture)("distro", distro)
("distVersion", distVersion)("desktop", desktop)("deskVersion", deskVersion)
("compilerName", compilerName)("compilerVersion", compilerVersion)
("compilerTime", compilerTime)("compilerMode", compilerMode)
;
}
Would it be possible to have a kind of ...nize class to have only one basic implementation per class of the Jsonize and Xmlize methods?
Best regards
Iñaki
|
|
|
|
|
|
Re: ...nize class [message #36242 is a reply to message #36241] |
Wed, 16 May 2012 12:01 |
|
koldo
Messages: 3357 Registered: August 2008
|
Senior Veteran |
|
|
mirek wrote on Wed, 16 May 2012 11:42 | Yes, I had that idea too, but unfortunately, it is not 100% same - Xmlize is capable of Attri(butes).
It would be perhaps possible to provide some simplification, using Jsonize for Xmlize, but not vice-versa.
BTW, there are now JsonizeBySerialize and XmlizeBySerialize. So we are perhaps speaking about XmlizeByJsonize, right?
| Hello Mirek
I agree. However it seems ...izeBySerialize functions serve for jsonizing and xmlizing raw data. In our case the resulting XML or Json String would be the same, but using basically only one ...ize method per class and another method per Json, XML or Serialize.
Best regards
Iñaki
|
|
|
Re: ...nize class [message #36244 is a reply to message #36242] |
Wed, 16 May 2012 12:04 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
koldo wrote on Wed, 16 May 2012 06:01 |
mirek wrote on Wed, 16 May 2012 11:42 | Yes, I had that idea too, but unfortunately, it is not 100% same - Xmlize is capable of Attri(butes).
It would be perhaps possible to provide some simplification, using Jsonize for Xmlize, but not vice-versa.
BTW, there are now JsonizeBySerialize and XmlizeBySerialize. So we are perhaps speaking about XmlizeByJsonize, right?
| Hello Mirek
I agree. However it seems ...izeBySerialize functions serve for jsonizing and xmlizing raw data. In our case the resulting XML or Json String would be the same, but using basically only one ...ize method per class and another method per Json, XML or Serialize.
|
Yep, not totaly same, but quite similar.
Mirek
|
|
|
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Sun Apr 28 04:11:15 CEST 2024
Total time taken to generate the page: 0.02882 seconds
|