Cross platform file system browser

Has anybody built a cross platform file system browser with juce or know the best way to do it?

What I want is a set of classes that provides a view of the file system similar to when Explorer or the Finder provides. On windows it would have the desktop on the top, and my documents, my computer underneath etc. On the mac, all the volumes and mounted drivers would be at the top, and folders like usr, var, bin etc would be hidden. If the file system object could be represented by a JUCE::File, then one could be returned.

Is there an easier way to do this than coding it from scratch for both the mac and the pc?

My suggestion would be to to wrap the native file dialogs on mac and win, and only do a custom one on linux (unless JUCE builds on some other toolkit?).

Well, I’ve done it (see here), although from the sounds of it, it’s a bit different to what you’re looking for. You could maybe adapt Phil for your needs, but it might be kind of complicated - I didn’t design it particularly well, with the result that a couple of the classes are a bit too inter-connected.

A word of warning if you try and compile it with a recent version of JUCE: I just discovered v1.22(? - the one with the graphics changes, I think it is) broke parts of Phil, so you’ll need an older version. There’ll be an update for it when I release the next version of my linux window manager.

  • Niall.

If you want to be able to manipulate the files and folders like in Explorer or Finder, then you may want to try using the TreeView class, populating each level by using the DirectoryIterator class to get the contents. If you want to display only directories in your tree and have the selected directory’s contents shown in a separate pane (like Explorer), then you could use a ListBox component to do this.

I’m not looking for a component, but rather the classes that are underneath. Something like the cross platform equivalent of a PIDL. I’ll look at Phil for ideas, that’s for the info.