Is there something like a Filestorage class to store files in?
Posted
by nebukadnezzar
on Stack Overflow
See other posts from Stack Overflow
or by nebukadnezzar
Published on 2010-05-30T14:52:54Z
Indexed on
2010/05/30
15:02 UTC
Read the original article
Hit count: 288
c++
Is there something like a class that might be used to store Files and directories in, just like the way Zip files might be used?
Since I haven't found any "real" class to write Zip files (real class as in real class), It would be nice to be able to store Files and Directories in a container-like file.
A perfect API would probably look like this:
int main()
{
ContainerFile cntf("myContainer.cnt", ContainerFile::CREATE);
cntf.addFile("data/some-interesting-stuff.txt");
cntf.addDirectory("data/foo/");
cntf.addDirectory("data/bar/", ContainerFile::RECURSIVE);
cntf.close();
}
... I hope you get the Idea. Important Requirements are:
- The Library must be crossplatform
- anything *GPL is not acceptable in this case (MIT and BSD License are)
I already played with the thought of creating an Implentation based on SQLite (and its ability to store binary blobs). Unfortunately, it seems impossible to store Directory structures in a SQLite Database, which makes it pretty much useless in this case.
Is it useless to hope for such a class library?
© Stack Overflow or respective owner