On the heels of last week’s Delphi XE2 rumor roundup, I’m quite pleased to announce that I’ve been given permission from the nice folks at Embarcadero to blog quite openly about Delphi XE2, which, it turns out, I’ve been using for a little while now :). There’s been quite a bit written about the cross-platform compilers, FireMonkey, writing iOS apps in Delphi, and other amazing things (and believe me, they are amazing), but there are some other really cool things that haven’t been getting much attention, and I’d like to point some of those things out. I admit, it will be hard to write about things like zip files when I’ve got the same Delphi application running on my PC, my Mac, and my iPad, but I’ll try to do them justice. So, without further ado…
There are additional methods for dealing with the compression type, zip file comments, and more.
Here’s a quick example of listing all of the files in a zip file into a TMemo:
ZipFile := TZipFile.Create; //Zipfile: TZipFile try ZipFile.Open('C:\Path\to\file.zip', zmRead); for I := 0 to ZipFile.FileCount - 1 do begin S := ZipFile.FileNames[I]; //S: string Memo1.Lines.Add(S); end; ZipFile.Close; finally ZipFile.Free; end; I’ve often thought about about using zip files as a “project” file in applications where a “project” makes sense as multiple files (for example, if you’re writing a WYSIWYG web page creator, it would make sense that your document would consist of the html text, along with some images, stylesheets, and other related documents). Delphi XE2’s new TZipFile would make is easy to use a zip file as a native file format in your application. Check back here tomorrow for more cool new stuff in Delphi XE2. Delphi XE2 is going to be awesome. Make it even more awesome with Castalia for Delphi, my collection of Delphi IDE enhancements. Try it free today! Want to learn more about Delphi XE2? Visit a free RAD Studio XE2 World Tour Event. |
|