Reputation: 9
Is there any way to retrieve information from a CArchive
file if we don't know what type of objects are stored in the CArchive
file?
I want to know in what format information is stored in a CArchive
file.
Please help me out in this.
Upvotes: 0
Views: 557
Reputation: 51421
The file format is documented under TN002: Persistent Object Data Format. While that explains how objects are identified in the data stream for deserialization, the actual logic to dump data into the CArchive
and to read it back is at the discretion of the CObject
-derived class implementation for classes that use the DECLARE_SERIAL
and IMPLEMENT_SERIAL
macros.
Without the actual (de-)serialization code there's little you can do with a binary CArchive
stream, unless the implementation that produced it uses the standard serialization methods throughout, allowing you to guess the data types stored.
Unlike JSON or XML, though, a CArchive
's serialized data isn't self-describing. Even when you know the type of any given piece of data, there's nothing in the file that carries any semantic information.
Upvotes: 5