I need to create a special purpose file format which should have an XML "header" and a large chunk of binary data after this header. I would like to use the tinyxml2 library to parse the xml. After that, I shall pull the binary data into a single large array of bytes. The xml header's size is not fixed. The xml header is not going to be very large, and the binary data would be typically around 10-20 MB. I would read-in many files, so efficiency is valuable.
tinyxml2 provides two methods to read from a file LoadFile( const char* filename ) and LoadFile( FILE* ) but these won't work if non-xml binary data is appended after the last element.
There is a concept of CDATA but I am not sure if that is the most efficient way since the binary data would be part of tinyxml2's parsing effort.
What is your advice to formatting this file (i.e. special tags, size-of-header info etc..) and reading the header with tinyxml2? Thank you!