[PATCH] Some infrastructure work for virtual file system (now on phab)
Rafael Espíndola
rafael.espindola at gmail.com
Fri Feb 14 09:26:41 PST 2014
> 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
More information about the cfe-commits
mailing list