Skip to content
Latest commit 6a6efad May 25, 2016 @simpkins simpkins committed with Facebook Github Bot 0 add Cursor::peekBytes()
Summary:
The existing Cursor::peek() method pre-dates the existence of folly::ByteRange,
and so it returns a std::pair containing a pointer and length.  This is usually
more awkward to use than ByteRange.

This adds a peekBytes() method that returns a ByteRange object, and updates all
users of peek() in folly to use peekBytes() instead.  Eventually I think we
should add a FOLLY_DEPRECATED attribute to peek().  I will wait to add this tag
until after converting a few other projects to use peekBytes(), though.

Reviewed By: alandau

Differential Revision: D3337302

fbshipit-source-id: 14220a059d915bf5adc66b8b283f7228b796a4dc
..
Failed to load latest commit information.
build Update generate_varint_tables to support MSVC May 24, 2016
detail Prevent leaks in ThreadLocalPtr initialization May 12, 2016
docs docs/Overview.md: Fixed 2 hyperlinks. May 10, 2016
experimental add Cursor::peekBytes() May 25, 2016
fibers templating folly::fibers::await by Baton May 19, 2016
futures Extract Try to top-level May 19, 2016
gen folly: replace old-style header guards with "pragma once" Apr 1, 2016
init Switch gflags to portability/GFlags.h May 4, 2016
io add Cursor::peekBytes() May 25, 2016
m4 Make gflags and boost::program_options play nice with each other Jul 23, 2015
portability Fix the detection of preadv and pwritev on OSX in OSS May 20, 2016
stats folly: ubsan: disable integer overflow tests in Histogram May 9, 2016
test Extract Try to top-level May 19, 2016
ApplyTuple.h folly/ApplyTuple.h: fix const-correctness & other issues, simplify Feb 18, 2016
Arena-inl.h folly copyright 2015 -> copyright 2016 Feb 12, 2016
Arena.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
Array.h Add make_array to folly Apr 19, 2016
Assume.h Support folly::assume under MSVC May 23, 2016
AtomicBitSet.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
AtomicHashArray-inl.h folly copyright 2015 -> copyright 2016 Feb 12, 2016
AtomicHashArray.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
AtomicHashMap-inl.h folly copyright 2015 -> copyright 2016 Feb 12, 2016
AtomicHashMap.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
AtomicIntrusiveLinkedList.h Don't attempt to implicitly convert an atomic<T> to bool May 4, 2016
AtomicLinkedList.h Non-intrusive AtomicLinkedList Apr 15, 2016
AtomicStruct.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
AtomicUnorderedMap.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
Baton.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
Benchmark.cpp folly copyright 2015 -> copyright 2016 Feb 12, 2016
Benchmark.h Fix a few typos all over the code May 10, 2016
Bits.cpp folly copyright 2015 -> copyright 2016 Feb 12, 2016
Bits.h Prefer constexpr to preprocessor conditionals when checking endianness May 14, 2016
CPortability.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
CallOnce.h Add call_once, wrapper around std::call_once with a fast path Feb 17, 2016
Checksum.cpp folly copyright 2015 -> copyright 2016 Feb 12, 2016
Checksum.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
ConcurrentSkipList-inl.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
ConcurrentSkipList.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
ConditionallyExistent.h ConditionallyExistent<typename> Feb 5, 2016
ContainerTraits.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
Conv.cpp Extensibility for folly::to<> through ADL Apr 7, 2016
Conv.h use forward instead of move for universal references Apr 23, 2016
CppAttributes.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
CpuId.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
Demangle.cpp folly copyright 2015 -> copyright 2016 Feb 12, 2016
Demangle.h folly copyright 2015 -> copyright 2016 Feb 12, 2016
DiscriminatedPtr.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
DynamicConverter.h Use std::string in folly::dynamic Apr 26, 2016
EvictingCacheMap.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
Exception.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
ExceptionWrapper.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
Executor.h folly copyright 2015 -> copyright 2016 Feb 12, 2016
FBString.h folly: FBString: avoid ubsan in assert May 19, 2016
FBVector.h folly: fbvector: ubsan: don't call memcpy() with nullptr args if size… May 17, 2016
File.cpp folly copyright 2015 -> copyright 2016 Feb 12, 2016
File.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
FileUtil.cpp Make the sys/uio.h portability header work for Windows May 11, 2016
FileUtil.h Make the sys/uio.h portability header work for Windows May 12, 2016
Fingerprint.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
Foreach.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
Format-inl.h folly: ubsan: format: avoid UB in abs(-INT_MIN) May 11, 2016
Format.cpp Start compiling a bit of `-Wshadow` Apr 6, 2016
Format.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
FormatArg.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
FormatTraits.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
Function.h rearrange folly::Function so that its template arguments are deducable. May 4, 2016
GroupVarint.cpp folly copyright 2015 -> copyright 2016 Feb 12, 2016
GroupVarint.h Update generate_varint_tables to support MSVC May 24, 2016
Hash.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
IPAddress.cpp IPAddress::validate May 16, 2016
IPAddress.h IPAddress::validate May 17, 2016
IPAddressException.h folly copyright 2015 -> copyright 2016 Feb 12, 2016
IPAddressV4.cpp IPAddressV[46]::validate Mar 29, 2016
IPAddressV4.h IPAddress::validate May 17, 2016
IPAddressV6.cpp IPAddressV[46]::validate Mar 29, 2016
IPAddressV6.h IPAddress::validate May 17, 2016
Indestructible.h Use C++'s standardized [[noreturn]] attribute Mar 23, 2016
IndexedMemPool.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
IntrusiveList.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
Lazy.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
LifoSem.cpp folly copyright 2015 -> copyright 2016 Feb 12, 2016
LifoSem.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
Likely.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
Logging.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
MPMCPipeline.h folly copyright 2015 -> copyright 2016 Feb 12, 2016
MPMCQueue.h Convert a polling loop to a futex wait Mar 15, 2016
MacAddress.cpp folly copyright 2015 -> copyright 2016 Feb 12, 2016
MacAddress.h folly copyright 2015 -> copyright 2016 Feb 12, 2016
Makefile.am Extract Try to top-level May 19, 2016
Malloc.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
MapUtil.h get_default and get_ref_default variants taking functions Apr 21, 2016
Memory.h Fix detection of std::make_unique under MSVC May 9, 2016
MemoryMapping.cpp Switch gflags to portability/GFlags.h May 5, 2016
MemoryMapping.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
Merge.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
MicroLock.cpp Move asm portability to an Asm portability header Mar 28, 2016
MicroLock.h Backward compatibility for older versions of clang. Apr 19, 2016
MicroSpinLock.h Add MicroLock as an alternative to MicroSpinLock Mar 3, 2016
MoveWrapper.h folly copyright 2015 -> copyright 2016 Feb 12, 2016
Optional.h Add <new> header for placement new Apr 8, 2016
PackedSyncPtr.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
Padded.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
PicoSpinLock.h Adding portability to gating PicoSpinLock. Mar 10, 2016
Portability.h Make the sys/uio.h portability header work for Windows May 12, 2016
Preprocessor.h Deal with some oddities of MSVC's preprocessor May 9, 2016
ProducerConsumerQueue.h Promote memory_order_consume to memory_order_acquire May 19, 2016
RWSpinLock.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
Random-inl.h Correctly deduce RNG type in folly::Random Apr 15, 2016
Random.cpp Add call_once, wrapper around std::call_once with a fast path Feb 17, 2016
Random.h Correctly deduce RNG type in folly::Random Apr 15, 2016
Range.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
SafeAssert.cpp folly copyright 2015 -> copyright 2016 Feb 12, 2016
SafeAssert.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
ScopeGuard.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
SharedMutex.cpp folly copyright 2015 -> copyright 2016 Feb 12, 2016
SharedMutex.h Create ReadHolder::unlock Apr 28, 2016
Singleton-inl.h Don't initialize kDestroyWaitTime in-class May 4, 2016
Singleton.cpp Don't throw on late singleton registration May 6, 2016
Singleton.h Don't initialize kDestroyWaitTime in-class May 4, 2016
SingletonStackTrace.cpp folly copyright 2015 -> copyright 2016 Feb 12, 2016
SingletonThreadLocal.h Fix SingletonThreadLocal Feb 29, 2016
SingletonVault_c.cpp folly copyright 2015 -> copyright 2016 Feb 12, 2016
SingletonVault_c.h folly copyright 2015 -> copyright 2016 Feb 12, 2016
SmallLocks.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
SocketAddress.cpp More useful logging upon failed AsyncServerSocket::bind() May 3, 2016
SocketAddress.h More useful logging upon failed AsyncServerSocket::bind() May 3, 2016
SparseByteSet.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
SpinLock.h Improve RWSpinLock.h cautionary comment Mar 1, 2016
SpookyHashV1.cpp folly copyright 2015 -> copyright 2016 Feb 12, 2016
SpookyHashV1.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
SpookyHashV2.cpp Make Bits.h respect FOLLY_HAVE_UNALIGNED_ACCESS. Mar 9, 2016
SpookyHashV2.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
String-inl.h Extensibility for folly::to<> through ADL Apr 7, 2016
String.cpp Extensibility for folly::to<> through ADL Apr 7, 2016
String.h Adding a constructor to UTF8Range that uses std::string Apr 26, 2016
StringBase.cpp folly copyright 2015 -> copyright 2016 Feb 12, 2016
Subprocess.cpp add Cursor::peekBytes() May 25, 2016
Subprocess.h use forward instead of move for universal references Apr 23, 2016
Synchronized.h Deal with some oddities of MSVC's preprocessor May 10, 2016
ThreadCachedArena.cpp folly copyright 2015 -> copyright 2016 Feb 12, 2016
ThreadCachedArena.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
ThreadCachedInt.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
ThreadLocal.h Transfer ownership from a unique_ptr to a ThreadLocalPtr May 12, 2016
ThreadName.h folly copyright 2015 -> copyright 2016 Feb 12, 2016
TimeoutQueue.cpp folly copyright 2015 -> copyright 2016 Feb 12, 2016
TimeoutQueue.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
TokenBucket.h folly copyright 2015 -> copyright 2016 Feb 12, 2016
Traits.h Suppress new GCC 5 warning -Wbool-compare May 13, 2016
Try-inl.h Extract Try to top-level May 19, 2016
Try.h Extract Try to top-level May 19, 2016
Unicode.cpp Use std::string in folly::dynamic Apr 26, 2016
Unicode.h Use std::string in folly::dynamic Apr 26, 2016
Unit.h Flesh out the comments about Unit May 18, 2016
Uri-inl.h folly copyright 2015 -> copyright 2016 Feb 12, 2016
Uri.cpp folly copyright 2015 -> copyright 2016 Feb 12, 2016
Uri.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
VERSION Bump version to 57:0 Aug 31, 2015
Varint.h folly: ubsan: cast to unsigned to avoid negative-left-shift May 9, 2016
Version.cpp folly copyright 2015 -> copyright 2016 Feb 12, 2016
VersionCheck.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
configure.ac Make the sys/uio.h portability header work for Windows May 12, 2016
dynamic-inl.h Avoid std::initializer_list ctor in folly::dynamic::array May 22, 2016
dynamic.cpp Use std::string in folly::dynamic Apr 26, 2016
dynamic.h Avoid std::initializer_list ctor in folly::dynamic::array May 23, 2016
json.cpp Add recursion limit to folly::parseJson. Apr 27, 2016
json.h Add recursion limit to folly::parseJson. Apr 27, 2016
memcpy.S folly copyright 2015 -> copyright 2016 Feb 12, 2016
small_vector.h Deprecate boost::mpl May 3, 2016
sorted_vector_types.h folly: replace old-style header guards with "pragma once" Apr 1, 2016
Something went wrong with that request. Please try again.