Is there something in STL that allows me to decompress archives in this format?
If not, what is the absolute easiest library that can?
Thanks!
FlyingIsFun1217
Is there something in STL that allows me to decompress archives in this format?
If not, what is the absolute easiest library that can?
Thanks!
FlyingIsFun1217
those are files, you would have to write a program to decompress them which is a waste of time given there are things like 7-zip which decompresses all those file formats.
The most the stl will give you is ifstream and ofstream and you'd have to figure out the rest yourself.
The standard C++ library does not include any archive utilities. Boost does, or you can use some other library. I don't know of any offhand, try google.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
Boost doesn't have archive utilities either, just compression.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
Erhm, yes, sorry. I haven't actually used it myself, so I don't know about the details. http://www.boost.org/libs/iostreams/doc/index.html
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
I would think boost would be overkill. there's zlib though, which does exactly what you want.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
of course, there's the system() way... but not very good.
But very easy.
or whatever the command is on your system.Code:system("gunzip file.txt.gz");
Using system() is slow, unportable, and sometimes unsecure. But it would let you uncompress a file by executing another program quite easily.
Rather than system(), you could also use some other platform-specific function to execute your compression program: http://faq.cprogramming.com/cgi-bin/...&id=1043284392
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
Wow... too bad you guys didn't post earlier. I've found the 'cure' to be such!
Here's How I set it up:
As you can probably tell though, this gives me errors:Code:system("cd /usr/share/themes"); system("gunzip "<<location4<<""); system("tar xf "<<location4<<"");
Hmm. Whats wrong here? Somebody had to know...error: no match for 'operator<<' in '" gunzip" << location4'
And this is going to be a program specific to Xubuntu, so portability is not an issue.
Thanks again!
FlyingIsFun1217
This is my usage, BTW.Code:string location4; char yes_or_no3; cout<<"Enter the location of your zipped (.tar.gz) theme: "; cin>>location4; cin.ignore(); cout<<"\n\nUnzipping and installing...\n"; system("cd /usr/share/themes"); system("gunzip "<<location4<<""); system("tar xf "<<location4<<""); cout<<"Done! Please use the Theme Selector to apply!"; cout<<"Would you like to delete "<<location4<<"? (Y/N): "; cin>>yes_or_no3; cin.ignore(); if (yes_or_no3 == "Y") { cout<<"Deleting "<<location4<<"...\n"; remove(location4); cout<<"Successfully deleted "<<location4<<"!"; } else { return 1; }
FlyingIsFun1217
Here's an example showing how to load a bitmap from a zip and display it in SDL. Shouldn't be too hard to figure out how to use zlib from this.
http://gpwiki.org/index.php/SDL:Tuto...RWops_and_zlib
Because << doesn't concatenate strings. + does.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law