> So you’re suggesting something like this:
>
> class AbstactFileSystem {
> …
>   class FileDescriptor {
>   public:
>     virtual ErrorOr<Status> status() = 0;
>     virtual error_code getBuffer(…) = 0;
>     virtual error_code close() = 0;
>   };
> ...
> };

That looks odd. If we can keep it to one virtual interface (like in
the patch) that would probably be better. On llvm a file descriptor in
always an int. There is some desire to use a file handles on windows,
but that is also just a abstract pointer.

Can't we make the file handle an arbitrary uintptr_t sized object? The
FileSystem is then able to interpret it in any way it wants.

Cheers,
Rafael

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to