0
  1. While pressing the save button, I want to zip dae (COLLADA) files which are in XML format and protect it with a password.
  2. While pressing the open button, I want to (a)unzip these XML files from hard disk to memory, (b)load the XML file from memory, and (c)copy the contents of XML file to a string (char*) (For security reasons, I shouldn't copy the XML file to hard disk and I should use strong methods to add a password).

Questions: Is it possible to achieve these steps? Since my clients may work with big XML files, I need powerful and still fast APIs to handles these stages.

1 Answers1

0

Sure, it is possible, as long as you have enough RAM memory and swap space on the disk.

I would consider using gSOAP Toolkit http://gsoap2.sourceforge.net/ to automatically convert XML to/from C and C++ data.

Pete
  • 42
  • 3
  • What APIs do you suggest to handle these stages? – user3000314 Nov 17 '13 at 11:15
  • I don't want to parse the XML data. It's done by COLLADA DOM. I just need to unzip the ZIP file to memory and load the XML data to a char* buffer and pass it to COLLADA DOM to parse the XML data. What zip tool do you suggest? I have tried to copy XML data from hard disk to a buffer with ifstream. But it's unable to load XML data. Moreover, it seems that C/C++ has not a standard function to read file from memory. – user3000314 Nov 17 '13 at 17:45
  • Regarding unzipping into memory, check this answer http://stackoverflow.com/questions/10781693/how-to-unzip-a-zip-file-already-loaded-in-memory-in-c and maybe this one will help with code snippets http://stackoverflow.com/questions/14913870/read-file-to-memory-loop-through-data-then-write-file – Pete Jan 15 '14 at 22:13