<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Feb 13, 2014 at 2:14 PM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">> There seem to be 2 interfaces here: one user interface, and one for<br>
> subclassing.<br>
><br>
> Are you fine with the interface for subclassing being the current<br>
> Status-based proposal?<br>
<br>
</div>The set of virtual functions currently is<br>
<br>
virtual llvm::error_code status(const llvm::Twine &Path, Status &Result) = 0;<br>
virtual llvm::error_code openFileForRead(const llvm::Twine &Path,<br>
FileDescriptor &ResultFD) = 0;<br>
virtual llvm::error_code getBufferForFile(<br>
const llvm::Twine &Name, llvm::OwningPtr<llvm::MemoryBuffer> &Result,<br>
int64_t FileSize = -1, bool RequiresNullTerminator = true) = 0;<br>
virtual llvm::error_code statusOfOpenFile(FileDescriptor FD, Status &Result);<br>
virtual llvm::error_code<br>
getBufferForOpenFile(FileDescriptor FD, const llvm::Twine &Name,<br>
llvm::OwningPtr<llvm::MemoryBuffer> &Result,<br>
int64_t FileSize = -1,<br>
bool RequiresNullTerminator = true);<br>
<br>
I would probably<br>
* Use ErrorOr, so ErroOr<Status> statusOfOpenFile(...);<br>
* Remove getBufferForFile. It can just be implemented with<br>
getBufferForOpenFile, no?<br>
btw, getBufferForOpenFile is a case where returning error_code is<br>
probably the best we can do right now. ErrorOR<OwningPtr<..> ><br>
effectively requires move semantics.<br>
* Can status be implemented with openFileForRead + statusOfOpenFile? </blockquote><div><br></div><div>In this case, +1 for those ideas...</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I would still be uncomfortable declaring Status abi stable, but this<br>
is a fine small set of apis to have.</blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Cheers,<br>
Rafael<br>
</blockquote></div><br></div></div>