add IOBuf::maybeCopyBuffer()
Summary:
Add a version of IOBuf::copyBuffer() which accepts a std::string, as
well as a maybeCopyBuffer() function which returns a null pointer if the
input string is empty.
In proxygen we have a few places where we construct an IOBuf from a
string configuration parameter, and we almost always want a null pointer
rather than an empty IOBuf chain if the string is empty.
Test Plan: Included unit tests for these new functions.
Reviewed By: tudorb@fb.com
FB internal diff:
D630547