add Cursor::readWhile() and skipWhile()
authorAdam Simpkins <simpkins@fb.com>
Sat, 28 May 2016 00:48:14 +0000 (17:48 -0700)
committerFacebook Github Bot 5 <facebook-github-bot-5-bot@fb.com>
Sat, 28 May 2016 00:53:31 +0000 (17:53 -0700)
commit792e823ba3636730a6a0afad367c16c2faea8ca2
treef7acf3010a7736446cbb6897c568cc753cb13b88
parente9ebf3f43b1cb2034386bfb5daf25db59c781322
add Cursor::readWhile() and skipWhile()

Summary:
Add generic functions for reading or skipping until a predicate check fails.
This will allow us to simplify a few different call sites that have their own
logic similar to this.  Also change readTerminatedString() to use
readWhile().

Reviewed By: alandau

Differential Revision: D3337581

fbshipit-source-id: 9f50914c83adfc882219046862972661bed0e72a
folly/Makefile.am
folly/io/Cursor-inl.h [new file with mode: 0644]
folly/io/Cursor.h
folly/io/test/IOBufCursorTest.cpp