add IOBuf::moveToFbString
authorTudor Bosman <tudorb@fb.com>
Mon, 5 Nov 2012 23:35:16 +0000 (15:35 -0800)
committerJordan DeLong <jdelong@fb.com>
Sun, 16 Dec 2012 22:43:21 +0000 (14:43 -0800)
commitaef2fb0936a5e8b8eec583e5b9a4b246d6d1b52e
tree85cb3467df6ff48f312e50e68b68623a3447c72e
parenta8370f0272e565be339e275eb8852ccd602cd1fb
add IOBuf::moveToFbString

Summary:
Convert a IOBuf chain into a fbstring, with zero copies in the common case
(unshared, unchained, no headroom) and one copy in all other cases.

Test Plan: tests added

Reviewed By: simpkins@fb.com

FB internal diff: D621210
folly/experimental/io/IOBuf.cpp
folly/experimental/io/IOBuf.h
folly/experimental/io/test/IOBufTest.cpp