Opened 8 years ago
Closed 7 years ago
#10854 closed Support Requests (wontfix)
How to add "class_name" tag into the serialized xml archive?
Reported by: | Owned by: | Robert Ramey | |
---|---|---|---|
Milestone: | To Be Determined | Component: | serialization |
Version: | Boost 1.57.0 | Severity: | Not Applicable |
Keywords: | serialization class_name | Cc: |
Description
here's my xml archive created by boost.serialization:
<s class_id="0" tracking_level="1" version="2" object_id="_0">
i need to add a "class_name" tag like this:
<s class_id="0" class_name="bus_schedule" tracking_level="1" version="2" object_id="_0">
please tell me how modify my code, thanks very much!
Attachments (2)
Change History (4)
by , 8 years ago
Attachment: | Serialization.rar added |
---|
by , 8 years ago
Attachment: | demo_save.xml added |
---|
comment:1 by , 8 years ago
comment:2 by , 7 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
I don't see an obvious way to get what you want here.
This would be definitely doable, but you'd have to invest some more effort than you might want to. The short version of ow to do this is to create your own version of xml_oarchive and maybe xml_iarchive. These might be just extensions of the current ones created by derivation:
class my_xml_oarchive : public xml_archive_impl { // overridden functions };
It's not a lot of work to do, but doing so would require pretty good understanding of the implementation of the serialization library. I can't know how much time that would take.
Replying to power_devil@…:
bus_schedule is a user-defined class in serialization.cpp.