Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Save a big data structure to Disk and load it back .
saeedhardan last edited by
I'm using Qt to develop in c++ , i have a big text file that i read and build a big suffix Tree from its information ,
loading the file and building the tree takes a considerable amount of time ,
My question is how can i save to Disk the suffix tree that i created and when next time i load the program i can just read the tree without having to build it again ?
XML May help you. Try QDomDocument.
andreyc last edited by
Another option is to use "QDataStream":http://qt-project.org/doc/qt-5/qdatastream.html#reading-and-writing-raw-binary-data
It is less portable than XML but may be a bit faster.
For example "QImage uses it":http://code.woboq.org/qt5/qtbase/src/gui/image/qimage.cpp.html#_ZlsR11QDataStreamRK6QImage