I don't agree that writing private members into the header file is already a break of encapsulation only because of one could see it when reading the header file. In fact there is always a way of hacking your app and looking onto what it does.
Slightly out of topic, but I don't recommend of reading header files for gathering infos about to use a class anyway, but I recommend to use documentation generation tools (like e.g. doxygen for linux). I'm sure such stuff also exists for windows. It give nicely formatted HTML output, and is configurable to show only non-private stuff.
If DIR is to be allocated by you (and not by the OS) you could try something like this: In the header file:
class Folder { class _ImplPrivate; _ImplPrivate* _privateData;public: // your interface as usual};
And in the implementation file:
class Folder::_ImplPrivate: public DIR {};
So a reader could see the existance of something spurious, but s/he doesn't know the exact type. Also accessing _privateData is as performant as accessing a DIR* directly. Moreover it may help in compiling for different OS's, since the actual type is defined only in the implementation file. (I use this way e.g. for encapsulting pthread mutexes.)
If you only wants to drop the inclusion of the OS header file containing DIR, you could also do a forwrd declaration and include it only in the implementation file (what does actually not hide the type, of course, but reduces overall compilation time).
Other solutions like the bridge pattern are, of course, not so efficient. Also the simple inheritance use is not so efficient, although I don't think that that invocation of virtual functions will make a measurable difference since we're talking about accessing the file system, something that is not the fastest at all.
For solutions like the bridge pattern and the inheritance you may need some factories (e.g. static methods of the Folder class), but IMHO that is also not really a problem.
EDIT: @Illco "doxygen also for Windows": Good to know :-)