proxygen
folly::io::detail::CursorBase< Derived, BufType > Class Template Reference

#include <Cursor.h>

Public Member Functions

 CursorBase (BufType *buf)
 
template<class OtherDerived , class OtherBuf >
 CursorBase (const CursorBase< OtherDerived, OtherBuf > &cursor)
 
void reset (BufType *buf)
 
size_t getCurrentPosition () const
 
const uint8_tdata () const
 
size_t length () const
 
size_t totalLength () const
 
bool canAdvance (size_t amount) const
 
bool isAtEnd () const
 
void advanceToEnd ()
 
Derivedoperator+= (size_t offset)
 
Derived operator+ (size_t offset) const
 
Derivedoperator-= (size_t offset)
 
Derived operator- (size_t offset) const
 
bool operator== (const Derived &other) const
 
bool operator!= (const Derived &other) const
 
template<class T >
std::enable_if< std::is_arithmetic< T >::value, bool >::type tryRead (T &val)
 
template<class T >
bool tryReadBE (T &val)
 
template<class T >
bool tryReadLE (T &val)
 
template<class T >
T read ()
 
template<class T >
T readBE ()
 
template<class T >
T readLE ()
 
std::string readFixedString (size_t len)
 
std::string readTerminatedString (char termChar= '\0', size_t maxLength=std::numeric_limits< size_t >::max())
 
template<typename Predicate >
std::string readWhile (const Predicate &predicate)
 
template<typename Predicate , typename Output >
void readWhile (const Predicate &predicate, Output &out)
 
template<typename Predicate >
void skipWhile (const Predicate &predicate)
 
size_t skipAtMost (size_t len)
 
void skip (size_t len)
 
void skipNoAdvance (size_t len)
 
size_t retreatAtMost (size_t len)
 
void retreat (size_t len)
 
size_t pullAtMost (void *buf, size_t len)
 
void pull (void *buf, size_t len)
 
ByteRange peekBytes ()
 
std::pair< const uint8_t *, size_t > peek ()
 
void clone (std::unique_ptr< folly::IOBuf > &buf, size_t len)
 
void clone (folly::IOBuf &buf, size_t len)
 
size_t cloneAtMost (folly::IOBuf &buf, size_t len)
 
size_t cloneAtMost (std::unique_ptr< folly::IOBuf > &buf, size_t len)
 
size_t operator- (const CursorBase &other) const
 
size_t operator- (const BufType *buf) const
 

Protected Member Functions

void dcheckIntegrity () const
 
 ~CursorBase ()
 
BufTypehead ()
 
bool tryAdvanceBuffer ()
 
bool tryRetreatBuffer ()
 
void advanceBufferIfEmpty ()
 

Protected Attributes

BufTypecrtBuf_
 
BufTypebuffer_
 
const uint8_tcrtBegin_ {nullptr}
 
const uint8_tcrtEnd_ {nullptr}
 
const uint8_tcrtPos_ {nullptr}
 
size_t absolutePos_ {0}
 

Private Member Functions

template<class T >
FOLLY_NOINLINE T readSlow ()
 
void readFixedStringSlow (std::string *str, size_t len)
 
size_t pullAtMostSlow (void *buf, size_t len)
 
void pullSlow (void *buf, size_t len)
 
size_t skipAtMostSlow (size_t len)
 
void skipSlow (size_t len)
 
size_t retreatAtMostSlow (size_t len)
 
void retreatSlow (size_t len)
 
void advanceDone ()
 

Friends

template<class D , typename B >
class CursorBase
 

Detailed Description

template<class Derived, class BufType>
class folly::io::detail::CursorBase< Derived, BufType >

Definition at line 56 of file Cursor.h.

Constructor & Destructor Documentation

template<class Derived, class BufType>
folly::io::detail::CursorBase< Derived, BufType >::CursorBase ( BufType buf)
inlineexplicit

Definition at line 62 of file Cursor.h.

62  : crtBuf_(buf), buffer_(buf) {
63  if (crtBuf_) {
64  crtPos_ = crtBegin_ = crtBuf_->data();
65  crtEnd_ = crtBuf_->tail();
66  }
67  }
const uint8_t * crtPos_
Definition: Cursor.h:623
const uint8_t * crtEnd_
Definition: Cursor.h:622
const uint8_t * crtBegin_
Definition: Cursor.h:621
template<class Derived, class BufType>
template<class OtherDerived , class OtherBuf >
folly::io::detail::CursorBase< Derived, BufType >::CursorBase ( const CursorBase< OtherDerived, OtherBuf > &  cursor)
inlineexplicit

Copy constructor.

This also allows constructing a CursorBase from other derived types. For instance, this allows constructing a Cursor from an RWPrivateCursor.

Definition at line 76 of file Cursor.h.

77  : crtBuf_(cursor.crtBuf_),
78  buffer_(cursor.buffer_),
79  crtBegin_(cursor.crtBegin_),
80  crtEnd_(cursor.crtEnd_),
81  crtPos_(cursor.crtPos_),
82  absolutePos_(cursor.absolutePos_) {}
const uint8_t * crtPos_
Definition: Cursor.h:623
const uint8_t * crtEnd_
Definition: Cursor.h:622
const uint8_t * crtBegin_
Definition: Cursor.h:621
template<class Derived, class BufType>
folly::io::detail::CursorBase< Derived, BufType >::~CursorBase ( )
inlineprotected

Definition at line 578 of file Cursor.h.

578 {}

Member Function Documentation

template<class Derived, class BufType>
void folly::io::detail::CursorBase< Derived, BufType >::advanceToEnd ( )
inline

Advances the cursor to the end of the entire IOBuf chain.

Definition at line 185 of file Cursor.h.

Referenced by fizz::EncryptedReadRecordLayer::read(), and TEST().

185  {
186  // Simple case, we're already in the last IOBuf.
187  if (crtBuf_ == buffer_->prev()) {
188  crtPos_ = crtEnd_;
189  return;
190  }
191 
192  auto* nextBuf = crtBuf_->next();
193  while (nextBuf != buffer_) {
195 
196  crtBuf_ = nextBuf;
197  nextBuf = crtBuf_->next();
198  crtBegin_ = crtBuf_->data();
199  crtPos_ = crtEnd_ = crtBuf_->tail();
200 
201  static_cast<Derived*>(this)->advanceDone();
202  }
203  }
const uint8_t * crtPos_
Definition: Cursor.h:623
const uint8_t * crtEnd_
Definition: Cursor.h:622
const uint8_t * crtBegin_
Definition: Cursor.h:621
template<class Derived, class BufType>
bool folly::io::detail::CursorBase< Derived, BufType >::canAdvance ( size_t  amount) const
inline

Return true if the cursor could advance the specified number of bytes from its current position. This is useful for applications that want to do checked reads instead of catching exceptions and is more efficient than using totalLength as it walks the minimal set of buffers in the chain to determine the result.

Definition at line 142 of file Cursor.h.

142  {
143  const IOBuf* nextBuf = crtBuf_;
144  size_t available = length();
145  do {
146  if (available >= amount) {
147  return true;
148  }
149  amount -= available;
150  nextBuf = nextBuf->next();
151  available = nextBuf->length();
152  } while (nextBuf != buffer_);
153  return false;
154  }
size_t length() const
Definition: Cursor.h:118
template<class Derived, class BufType>
void folly::io::detail::CursorBase< Derived, BufType >::clone ( std::unique_ptr< folly::IOBuf > &  buf,
size_t  len 
)
inline

Definition at line 456 of file Cursor.h.

Referenced by proxygen::HTTP2Codec::parseDataFrameData(), proxygen::SPDYCodec::parseIngress(), and fizz::detail::readBuf().

456  {
457  if (UNLIKELY(cloneAtMost(buf, len) != len)) {
458  throw_exception<std::out_of_range>("underflow");
459  }
460  }
#define UNLIKELY(x)
Definition: Likely.h:48
size_t cloneAtMost(folly::IOBuf &buf, size_t len)
Definition: Cursor.h:468
template<class Derived, class BufType>
void folly::io::detail::CursorBase< Derived, BufType >::clone ( folly::IOBuf buf,
size_t  len 
)
inline

Definition at line 462 of file Cursor.h.

462  {
463  if (UNLIKELY(cloneAtMost(buf, len) != len)) {
464  throw_exception<std::out_of_range>("underflow");
465  }
466  }
#define UNLIKELY(x)
Definition: Likely.h:48
size_t cloneAtMost(folly::IOBuf &buf, size_t len)
Definition: Cursor.h:468
template<class Derived, class BufType>
size_t folly::io::detail::CursorBase< Derived, BufType >::cloneAtMost ( folly::IOBuf buf,
size_t  len 
)
inline

Definition at line 468 of file Cursor.h.

Referenced by folly::io::detail::CursorBase< Cursor, const IOBuf >::clone(), and folly::io::detail::CursorBase< Cursor, const IOBuf >::cloneAtMost().

468  {
469  // We might be at the end of buffer.
471 
472  std::unique_ptr<folly::IOBuf> tmp;
473  size_t copied = 0;
474  for (int loopCount = 0; true; ++loopCount) {
475  // Fast path: it all fits in one buffer.
476  size_t available = length();
477  if (LIKELY(available >= len)) {
478  if (loopCount == 0) {
479  crtBuf_->cloneOneInto(buf);
480  buf.trimStart(crtPos_ - crtBegin_);
481  buf.trimEnd(buf.length() - len);
482  } else {
483  tmp = crtBuf_->cloneOne();
484  tmp->trimStart(crtPos_ - crtBegin_);
485  tmp->trimEnd(tmp->length() - len);
486  buf.prependChain(std::move(tmp));
487  }
488 
489  crtPos_ += len;
491  return copied + len;
492  }
493 
494  if (loopCount == 0) {
495  crtBuf_->cloneOneInto(buf);
496  buf.trimStart(crtPos_ - crtBegin_);
497  } else {
498  tmp = crtBuf_->cloneOne();
499  tmp->trimStart(crtPos_ - crtBegin_);
500  buf.prependChain(std::move(tmp));
501  }
502 
503  copied += available;
504  if (UNLIKELY(!tryAdvanceBuffer())) {
505  return copied;
506  }
507  len -= available;
508  }
509  }
const uint8_t * crtPos_
Definition: Cursor.h:623
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
#define LIKELY(x)
Definition: Likely.h:47
std::size_t length() const
Definition: IOBuf.h:533
const uint8_t * crtBegin_
Definition: Cursor.h:621
size_t length() const
Definition: Cursor.h:118
void prependChain(std::unique_ptr< IOBuf > &&iobuf)
Definition: IOBuf.cpp:509
void trimStart(std::size_t amount)
Definition: IOBuf.h:703
#define UNLIKELY(x)
Definition: Likely.h:48
void trimEnd(std::size_t amount)
Definition: IOBuf.h:718
template<class Derived, class BufType>
size_t folly::io::detail::CursorBase< Derived, BufType >::cloneAtMost ( std::unique_ptr< folly::IOBuf > &  buf,
size_t  len 
)
inline

Definition at line 511 of file Cursor.h.

511  {
512  if (!buf) {
513  buf = std::make_unique<folly::IOBuf>();
514  }
515  return cloneAtMost(*buf, len);
516  }
size_t cloneAtMost(folly::IOBuf &buf, size_t len)
Definition: Cursor.h:468
template<class Derived, class BufType>
void folly::io::detail::CursorBase< Derived, BufType >::dcheckIntegrity ( ) const
inlineprotected

Definition at line 570 of file Cursor.h.

Referenced by folly::io::detail::CursorBase< Cursor, const IOBuf >::advanceBufferIfEmpty(), folly::io::detail::CursorBase< Cursor, const IOBuf >::data(), folly::io::RWCursor< access >::gatherAtMost(), folly::io::detail::CursorBase< Cursor, const IOBuf >::getCurrentPosition(), folly::io::RWCursor< access >::insert(), folly::io::detail::CursorBase< Cursor, const IOBuf >::isAtEnd(), folly::io::detail::CursorBase< Cursor, const IOBuf >::length(), folly::io::detail::CursorBase< Cursor, const IOBuf >::pull(), folly::io::detail::CursorBase< Cursor, const IOBuf >::pullAtMost(), folly::io::detail::CursorBase< Cursor, const IOBuf >::retreat(), folly::io::detail::CursorBase< Cursor, const IOBuf >::retreatAtMost(), folly::io::detail::CursorBase< Cursor, const IOBuf >::skip(), folly::io::detail::CursorBase< Cursor, const IOBuf >::skipAtMost(), and folly::io::RWCursor< access >::writableData().

570  {
571  DCHECK(crtBegin_ <= crtPos_ && crtPos_ <= crtEnd_);
572  DCHECK(crtBuf_ == nullptr || crtBegin_ == crtBuf_->data());
573  DCHECK(
574  crtBuf_ == nullptr ||
575  (std::size_t)(crtEnd_ - crtBegin_) == crtBuf_->length());
576  }
const uint8_t * crtPos_
Definition: Cursor.h:623
const uint8_t * crtEnd_
Definition: Cursor.h:622
const uint8_t * crtBegin_
Definition: Cursor.h:621
template<class Derived, class BufType>
size_t folly::io::detail::CursorBase< Derived, BufType >::getCurrentPosition ( ) const
inline

Get the current Cursor position relative to the head of IOBuf chain.

Definition at line 100 of file Cursor.h.

100  {
101  dcheckIntegrity();
102  return (crtPos_ - crtBegin_) + absolutePos_;
103  }
const uint8_t * crtPos_
Definition: Cursor.h:623
const uint8_t * crtBegin_
Definition: Cursor.h:621
void dcheckIntegrity() const
Definition: Cursor.h:570
template<class Derived, class BufType>
BufType* folly::io::detail::CursorBase< Derived, BufType >::head ( )
inlineprotected

Definition at line 580 of file Cursor.h.

Referenced by folly::io::RWCursor< access >::gather().

580  {
581  return buffer_;
582  }
template<class Derived, class BufType>
bool folly::io::detail::CursorBase< Derived, BufType >::isAtEnd ( ) const
inline

Definition at line 159 of file Cursor.h.

Referenced by fizz::decode(), and fizz::transformBufferBlocks().

159  {
160  dcheckIntegrity();
161  // Check for the simple cases first.
162  if (crtPos_ != crtEnd_) {
163  return false;
164  }
165  if (crtBuf_ == buffer_->prev()) {
166  return true;
167  }
168  // We are at the end of a buffer, but it isn't the last buffer.
169  // We might still be at the end if the remaining buffers in the chain are
170  // empty.
171  const IOBuf* buf = crtBuf_->next();
172  ;
173  while (buf != buffer_) {
174  if (buf->length() > 0) {
175  return false;
176  }
177  buf = buf->next();
178  }
179  return true;
180  }
const uint8_t * crtPos_
Definition: Cursor.h:623
const uint8_t * crtEnd_
Definition: Cursor.h:622
void dcheckIntegrity() const
Definition: Cursor.h:570
template<class Derived, class BufType>
size_t folly::io::detail::CursorBase< Derived, BufType >::length ( ) const
inline

Return the remaining space available in the current IOBuf.

May return 0 if the cursor is at the end of an IOBuf. Use peekBytes() instead if you want to avoid this. peekBytes() will advance to the next non-empty IOBuf (up to the end of the chain) if the cursor is currently pointing at the end of a buffer.

Definition at line 118 of file Cursor.h.

Referenced by folly::io::detail::CursorBase< Cursor, const IOBuf >::canAdvance(), folly::io::detail::CursorBase< Cursor, const IOBuf >::cloneAtMost(), proxygen::HPACKDecodeBuffer::decodeLiteral(), folly::io::Appender::ensure(), folly::io::QueueAppender::ensure(), folly::io::RWCursor< access >::insert(), proxygen::HPACKDecodeBuffer::peek(), folly::io::detail::CursorBase< Cursor, const IOBuf >::peekBytes(), folly::io::detail::CursorBase< Cursor, const IOBuf >::pullAtMostSlow(), folly::io::RWCursor< access >::pushAtMost(), folly::io::Appender::pushAtMost(), folly::io::QueueAppender::pushAtMost(), folly::io::detail::CursorBase< Cursor, const IOBuf >::readFixedString(), folly::io::detail::CursorBase< Cursor, const IOBuf >::readFixedStringSlow(), folly::io::detail::CursorBase< Cursor, const IOBuf >::skipAtMostSlow(), folly::io::detail::CursorBase< Cursor, const IOBuf >::skipNoAdvance(), folly::bser::throwDecodeError(), and folly::io::QueueAppender::write().

118  {
119  dcheckIntegrity();
120  return crtEnd_ - crtPos_;
121  }
const uint8_t * crtPos_
Definition: Cursor.h:623
const uint8_t * crtEnd_
Definition: Cursor.h:622
void dcheckIntegrity() const
Definition: Cursor.h:570
template<class Derived, class BufType>
bool folly::io::detail::CursorBase< Derived, BufType >::operator!= ( const Derived other) const
inline

Definition at line 252 of file Cursor.h.

252  {
253  return !operator==(other);
254  }
bool operator==(const Derived &other) const
Definition: Cursor.h:233
template<class Derived, class BufType>
Derived folly::io::detail::CursorBase< Derived, BufType >::operator+ ( size_t  offset) const
inline

Definition at line 210 of file Cursor.h.

210  {
211  Derived other(*this);
212  other.skip(offset);
213  return other;
214  }
template<class Derived, class BufType>
Derived& folly::io::detail::CursorBase< Derived, BufType >::operator+= ( size_t  offset)
inline

Definition at line 205 of file Cursor.h.

205  {
206  Derived* p = static_cast<Derived*>(this);
207  p->skip(offset);
208  return *p;
209  }
template<class Derived, class BufType>
Derived folly::io::detail::CursorBase< Derived, BufType >::operator- ( size_t  offset) const
inline

Definition at line 221 of file Cursor.h.

221  {
222  Derived other(*this);
223  other.retreat(offset);
224  return other;
225  }
template<class Derived, class BufType>
size_t folly::io::detail::CursorBase< Derived, BufType >::operator- ( const CursorBase< Derived, BufType > &  other) const
inline

Return the distance between two cursors.

Definition at line 521 of file Cursor.h.

521  {
522  BufType* otherBuf = other.crtBuf_;
523  size_t len = 0;
524 
525  if (otherBuf != crtBuf_) {
526  len += other.crtEnd_ - other.crtPos_;
527 
528  for (otherBuf = otherBuf->next();
529  otherBuf != crtBuf_ && otherBuf != other.buffer_;
530  otherBuf = otherBuf->next()) {
531  len += otherBuf->length();
532  }
533 
534  if (otherBuf == other.buffer_) {
535  throw_exception<std::out_of_range>("wrap-around");
536  }
537 
538  len += crtPos_ - crtBegin_;
539  } else {
540  if (crtPos_ < other.crtPos_) {
541  throw_exception<std::out_of_range>("underflow");
542  }
543 
544  len += crtPos_ - other.crtPos_;
545  }
546 
547  return len;
548  }
const uint8_t * crtPos_
Definition: Cursor.h:623
const uint8_t * crtBegin_
Definition: Cursor.h:621
BufType
Definition: IOBufTest.cpp:844
template<class Derived, class BufType>
size_t folly::io::detail::CursorBase< Derived, BufType >::operator- ( const BufType buf) const
inline

Return the distance from the given IOBuf to the this cursor.

Definition at line 553 of file Cursor.h.

553  {
554  size_t len = 0;
555 
556  const BufType* curBuf = buf;
557  while (curBuf != crtBuf_) {
558  len += curBuf->length();
559  curBuf = curBuf->next();
560  if (curBuf == buf || curBuf == buffer_) {
561  throw_exception<std::out_of_range>("wrap-around");
562  }
563  }
564 
565  len += crtPos_ - crtBegin_;
566  return len;
567  }
const uint8_t * crtPos_
Definition: Cursor.h:623
const uint8_t * crtBegin_
Definition: Cursor.h:621
BufType
Definition: IOBufTest.cpp:844
template<class Derived, class BufType>
Derived& folly::io::detail::CursorBase< Derived, BufType >::operator-= ( size_t  offset)
inline

Definition at line 216 of file Cursor.h.

216  {
217  Derived* p = static_cast<Derived*>(this);
218  p->retreat(offset);
219  return *p;
220  }
template<class Derived, class BufType>
bool folly::io::detail::CursorBase< Derived, BufType >::operator== ( const Derived other) const
inline

Compare cursors for equality/inequality.

Two cursors are equal if they are pointing to the same location in the same IOBuf chain.

Definition at line 233 of file Cursor.h.

Referenced by folly::io::detail::CursorBase< Cursor, const IOBuf >::operator!=().

233  {
234  const IOBuf* crtBuf = crtBuf_;
235  auto crtPos = crtPos_;
236  // We can be pointing to the end of a buffer chunk, find first non-empty.
237  while (crtPos == crtBuf->tail() && crtBuf != buffer_->prev()) {
238  crtBuf = crtBuf->next();
239  crtPos = crtBuf->data();
240  }
241 
242  const IOBuf* crtBufOther = other.crtBuf_;
243  auto crtPosOther = other.crtPos_;
244  // We can be pointing to the end of a buffer chunk, find first non-empty.
245  while (crtPosOther == crtBufOther->tail() &&
246  crtBufOther != other.buffer_->prev()) {
247  crtBufOther = crtBufOther->next();
248  crtPosOther = crtBufOther->data();
249  }
250  return (crtPos == crtPosOther) && (crtBuf == crtBufOther);
251  }
const uint8_t * crtPos_
Definition: Cursor.h:623
template<class Derived, class BufType>
std::pair<const uint8_t*, size_t> folly::io::detail::CursorBase< Derived, BufType >::peek ( )
inline

Alternate version of peekBytes() that returns a std::pair instead of a ByteRange. (This method pre-dates ByteRange.)

This function will eventually be deprecated.

Definition at line 451 of file Cursor.h.

Referenced by proxygen::SPDYCodec::parseIngress(), proxygen::GzipHeaderCodec::parseNameValues(), and proxygen::HPACKDecodeBuffer::peek().

451  {
452  auto bytes = peekBytes();
453  return std::make_pair(bytes.data(), bytes.size());
454  }
template<class Derived, class BufType>
ByteRange folly::io::detail::CursorBase< Derived, BufType >::peekBytes ( )
inline

Return the available data in the current buffer. If you want to gather more data from the chain into a contiguous region (for hopefully zero-copy access), use gather() before peekBytes().

Definition at line 436 of file Cursor.h.

Referenced by folly::bser::decodeHeader(), folly::bser::decodeTemplate(), folly::io::StreamCodec::doUncompress(), folly::IOBufCompare::impl(), folly::IOBufHash::operator()(), folly::io::detail::CursorBase< Cursor, const IOBuf >::peek(), folly::Subprocess::pid(), folly::io::detail::Writable< Appender >::pushAtMost(), TEST(), and fizz::transformBufferBlocks().

436  {
437  // Ensure that we're pointing to valid data
438  size_t available = length();
439  while (UNLIKELY(available == 0 && tryAdvanceBuffer())) {
440  available = length();
441  }
442  return ByteRange{data(), available};
443  }
const uint8_t * data() const
Definition: Cursor.h:105
size_t length() const
Definition: Cursor.h:118
Range< const unsigned char * > ByteRange
Definition: Range.h:1163
#define UNLIKELY(x)
Definition: Likely.h:48
template<class Derived, class BufType>
void folly::io::detail::CursorBase< Derived, BufType >::pull ( void *  buf,
size_t  len 
)
inline

Definition at line 418 of file Cursor.h.

Referenced by folly::bser::decodeHeader(), proxygen::HPACKDecodeBuffer::decodeLiteral(), fizz::EncryptedReadRecordLayer::getDecryptedBuf(), folly::bser::parseBser(), proxygen::GzipHeaderCodec::parseNameValues(), fizz::detail::Reader< Random >::read(), and fizz::detail::readBits24().

418  {
419  if (UNLIKELY(len == 0)) {
420  return;
421  }
422  dcheckIntegrity();
423  if (LIKELY(crtPos_ + len <= crtEnd_)) {
424  memcpy(buf, data(), len);
425  crtPos_ += len;
426  } else {
427  pullSlow(buf, len);
428  }
429  }
const uint8_t * crtPos_
Definition: Cursor.h:623
const uint8_t * data() const
Definition: Cursor.h:105
const uint8_t * crtEnd_
Definition: Cursor.h:622
#define LIKELY(x)
Definition: Likely.h:47
void dcheckIntegrity() const
Definition: Cursor.h:570
#define UNLIKELY(x)
Definition: Likely.h:48
void pullSlow(void *buf, size_t len)
Definition: Cursor.h:671
template<class Derived, class BufType>
size_t folly::io::detail::CursorBase< Derived, BufType >::pullAtMost ( void *  buf,
size_t  len 
)
inline

Definition at line 407 of file Cursor.h.

Referenced by folly::AsyncSSLSocket::bioRead(), folly::bser::decodeString(), folly::AsyncSocket::performRead(), and prefixBaseline().

407  {
408  dcheckIntegrity();
409  // Fast path: it all fits in one buffer.
410  if (LIKELY(crtPos_ + len <= crtEnd_)) {
411  memcpy(buf, data(), len);
412  crtPos_ += len;
413  return len;
414  }
415  return pullAtMostSlow(buf, len);
416  }
const uint8_t * crtPos_
Definition: Cursor.h:623
const uint8_t * data() const
Definition: Cursor.h:105
size_t pullAtMostSlow(void *buf, size_t len)
Definition: Cursor.h:647
const uint8_t * crtEnd_
Definition: Cursor.h:622
#define LIKELY(x)
Definition: Likely.h:47
void dcheckIntegrity() const
Definition: Cursor.h:570
template<class Derived, class BufType>
size_t folly::io::detail::CursorBase< Derived, BufType >::pullAtMostSlow ( void *  buf,
size_t  len 
)
inlineprivate

Definition at line 647 of file Cursor.h.

Referenced by folly::io::detail::CursorBase< Cursor, const IOBuf >::pullAtMost(), folly::io::detail::CursorBase< Cursor, const IOBuf >::pullSlow(), and folly::io::detail::CursorBase< Cursor, const IOBuf >::tryRead().

647  {
648  // If the length of this buffer is 0 try advancing it.
649  // Otherwise on the first iteration of the following loop memcpy is called
650  // with a null source pointer.
651  if (UNLIKELY(length() == 0 && !tryAdvanceBuffer())) {
652  return 0;
653  }
654  uint8_t* p = reinterpret_cast<uint8_t*>(buf);
655  size_t copied = 0;
656  for (size_t available; (available = length()) < len;) {
657  memcpy(p, data(), available);
658  copied += available;
659  if (UNLIKELY(!tryAdvanceBuffer())) {
660  return copied;
661  }
662  p += available;
663  len -= available;
664  }
665  memcpy(p, data(), len);
666  crtPos_ += len;
668  return copied + len;
669  }
const uint8_t * crtPos_
Definition: Cursor.h:623
const uint8_t * data() const
Definition: Cursor.h:105
size_t length() const
Definition: Cursor.h:118
#define UNLIKELY(x)
Definition: Likely.h:48
template<class Derived, class BufType>
void folly::io::detail::CursorBase< Derived, BufType >::pullSlow ( void *  buf,
size_t  len 
)
inlineprivate

Definition at line 671 of file Cursor.h.

Referenced by folly::io::detail::CursorBase< Cursor, const IOBuf >::pull(), and folly::io::detail::CursorBase< Cursor, const IOBuf >::readSlow().

671  {
672  if (UNLIKELY(pullAtMostSlow(buf, len) != len)) {
673  throw_exception<std::out_of_range>("underflow");
674  }
675  }
size_t pullAtMostSlow(void *buf, size_t len)
Definition: Cursor.h:647
#define UNLIKELY(x)
Definition: Likely.h:48
template<class Derived, class BufType>
template<class T >
T folly::io::detail::CursorBase< Derived, BufType >::read ( )
inline

Definition at line 282 of file Cursor.h.

Referenced by folly::bser::decodeInt(), folly::bser::decodeObject(), folly::bser::decodeTemplate(), folly::io::StreamCodec::doUncompress(), proxygen::SPDYCodec::onControlFrame(), folly::bser::parseBser(), proxygen::RFC1867Codec::readToBoundary(), TEST(), and TEST_F().

282  {
283  if (LIKELY(crtPos_ + sizeof(T) <= crtEnd_)) {
284  T val = loadUnaligned<T>(data());
285  crtPos_ += sizeof(T);
286  return val;
287  } else {
288  return readSlow<T>();
289  }
290  }
const uint8_t * crtPos_
Definition: Cursor.h:623
const uint8_t * data() const
Definition: Cursor.h:105
const uint8_t * crtEnd_
Definition: Cursor.h:622
#define LIKELY(x)
Definition: Likely.h:47
double val
Definition: String.cpp:273
folly::std T
template<class Derived, class BufType>
std::string folly::io::detail::CursorBase< Derived, BufType >::readFixedString ( size_t  len)
inline

Read a fixed-length string.

The std::string-based APIs should probably be avoided unless you ultimately want the data to live in an std::string. You're better off using the pull() APIs to copy into a raw buffer otherwise.

Definition at line 309 of file Cursor.h.

Referenced by proxygen::HTTP2Codec::onIngress().

309  {
310  std::string str;
311  str.reserve(len);
312  if (LIKELY(length() >= len)) {
313  str.append(reinterpret_cast<const char*>(data()), len);
314  crtPos_ += len;
315  } else {
316  readFixedStringSlow(&str, len);
317  }
318  return str;
319  }
const uint8_t * crtPos_
Definition: Cursor.h:623
const uint8_t * data() const
Definition: Cursor.h:105
#define LIKELY(x)
Definition: Likely.h:47
size_t length() const
Definition: Cursor.h:118
void readFixedStringSlow(std::string *str, size_t len)
Definition: Cursor.h:634
const char * string
Definition: Conv.cpp:212
template<class Derived, class BufType>
void folly::io::detail::CursorBase< Derived, BufType >::readFixedStringSlow ( std::string str,
size_t  len 
)
inlineprivate

Definition at line 634 of file Cursor.h.

Referenced by folly::io::detail::CursorBase< Cursor, const IOBuf >::readFixedString().

634  {
635  for (size_t available; (available = length()) < len;) {
636  str->append(reinterpret_cast<const char*>(data()), available);
637  if (UNLIKELY(!tryAdvanceBuffer())) {
638  throw_exception<std::out_of_range>("string underflow");
639  }
640  len -= available;
641  }
642  str->append(reinterpret_cast<const char*>(data()), len);
643  crtPos_ += len;
645  }
const uint8_t * crtPos_
Definition: Cursor.h:623
const uint8_t * data() const
Definition: Cursor.h:105
size_t length() const
Definition: Cursor.h:118
#define UNLIKELY(x)
Definition: Likely.h:48
template<class Derived, class BufType>
template<class T >
T folly::io::detail::CursorBase< Derived, BufType >::readLE ( )
inline

Definition at line 298 of file Cursor.h.

Referenced by proxygen::SPDYCodec::onControlFrame().

298  {
299  return Endian::little(read<T>());
300  }
static T little(T x)
Definition: Bits.h:263
template<class Derived, class BufType>
template<class T >
FOLLY_NOINLINE T folly::io::detail::CursorBase< Derived, BufType >::readSlow ( )
inlineprivate

Definition at line 628 of file Cursor.h.

628  {
629  T val;
630  pullSlow(&val, sizeof(T));
631  return val;
632  }
double val
Definition: String.cpp:273
folly::std T
void pullSlow(void *buf, size_t len)
Definition: Cursor.h:671
template<class Derived , class BufType >
std::string folly::io::detail::CursorBase< Derived, BufType >::readTerminatedString ( char  termChar = '\0',
size_t  maxLength = std::numeric_limits<size_t>::max() 
)

Read a string consisting of bytes until the given terminator character is seen. Raises an std::length_error if maxLength bytes have been processed before the terminator is seen.

See comments in readFixedString() about when it's appropriate to use this vs. using pull().

Definition at line 45 of file Cursor-inl.h.

References folly::gen::skip(), and uint8_t.

Referenced by folly::io::detail::CursorBase< Cursor, const IOBuf >::readFixedString().

47  {
48  size_t bytesRead{0};
49  auto keepReading = [&bytesRead, termChar, maxLength](uint8_t byte) {
50  if (byte == termChar) {
51  return false;
52  }
53  ++bytesRead;
54  if (bytesRead >= maxLength) {
55  throw std::length_error("string overflow");
56  }
57  return true;
58  };
59 
60  auto result = readWhile(keepReading);
61  // skip over the terminator character
62  if (isAtEnd()) {
63  throw_exception<std::out_of_range>("terminator not found");
64  }
65  skip(1);
66 
67  return result;
68 }
std::string readWhile(const Predicate &predicate)
Definition: Cursor-inl.h:72
void skip(size_t len)
Definition: Cursor.h:371
template<class Derived , class BufType >
template<typename Predicate >
std::string folly::io::detail::CursorBase< Derived, BufType >::readWhile ( const Predicate &  predicate)

Definition at line 72 of file Cursor-inl.h.

References folly::io::detail::CursorStringAppender::extractString(), and s.

Referenced by folly::io::detail::CursorBase< Cursor, const IOBuf >::readFixedString().

73  {
74  CursorStringAppender s;
75  readWhile(predicate, s);
76  return s.extractString();
77 }
std::string readWhile(const Predicate &predicate)
Definition: Cursor-inl.h:72
static set< string > s
template<class Derived , class BufType >
template<typename Predicate , typename Output >
void folly::io::detail::CursorBase< Derived, BufType >::readWhile ( const Predicate &  predicate,
Output &  out 
)

Definition at line 81 of file Cursor-inl.h.

References folly::gen::skip().

83  {
84  while (true) {
85  auto peeked = peekBytes();
86  if (peeked.empty()) {
87  return;
88  }
89  for (size_t idx = 0; idx < peeked.size(); ++idx) {
90  if (!predicate(peeked[idx])) {
91  peeked.reset(peeked.data(), idx);
92  out.append(peeked);
93  skip(idx);
94  return;
95  }
96  }
97  out.append(peeked);
98  skip(peeked.size());
99  }
100 }
void skip(size_t len)
Definition: Cursor.h:371
template<class Derived, class BufType>
void folly::io::detail::CursorBase< Derived, BufType >::reset ( BufType buf)
inline

Reset cursor to point to a new buffer.

Definition at line 87 of file Cursor.h.

87  {
88  crtBuf_ = buf;
89  buffer_ = buf;
90  absolutePos_ = 0;
91  if (crtBuf_) {
92  crtPos_ = crtBegin_ = crtBuf_->data();
93  crtEnd_ = crtBuf_->tail();
94  }
95  }
const uint8_t * crtPos_
Definition: Cursor.h:623
const uint8_t * crtEnd_
Definition: Cursor.h:622
const uint8_t * crtBegin_
Definition: Cursor.h:621
template<class Derived, class BufType>
void folly::io::detail::CursorBase< Derived, BufType >::retreat ( size_t  len)
inline

Definition at line 398 of file Cursor.h.

Referenced by folly::io::detail::CursorBase< Cursor, const IOBuf >::operator-=().

398  {
399  dcheckIntegrity();
400  if (len <= static_cast<size_t>(crtPos_ - crtBegin_)) {
401  crtPos_ -= len;
402  } else {
403  retreatSlow(len);
404  }
405  }
const uint8_t * crtPos_
Definition: Cursor.h:623
void retreatSlow(size_t len)
Definition: Cursor.h:710
const uint8_t * crtBegin_
Definition: Cursor.h:621
void dcheckIntegrity() const
Definition: Cursor.h:570
template<class Derived, class BufType>
size_t folly::io::detail::CursorBase< Derived, BufType >::retreatAtMost ( size_t  len)
inline

Definition at line 389 of file Cursor.h.

389  {
390  dcheckIntegrity();
391  if (len <= static_cast<size_t>(crtPos_ - crtBegin_)) {
392  crtPos_ -= len;
393  return len;
394  }
395  return retreatAtMostSlow(len);
396  }
const uint8_t * crtPos_
Definition: Cursor.h:623
const uint8_t * crtBegin_
Definition: Cursor.h:621
size_t retreatAtMostSlow(size_t len)
Definition: Cursor.h:697
void dcheckIntegrity() const
Definition: Cursor.h:570
template<class Derived, class BufType>
size_t folly::io::detail::CursorBase< Derived, BufType >::retreatAtMostSlow ( size_t  len)
inlineprivate

Definition at line 697 of file Cursor.h.

Referenced by folly::io::detail::CursorBase< Cursor, const IOBuf >::retreatAtMost(), and folly::io::detail::CursorBase< Cursor, const IOBuf >::retreatSlow().

697  {
698  size_t retreated = 0;
699  for (size_t available; (available = crtPos_ - crtBegin_) < len;) {
700  retreated += available;
701  if (UNLIKELY(!tryRetreatBuffer())) {
702  return retreated;
703  }
704  len -= available;
705  }
706  crtPos_ -= len;
707  return retreated + len;
708  }
const uint8_t * crtPos_
Definition: Cursor.h:623
const uint8_t * crtBegin_
Definition: Cursor.h:621
#define UNLIKELY(x)
Definition: Likely.h:48
template<class Derived, class BufType>
void folly::io::detail::CursorBase< Derived, BufType >::retreatSlow ( size_t  len)
inlineprivate

Definition at line 710 of file Cursor.h.

Referenced by folly::io::detail::CursorBase< Cursor, const IOBuf >::retreat().

710  {
711  if (UNLIKELY(retreatAtMostSlow(len) != len)) {
712  throw_exception<std::out_of_range>("underflow");
713  }
714  }
size_t retreatAtMostSlow(size_t len)
Definition: Cursor.h:697
#define UNLIKELY(x)
Definition: Likely.h:48
template<class Derived, class BufType>
size_t folly::io::detail::CursorBase< Derived, BufType >::skipAtMost ( size_t  len)
inline

Definition at line 362 of file Cursor.h.

Referenced by folly::bser::decodeTemplate().

362  {
363  dcheckIntegrity();
364  if (LIKELY(crtPos_ + len < crtEnd_)) {
365  crtPos_ += len;
366  return len;
367  }
368  return skipAtMostSlow(len);
369  }
const uint8_t * crtPos_
Definition: Cursor.h:623
const uint8_t * crtEnd_
Definition: Cursor.h:622
#define LIKELY(x)
Definition: Likely.h:47
size_t skipAtMostSlow(size_t len)
Definition: Cursor.h:677
void dcheckIntegrity() const
Definition: Cursor.h:570
template<class Derived, class BufType>
size_t folly::io::detail::CursorBase< Derived, BufType >::skipAtMostSlow ( size_t  len)
inlineprivate

Definition at line 677 of file Cursor.h.

Referenced by folly::io::detail::CursorBase< Cursor, const IOBuf >::skipAtMost(), and folly::io::detail::CursorBase< Cursor, const IOBuf >::skipSlow().

677  {
678  size_t skipped = 0;
679  for (size_t available; (available = length()) < len;) {
680  skipped += available;
681  if (UNLIKELY(!tryAdvanceBuffer())) {
682  return skipped;
683  }
684  len -= available;
685  }
686  crtPos_ += len;
688  return skipped + len;
689  }
const uint8_t * crtPos_
Definition: Cursor.h:623
size_t length() const
Definition: Cursor.h:118
#define UNLIKELY(x)
Definition: Likely.h:48
template<class Derived, class BufType>
void folly::io::detail::CursorBase< Derived, BufType >::skipNoAdvance ( size_t  len)
inline

Skip bytes in the current IOBuf without advancing to the next one. Precondition: length() >= len

Definition at line 384 of file Cursor.h.

384  {
385  DCHECK_LE(len, length());
386  crtPos_ += len;
387  }
const uint8_t * crtPos_
Definition: Cursor.h:623
size_t length() const
Definition: Cursor.h:118
template<class Derived, class BufType>
void folly::io::detail::CursorBase< Derived, BufType >::skipSlow ( size_t  len)
inlineprivate

Definition at line 691 of file Cursor.h.

Referenced by folly::io::detail::CursorBase< Cursor, const IOBuf >::skip().

691  {
692  if (UNLIKELY(skipAtMostSlow(len) != len)) {
693  throw_exception<std::out_of_range>("underflow");
694  }
695  }
size_t skipAtMostSlow(size_t len)
Definition: Cursor.h:677
#define UNLIKELY(x)
Definition: Likely.h:48
template<class Derived , class BufType >
template<typename Predicate >
void folly::io::detail::CursorBase< Derived, BufType >::skipWhile ( const Predicate &  predicate)

Definition at line 104 of file Cursor-inl.h.

Referenced by folly::io::detail::CursorBase< Cursor, const IOBuf >::readFixedString().

104  {
105  CursorNoopAppender appender;
106  readWhile(predicate, appender);
107 }
std::string readWhile(const Predicate &predicate)
Definition: Cursor-inl.h:72
template<class Derived, class BufType>
size_t folly::io::detail::CursorBase< Derived, BufType >::totalLength ( ) const
inline

Return the space available until the end of the entire IOBuf chain.

Definition at line 126 of file Cursor.h.

Referenced by folly::io::RWCursor< access >::gather(), folly::io::RWCursor< access >::gatherAtMost(), proxygen::HTTP2Codec::onIngress(), proxygen::SPDYCodec::parseIngress(), fizz::detail::ReadVector< N, T >::readVector(), fizz::detail::ReadVector< bits24, T >::readVector(), proxygen::HPACKDecodeBuffer::reset(), and TEST().

126  {
127  if (crtBuf_ == buffer_) {
128  return crtBuf_->computeChainDataLength() - (crtPos_ - crtBegin_);
129  }
130  CursorBase end(buffer_->prev());
131  end.crtPos_ = end.crtEnd_;
132  return end - *this;
133  }
const uint8_t * crtPos_
Definition: Cursor.h:623
auto end(TestAdlIterable &instance)
Definition: ForeachTest.cpp:62
const uint8_t * crtBegin_
Definition: Cursor.h:621
friend class CursorBase
Definition: Cursor.h:59
template<class Derived, class BufType>
bool folly::io::detail::CursorBase< Derived, BufType >::tryAdvanceBuffer ( )
inlineprotected

Definition at line 584 of file Cursor.h.

Referenced by folly::io::detail::CursorBase< Cursor, const IOBuf >::advanceBufferIfEmpty(), folly::io::detail::CursorBase< Cursor, const IOBuf >::cloneAtMost(), folly::io::detail::CursorBase< Cursor, const IOBuf >::peekBytes(), folly::io::detail::CursorBase< Cursor, const IOBuf >::pullAtMostSlow(), folly::io::RWCursor< access >::pushAtMost(), folly::io::detail::CursorBase< Cursor, const IOBuf >::readFixedStringSlow(), and folly::io::detail::CursorBase< Cursor, const IOBuf >::skipAtMostSlow().

584  {
585  BufType* nextBuf = crtBuf_->next();
586  if (UNLIKELY(nextBuf == buffer_)) {
587  crtPos_ = crtEnd_;
588  return false;
589  }
590 
592  crtBuf_ = nextBuf;
593  crtPos_ = crtBegin_ = crtBuf_->data();
594  crtEnd_ = crtBuf_->tail();
595  static_cast<Derived*>(this)->advanceDone();
596  return true;
597  }
const uint8_t * crtPos_
Definition: Cursor.h:623
const uint8_t * crtEnd_
Definition: Cursor.h:622
const uint8_t * crtBegin_
Definition: Cursor.h:621
BufType
Definition: IOBufTest.cpp:844
#define UNLIKELY(x)
Definition: Likely.h:48
template<class Derived, class BufType>
template<class T >
std::enable_if<std::is_arithmetic<T>::value, bool>::type folly::io::detail::CursorBase< Derived, BufType >::tryRead ( T val)
inline

Definition at line 257 of file Cursor.h.

Referenced by TEST(), folly::io::detail::CursorBase< Cursor, const IOBuf >::tryReadBE(), and folly::io::detail::CursorBase< Cursor, const IOBuf >::tryReadLE().

258  {
259  if (LIKELY(crtPos_ + sizeof(T) <= crtEnd_)) {
260  val = loadUnaligned<T>(data());
261  crtPos_ += sizeof(T);
262  return true;
263  }
264  return pullAtMostSlow(&val, sizeof(T)) == sizeof(T);
265  }
const uint8_t * crtPos_
Definition: Cursor.h:623
const uint8_t * data() const
Definition: Cursor.h:105
size_t pullAtMostSlow(void *buf, size_t len)
Definition: Cursor.h:647
const uint8_t * crtEnd_
Definition: Cursor.h:622
#define LIKELY(x)
Definition: Likely.h:47
double val
Definition: String.cpp:273
folly::std T
template<class Derived, class BufType>
template<class T >
bool folly::io::detail::CursorBase< Derived, BufType >::tryReadBE ( T val)
inline

Definition at line 268 of file Cursor.h.

Referenced by TEST().

268  {
269  const bool result = tryRead(val);
270  val = Endian::big(val);
271  return result;
272  }
std::enable_if< std::is_arithmetic< T >::value, bool >::type tryRead(T &val)
Definition: Cursor.h:257
double val
Definition: String.cpp:273
static T big(T x)
Definition: Bits.h:259
template<class Derived, class BufType>
template<class T >
bool folly::io::detail::CursorBase< Derived, BufType >::tryReadLE ( T val)
inline

Definition at line 275 of file Cursor.h.

Referenced by prefix(), and TEST().

275  {
276  const bool result = tryRead(val);
278  return result;
279  }
std::enable_if< std::is_arithmetic< T >::value, bool >::type tryRead(T &val)
Definition: Cursor.h:257
double val
Definition: String.cpp:273
static T little(T x)
Definition: Bits.h:263
template<class Derived, class BufType>
bool folly::io::detail::CursorBase< Derived, BufType >::tryRetreatBuffer ( )
inlineprotected

Definition at line 599 of file Cursor.h.

Referenced by folly::io::detail::CursorBase< Cursor, const IOBuf >::retreatAtMostSlow().

599  {
600  if (UNLIKELY(crtBuf_ == buffer_)) {
601  crtPos_ = crtBegin_;
602  return false;
603  }
604  crtBuf_ = crtBuf_->prev();
605  crtBegin_ = crtBuf_->data();
606  crtPos_ = crtEnd_ = crtBuf_->tail();
608  static_cast<Derived*>(this)->advanceDone();
609  return true;
610  }
const uint8_t * crtPos_
Definition: Cursor.h:623
const uint8_t * crtEnd_
Definition: Cursor.h:622
const uint8_t * crtBegin_
Definition: Cursor.h:621
#define UNLIKELY(x)
Definition: Likely.h:48

Friends And Related Function Documentation

template<class Derived, class BufType>
template<class D , typename B >
friend class CursorBase
friend

Definition at line 59 of file Cursor.h.

Member Data Documentation

template<class Derived, class BufType>
const uint8_t* folly::io::detail::CursorBase< Derived, BufType >::crtPos_ {nullptr}
protected

Definition at line 623 of file Cursor.h.

Referenced by folly::io::detail::CursorBase< Cursor, const IOBuf >::advanceBufferIfEmpty(), folly::io::detail::CursorBase< Cursor, const IOBuf >::advanceToEnd(), folly::io::detail::CursorBase< Cursor, const IOBuf >::cloneAtMost(), folly::io::detail::CursorBase< Cursor, const IOBuf >::CursorBase(), folly::io::detail::CursorBase< Cursor, const IOBuf >::data(), folly::io::detail::CursorBase< Cursor, const IOBuf >::dcheckIntegrity(), folly::io::RWCursor< access >::gather(), folly::io::RWCursor< access >::gatherAtMost(), folly::io::detail::CursorBase< Cursor, const IOBuf >::getCurrentPosition(), folly::io::RWCursor< access >::insert(), folly::io::detail::CursorBase< Cursor, const IOBuf >::isAtEnd(), folly::io::detail::CursorBase< Cursor, const IOBuf >::length(), folly::io::RWCursor< access >::maybeUnshare(), folly::io::detail::CursorBase< Cursor, const IOBuf >::operator-(), folly::io::detail::CursorBase< Cursor, const IOBuf >::operator==(), folly::io::detail::CursorBase< Cursor, const IOBuf >::pull(), folly::io::detail::CursorBase< Cursor, const IOBuf >::pullAtMost(), folly::io::detail::CursorBase< Cursor, const IOBuf >::pullAtMostSlow(), folly::io::RWCursor< access >::pushAtMost(), folly::io::detail::CursorBase< Cursor, const IOBuf >::read(), folly::io::detail::CursorBase< Cursor, const IOBuf >::readFixedString(), folly::io::detail::CursorBase< Cursor, const IOBuf >::readFixedStringSlow(), folly::io::detail::CursorBase< Cursor, const IOBuf >::reset(), folly::io::detail::CursorBase< Cursor, const IOBuf >::retreat(), folly::io::detail::CursorBase< Cursor, const IOBuf >::retreatAtMost(), folly::io::detail::CursorBase< Cursor, const IOBuf >::retreatAtMostSlow(), folly::io::detail::CursorBase< Cursor, const IOBuf >::skip(), folly::io::detail::CursorBase< Cursor, const IOBuf >::skipAtMost(), folly::io::detail::CursorBase< Cursor, const IOBuf >::skipAtMostSlow(), folly::io::detail::CursorBase< Cursor, const IOBuf >::skipNoAdvance(), folly::io::detail::CursorBase< Cursor, const IOBuf >::totalLength(), folly::io::detail::CursorBase< Cursor, const IOBuf >::tryAdvanceBuffer(), folly::io::detail::CursorBase< Cursor, const IOBuf >::tryRead(), folly::io::detail::CursorBase< Cursor, const IOBuf >::tryRetreatBuffer(), and folly::io::RWCursor< access >::writableData().


The documentation for this class was generated from the following files: