i'm working on qt project includes large data set (70mb+).
the data used library accesses them using data's path.
i know can use resources normally, since in memory objects, can't use them library.
so question is, how can package file or folder available @ installation/runtime access?
the resources available in process's memory, library used within process has access them well. use qresource class find out address , size of resource, , pass library.
if library can't take pointer , size data, insists on file, can use qresource, qtemporaryfile , qfile::copy dump data executable temporary file library has work with.
the library should have 2 ways of accepting data:
in-process data: address + size. e.g.
setdata(void * address, int size);out-of-process data: file path + offset + size.
setdata(const char * filepath, void * offset = 0, int size = -1); // size = -1 uses entire file
this allow library to:
use binary resources available in process's memory, whether come
qresource, or winapi resources, or held in temporary buffers after being downloaded network, etc.use binary resources available in files, including qt , windows resources available @ offset executable file itself.
Comments
Post a Comment