proxygen
|
#include <ScopedEventBaseThread.h>
Public Types | |
typedef std::size_t | size_type |
typedef Iter | iterator |
typedef Iter | const_iterator |
typedef std::remove_reference< typename std::iterator_traits< Iter >::reference >::type | value_type |
using | difference_type = typename std::iterator_traits< Iter >::difference_type |
typedef std::iterator_traits< Iter >::reference | reference |
typedef std::conditional< std::is_same< Iter, char * >::value||std::is_same< Iter, unsigned char * >::value, Range< const value_type * >, Range< Iter > >::type | const_range_type |
typedef std::char_traits< typename std::remove_const< value_type >::type > | traits_type |
Public Member Functions | |
constexpr | Range () |
constexpr | Range (const Range &)=default |
constexpr | Range (Range &&)=default |
constexpr | Range (Iter start, Iter end) |
constexpr | Range (Iter start, size_t size) |
Range (std::nullptr_t)=delete | |
constexpr | Range (Iter str) |
template<class T = Iter, typename detail::IsCharPointer< T >::const_type = 0> | |
Range (const std::string &str) | |
template<class T = Iter, typename detail::IsCharPointer< T >::const_type = 0> | |
Range (const std::string &str, std::string::size_type startFrom) | |
template<class T = Iter, typename detail::IsCharPointer< T >::const_type = 0> | |
Range (const std::string &str, std::string::size_type startFrom, std::string::size_type size) | |
Range (const Range &other, size_type first, size_type length=npos) | |
template<class Container , class = typename std::enable_if< std::is_same<Iter, typename Container::const_pointer>::value>::type, class = decltype( Iter(std::declval<Container const&>().data()), Iter( std::declval<Container const&>().data() + std::declval<Container const&>().size()))> | |
constexpr | Range (Container const &container) |
template<class Container , class = typename std::enable_if< std::is_same<Iter, typename Container::const_pointer>::value>::type, class = decltype( Iter(std::declval<Container const&>().data()), Iter( std::declval<Container const&>().data() + std::declval<Container const&>().size()))> | |
Range (Container const &container, typename Container::size_type startFrom) | |
template<class Container , class = typename std::enable_if< std::is_same<Iter, typename Container::const_pointer>::value>::type, class = decltype( Iter(std::declval<Container const&>().data()), Iter( std::declval<Container const&>().data() + std::declval<Container const&>().size()))> | |
Range (Container const &container, typename Container::size_type startFrom, typename Container::size_type size) | |
template<class OtherIter , typename std::enable_if< (std::is_same< Iter, const unsigned char * >::value &&(std::is_same< OtherIter, const char * >::value||std::is_same< OtherIter, char * >::value)), int >::type = 0> | |
Range (const Range< OtherIter > &other) | |
template<class OtherIter , typename std::enable_if< (std::is_same< Iter, unsigned char * >::value &&std::is_same< OtherIter, char * >::value), int >::type = 0> | |
Range (const Range< OtherIter > &other) | |
template<class OtherIter , typename std::enable_if< (std::is_same< Iter, const char * >::value &&(std::is_same< OtherIter, const unsigned char * >::value||std::is_same< OtherIter, unsigned char * >::value)), int >::type = 0> | |
Range (const Range< OtherIter > &other) | |
template<class OtherIter , typename std::enable_if< (std::is_same< Iter, char * >::value &&std::is_same< OtherIter, unsigned char * >::value), int >::type = 0> | |
Range (const Range< OtherIter > &other) | |
template<class OtherIter , typename std::enable_if< (!std::is_same< Iter, OtherIter >::value &&std::is_convertible< OtherIter, Iter >::value), int >::type = 0> | |
constexpr | Range (const Range< OtherIter > &other) |
template<class OtherIter , typename std::enable_if< (!std::is_same< Iter, OtherIter >::value &&!std::is_convertible< OtherIter, Iter >::value &&std::is_constructible< Iter, const OtherIter & >::value), int >::type = 0> | |
constexpr | Range (const Range< OtherIter > &other) |
template<class T , size_t N, typename = typename std::enable_if< std::is_convertible<const T*, Iter>::value>::type> | |
constexpr | Range (const std::array< T, N > &array) |
template<class T , size_t N, typename = typename std::enable_if<std::is_convertible<T*, Iter>::value>::type> | |
constexpr | Range (std::array< T, N > &array) |
Range & | operator= (const Range &rhs)&=default |
Range & | operator= (Range &&rhs)&=default |
template<class T = Iter, typename detail::IsCharPointer< T >::const_type = 0> | |
Range & | operator= (std::string &&rhs)=delete |
void | clear () |
void | assign (Iter start, Iter end) |
void | reset (Iter start, size_type size) |
void | reset (const std::string &str) |
constexpr size_type | size () const |
constexpr size_type | walk_size () const |
constexpr bool | empty () const |
constexpr Iter | data () const |
constexpr Iter | start () const |
constexpr Iter | begin () const |
constexpr Iter | end () const |
constexpr Iter | cbegin () const |
constexpr Iter | cend () const |
value_type & | front () |
value_type & | back () |
const value_type & | front () const |
const value_type & | back () const |
template<typename Tgt , std::enable_if_t< std::is_constructible< Tgt, Iter const &, size_type >::value &&!IsConstructibleViaStringView< Tgt >::value, int > = 0> | |
constexpr | operator Tgt () const noexcept(std::is_nothrow_constructible< Tgt, Iter const &, size_type >::value) |
template<typename Tgt , std::enable_if_t< !std::is_constructible< Tgt, Iter const &, size_type >::value &&std::is_constructible< Tgt, Iter const &, Iter const & >::value &&!IsConstructibleViaStringView< Tgt >::value, int > = 0> | |
constexpr | operator Tgt () const noexcept(std::is_nothrow_constructible< Tgt, Iter const &, Iter const & >::value) |
template<typename Tgt , typename... Args> | |
constexpr std::enable_if_t< std::is_constructible< Tgt, Iter const &, size_type >::value, Tgt > | to (Args &&...args) const noexcept(std::is_nothrow_constructible< Tgt, Iter const &, size_type, Args &&... >::value) |
template<typename Tgt , typename... Args> | |
constexpr std::enable_if_t< !std::is_constructible< Tgt, Iter const &, size_type >::value &&std::is_constructible< Tgt, Iter const &, Iter const & >::value, Tgt > | to (Args &&...args) const noexcept(std::is_nothrow_constructible< Tgt, Iter const &, Iter const &, Args &&... >::value) |
std::string | str () const |
std::string | toString () const |
const_range_type | castToConst () const |
int | compare (const const_range_type &o) const |
value_type & | operator[] (size_t i) |
const value_type & | operator[] (size_t i) const |
value_type & | at (size_t i) |
const value_type & | at (size_t i) const |
uint32_t | hash () const |
void | advance (size_type n) |
void | subtract (size_type n) |
Range | subpiece (size_type first, size_type length=npos) const |
void | uncheckedAdvance (size_type n) |
void | uncheckedSubtract (size_type n) |
Range | uncheckedSubpiece (size_type first, size_type length=npos) const |
void | pop_front () |
void | pop_back () |
size_type | find (const_range_type str) const |
size_type | find (const_range_type str, size_t pos) const |
size_type | find (Iter s, size_t pos, size_t n) const |
size_type | find (const Iter s) const |
size_type | find (const Iter s, size_t pos) const |
size_type | find (value_type c) const |
size_type | rfind (value_type c) const |
size_type | find (value_type c, size_t pos) const |
size_type | find_first_of (const_range_type needles) const |
size_type | find_first_of (const_range_type needles, size_t pos) const |
size_type | find_first_of (Iter needles) const |
size_type | find_first_of (Iter needles, size_t pos) const |
size_type | find_first_of (Iter needles, size_t pos, size_t n) const |
size_type | find_first_of (value_type c) const |
size_type | find_first_of (value_type c, size_t pos) const |
bool | contains (const const_range_type &other) const |
bool | contains (const value_type &other) const |
void | swap (Range &rhs) |
bool | startsWith (const const_range_type &other) const |
bool | startsWith (value_type c) const |
template<class Comp > | |
bool | startsWith (const const_range_type &other, Comp &&eq) const |
bool | endsWith (const const_range_type &other) const |
bool | endsWith (value_type c) const |
template<class Comp > | |
bool | endsWith (const const_range_type &other, Comp &&eq) const |
template<class Comp > | |
bool | equals (const const_range_type &other, Comp &&eq) const |
void | erase (Iter b, Iter e) |
bool | removePrefix (const const_range_type &prefix) |
bool | removePrefix (value_type prefix) |
bool | removeSuffix (const const_range_type &suffix) |
bool | removeSuffix (value_type suffix) |
bool | replaceAt (size_t pos, const_range_type replacement) |
size_t | replaceAll (const_range_type source, const_range_type dest) |
Range | split_step (value_type delimiter) |
Range | split_step (Range delimiter) |
template<typename TProcess , typename... Args> | |
auto | split_step (value_type delimiter, TProcess &&process, Args &&...args) -> decltype(process(std::declval< Range >(), std::forward< Args >(args)...)) |
template<typename TProcess , typename... Args> | |
auto | split_step (Range delimiter, TProcess &&process, Args &&...args) -> decltype(process(std::declval< Range >(), std::forward< Args >(args)...)) |
Static Public Attributes | |
static const size_type | npos = std::string::npos |
Private Types | |
template<typename Target > | |
using | IsConstructibleViaStringView = std::false_type |
Private Attributes | |
Iter | b_ |
Iter | e_ |
Range abstraction keeping a pair of iterators. We couldn't use boost's similar range abstraction because we need an API identical with the former StringPiece class, which is used by a lot of other code. This abstraction does fulfill the needs of boost's range-oriented algorithms though.
(Keep memory lifetime in mind when using this class, since it doesn't manage the data it refers to - just like an iterator wouldn't.)
Definition at line 29 of file ScopedEventBaseThread.h.
typedef Iter folly::Range< Iter >::const_iterator |
typedef std::conditional< std::is_same<Iter, char*>::value || std::is_same<Iter, unsigned char*>::value, Range<const value_type*>, Range<Iter> >::type folly::Range< Iter >::const_range_type |
using folly::Range< Iter >::difference_type = typename std::iterator_traits<Iter>::difference_type |
|
private |
typedef Iter folly::Range< Iter >::iterator |
typedef std::iterator_traits<Iter>::reference folly::Range< Iter >::reference |
typedef std::size_t folly::Range< Iter >::size_type |
typedef std::char_traits<typename std::remove_const<value_type>::type> folly::Range< Iter >::traits_type |
typedef std::remove_reference< typename std::iterator_traits<Iter>::reference>::type folly::Range< Iter >::value_type |
|
inline |
|
default |
|
default |
|
inline |
|
inline |
|
delete |
|
inline |
Definition at line 216 of file Range.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineexplicit |
|
inlineexplicit |
|
inline |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inline |
Definition at line 672 of file Range.h.
Referenced by folly::RecordIOReader::Iterator::advanceToValid(), folly::gen::detail::consumeBufferPlus(), folly::gen::detail::consumeFixedSizeChunks(), folly::io::StreamCodec::doUncompress(), folly::symbolizer::Dwarf::findAddress(), folly::symbolizer::Dwarf::findLocation(), folly::format_value::formatNumber(), folly::symbolizer::Dwarf::getAbbreviation(), folly::RecordIOReader::Iterator::increment(), folly::RecordIOReader::Iterator::Iterator(), folly::symbolizer::Dwarf::LineNumberVM::nextDefineFile(), proxygen::HTTP1xCodec::onHeaderField(), folly::compression::BitVectorEncoder< Value, SkipValue, kSkipQuantum, kForwardQuantum >::Layout::openList(), folly::compression::EliasFanoEncoderV2< Value, SkipValue, kSkipQuantum, kForwardQuantum >::Layout::openList(), folly::gen::StreamSplitter< Callback >::operator()(), ReadStats::parseMessage(), folly::prettyToDouble(), folly::symbolizer::Dwarf::Section::Section(), proxygen::HTTPMessage::splitNameValue(), proxygen::HTTPMessage::splitNameValuePieces(), folly::gen::detail::splitPrefix(), folly::symbolizer::Dwarf::LineNumberVM::step(), folly::stringToLogLevel(), folly::symbolizer::test::TEST(), TYPED_TEST(), folly::recordio_helpers::validateRecord(), and folly::gen::detail::FileWriter::write().
|
inline |
Definition at line 416 of file Range.h.
Referenced by folly::symbolizer::Dwarf::LineNumberVM::init(), folly::symbolizer::Dwarf::readAbbreviation(), folly::symbolizer::LineReader::readLine(), folly::symbolizer::Dwarf::Section::Section(), and folly::gen::detail::splitPrefix().
|
inline |
Definition at line 628 of file Range.h.
Referenced by folly::bser::decodeHeader(), and folly::json_pointer::try_parse().
|
inline |
|
inline |
Definition at line 468 of file Range.h.
Referenced by folly::gen::detail::StringResplitter::Generator< Source >::apply(), folly::rtrimWhitespace(), and proxygen::ParseURL::stripBrackets().
|
inline |
Definition at line 476 of file Range.h.
|
inline |
Definition at line 452 of file Range.h.
Referenced by folly::RecordIOReader::Iterator::advanceToValid(), proxygen::base64Encode(), folly::detail::RangeEnumerator< Range >::begin(), proxygen::caseInsensitiveEqual(), folly::cEscape(), checkResplitMaxLength(), folly::gen::detail::consumeFixedSizeChunks(), folly::cUnescape(), fizz::detail::decFunc(), fizz::detail::decFuncBlocks(), folly::compression::EliasFanoEncoderV2< Value, SkipValue, kSkipQuantum, kForwardQuantum >::EliasFanoEncoderV2(), folly::json::escapeStringImpl(), folly::detail::estimatesFromDigest(), fizz::KeyDerivationImpl< Hash >::expandLabel(), folly::symbolizer::Dwarf::findLocation(), folly::recordio_helpers::findRecord(), folly::LogName::getParent(), folly::ssl::OpenSSLUtils::getTLSClientRandom(), folly::ssl::OpenSSLUtils::getTLSMasterKey(), folly::detail::TransparentRangeHash< detail::ValueTypeForTransparentConversionToRange< T >::type >::hashImpl(), folly::test::detail::hasPCREPatternMatch(), proxygen::md5Encode(), SimpleDigest< MergeSize >::merge(), folly::TDigest::merge(), proxygen::HTTP1xCodec::onHeaderField(), proxygen::HTTP1xCodec::onIngress(), folly::gen::StreamSplitter< Callback >::operator()(), EqTraits::operator()(), KeyConvertTraits::operator()(), folly::hasher< folly::Range< T * >, std::enable_if_t< std::is_integral< T >::value, void > >::operator()(), folly::MacAddress::parse(), proxygen::RFC2616::parseByteRangeSpec(), folly::CustomLogFormatter::parseFormatString(), folly::AsyncIOOp::pread(), proxygen::HTTP1xCodec::pushHeaderNameAndValue(), folly::AsyncIOOp::pwrite(), folly::qfind(), folly::qfind_first_of(), folly::MacAddress::setFromBinary(), folly::detail::splitFixed(), proxygen::HPACKHeaderName::storeAddress(), TEST(), testInvalid(), testRangeFunc(), testValid(), folly::toAppend(), folly::toLowerAscii(), folly::symbolizer::Dwarf::Path::toString(), fizz::trimBytes(), folly::tryDecodeVarint(), TYPED_TEST(), folly::Uri::Uri(), folly::uriEscape(), folly::uriUnescape(), and folly::recordio_helpers::validateRecord().
|
inline |
Definition at line 598 of file Range.h.
Referenced by fizz::test::TEST().
|
inline |
|
inline |
|
inline |
Definition at line 411 of file Range.h.
Referenced by folly::RecordIOReader::Iterator::advanceToValid(), folly::RecordIOReader::Iterator::Iterator(), folly::symbolizer::Dwarf::Path::Path(), proxygen::HTTP1xCodec::pushHeaderNameAndValue(), and folly::gen::detail::splitPrefix().
|
inline |
Definition at line 602 of file Range.h.
Referenced by folly::operator==(), folly::operator>(), and folly::operator>=().
|
inline |
Determine whether the range contains the given subrange or item.
Note: Call find() directly if the index is needed.
Definition at line 812 of file Range.h.
Referenced by folly::test::TEST().
|
inline |
|
inline |
Definition at line 446 of file Range.h.
Referenced by proxygen::HTTPHeaders::add(), folly::RecordIOReader::Iterator::advanceToValid(), folly::io::detail::CursorStringAppender::append(), folly::IOBufQueue::append(), folly::MemoryMapping::asRange(), folly::symbolizer::SignalSafeElfCache::Path::assign(), folly::MemoryMapping::asWritableRange(), folly::compression::BitVectorEncoder< Value, SkipValue, kSkipQuantum, kForwardQuantum >::BitVectorEncoder(), folly::bser::bserEncodeString(), fizz::CryptoUtils::clean(), folly::Subprocess::communicate(), folly::gen::detail::consumeBufferPlus(), folly::IOBuf::copyBuffer(), fizz::jni::createByteArray(), createProtectedBuf(), fizz::detail::decodeECPublicKey(), folly::ssl::OpenSSLCertUtils::derDecode(), folly::symbolizer::FDSymbolizePrinter::doPrint(), folly::symbolizer::FILESymbolizePrinter::doPrint(), folly::symbolizer::StringSymbolizePrinter::doPrint(), folly::io::StreamCodec::doUncompress(), folly::dynamic::dynamic(), fizz::detail::ecSign(), fizz::detail::ecVerify(), proxygen::Base64::encode(), proxygen::HPACKEncodeBuffer::encodeLiteral(), fizz::CryptoUtils::equal(), fizz::detail::evpDecrypt(), fizz::detail::evpEncrypt(), proxygen::HTTPHeaders::exists(), folly::symbolizer::Dwarf::findDebugInfoOffset(), proxygen::HTTPHeaders::forEachValueOfHeader(), folly::LogStreamProcessor::formatLogString(), folly::format_value::formatString(), folly::compression::BitVectorCompressedListBase< Pointer >::free(), folly::compression::EliasFanoCompressedListBase< Pointer >::free(), fizz::X25519KeyExchange::generateSharedSecret(), fizz::test::getCert(), fizz::test::getPrivateKey(), fizz::test::getPublicKey(), folly::ssl::OpenSSLHash::Digest::hash_final(), folly::ssl::OpenSSLHash::Hmac::hash_final(), folly::ssl::OpenSSLHash::Hmac::hash_init(), folly::ssl::OpenSSLHash::Digest::hash_update(), folly::ssl::OpenSSLHash::Hmac::hash_update(), folly::symbolizer::Dwarf::LineNumberVM::init(), folly::SSLContext::loadCertificateFromBufferPEM(), folly::SSLContext::loadPrivateKeyFromBufferPEM(), folly::makeConversionError(), fizz::test::MATCHER_P(), folly::mmapFileCopy(), folly::symbolizer::Dwarf::Section::next(), proxygen::RFC1867Codec::onHeadersComplete(), folly::compression::BitVectorEncoder< Value, SkipValue, kSkipQuantum, kForwardQuantum >::Layout::openList(), folly::compression::EliasFanoEncoderV2< Value, SkipValue, kSkipQuantum, kForwardQuantum >::Layout::openList(), folly::gen::StreamSplitter< Callback >::operator()(), proxygen::ParseURL::parse(), folly::bser::parseBser(), proxygen::GzipHeaderCodec::parseNameValues(), folly::parseTo(), fizz::CertUtils::prepareSignData(), folly::io::detail::Writable< Appender >::pushAtMost(), folly::qfind(), folly::symbolizer::Dwarf::readAbbreviation(), readCertFromData(), folly::ssl::OpenSSLCertUtils::readCertsFromBuffer(), readThread(), HPACKBufferTests::releaseData(), proxygen::HTTPHeaders::remove(), fizz::test::HandshakeTest::resetTransportsAndStartCookieHandshake(), folly::rfind(), fizz::detail::rsaPssSign(), fizz::detail::rsaPssVerify(), folly::io::test::CompressionTest::runSimpleStringTest(), folly::symbolizer::Dwarf::Section::Section(), fizz::server::SlidingBloomReplayCache::set(), folly::SocketAddress::setFromPath(), folly::setThreadName(), folly::gen::detail::splitPrefix(), proxygen::HPACKHeaderName::storeAddress(), folly::stringPieceDel(), folly::stringPieceDup(), fizz::server::SlidingBloomReplayCache::test(), TEST(), folly::io::test::TEST(), TEST_F(), fizz::server::SlidingBloomReplayCache::testAndSet(), folly::toAppend(), proxygen::HTTPHeaders::transferHeaderIfPresent(), folly::IOBuf::wrapBuffer(), folly::gen::detail::FileWriter::write(), folly::writeFileAtomic(), folly::writeFileAtomicNoThrow(), folly::ImmediateFileWriter::writeMessage(), and proxygen::compress::HeaderPiece::~HeaderPiece().
|
inline |
Definition at line 443 of file Range.h.
Referenced by folly::io::addOutputBuffer(), folly::RecordIOReader::Iterator::advanceToValid(), folly::gen::detail::StringResplitter::Generator< Source >::apply(), folly::gen::detail::SplitStringSource< DelimiterType >::apply(), folly::symbolizer::SignalSafeElfCache::Path::assign(), folly::LogName::cmp(), folly::io::test::compressSome(), folly::io::StreamCodec::compressStream(), folly::gen::detail::consumeFixedSizeChunks(), proxygen::HTTPMessage::createUrl(), folly::detail::delimFront(), folly::io::StreamCodec::doCompress(), folly::io::StreamCodec::doUncompress(), fizz::HkdfImpl< Hash >::extract(), folly::symbolizer::Dwarf::findAddress(), folly::symbolizer::Dwarf::LineNumberVM::findAddress(), folly::symbolizer::Dwarf::findLocation(), fizz::tool::fizzClientCommand(), folly::FormatArg::FormatArg(), fizz::client::test::AsyncFizzClientTest::fullHandshakeSuccess(), folly::symbolizer::Dwarf::LineNumberVM::getIncludeDirectory(), folly::LogName::getParent(), proxygen::ParseURL::hasHost(), folly::initLogging(), folly::detail::internalSplit(), folly::ltrimWhitespace(), folly::makeConversionError(), folly::TDigest::merge(), folly::symbolizer::Dwarf::Section::next(), folly::symbolizer::Dwarf::LineNumberVM::nextDefineFile(), proxygen::HTTP1xCodec::onIngress(), folly::GoogleLogger< Style >::operator()(), folly::gen::StreamSplitter< Callback >::operator()(), proxygen::ParseURL::parseNonFully(), folly::symbolizer::Dwarf::Path::Path(), folly::qfind(), folly::symbolizer::Dwarf::readAbbreviation(), folly::symbolizer::Dwarf::LineNumberVM::readFileName(), folly::rfind(), folly::rtrimWhitespace(), folly::symbolizer::Dwarf::Section::Section(), folly::symbolizer::Dwarf::Path::size(), folly::io::test::StreamingCompressionTest::split(), proxygen::HTTPMessage::splitNameValue(), proxygen::ParseURL::stripBrackets(), folly::test::TEST(), TEST(), fizz::test::TEST_F(), folly::test::testVarint(), folly::symbolizer::Dwarf::Path::toBuffer(), folly::symbolizer::Dwarf::Path::toString(), folly::json_pointer::try_parse(), TYPED_TEST(), folly::io::Codec::uncompress(), folly::io::StreamCodec::uncompressStream(), folly::Uri::Uri(), and folly::gen::detail::FileWriter::write().
|
inline |
Definition at line 455 of file Range.h.
Referenced by proxygen::caseInsensitiveEqual(), folly::cEscape(), checkResplitMaxLength(), folly::cUnescape(), folly::compression::EliasFanoEncoderV2< Value, SkipValue, kSkipQuantum, kForwardQuantum >::EliasFanoEncoderV2(), folly::detail::RangeEnumerator< Range >::end(), folly::json::escapeStringImpl(), folly::detail::estimatesFromDigest(), fizz::KeyDerivationImpl< Hash >::expandLabel(), folly::symbolizer::Dwarf::findLocation(), folly::recordio_helpers::findRecord(), folly::detail::TransparentRangeHash< detail::ValueTypeForTransparentConversionToRange< T >::type >::hashImpl(), folly::test::detail::hasPCREPatternMatch(), folly::symbolizer::Dwarf::LineNumberVM::init(), SimpleDigest< MergeSize >::merge(), folly::TDigest::merge(), folly::symbolizer::Dwarf::Section::next(), proxygen::HTTP1xCodec::onHeaderField(), folly::MacAddress::parse(), proxygen::RFC2616::parseByteRangeSpec(), folly::CustomLogFormatter::parseFormatString(), folly::parseTo(), folly::detail::parseToWrap(), folly::qfind(), folly::qfind_first_of(), folly::symbolizer::Dwarf::Section::Section(), folly::Range< unsigned char * >::split_step(), folly::detail::splitFixed(), proxygen::HPACKHeaderName::storeAddress(), TEST(), testRangeFunc(), folly::symbolizer::Dwarf::Path::toString(), folly::tryDecodeVarint(), TYPED_TEST(), folly::compression::EliasFanoCompressedListBase< Pointer >::upperSize(), folly::Uri::Uri(), folly::uriEscape(), and folly::uriUnescape().
|
inline |
Does this Range end with another range?
Definition at line 849 of file Range.h.
Referenced by proxygen::compress::CompressionSimulator::getScheme(), ReadStats::messageReceived(), ReadStats::parseMessage(), folly::symbolizer::Dwarf::Path::size(), TEST(), and folly::symbolizer::Dwarf::Path::toBuffer().
|
inline |
|
inline |
Definition at line 858 of file Range.h.
|
inline |
|
inline |
|
inline |
Definition at line 721 of file Range.h.
Referenced by BENCHMARK(), BENCHMARK_RELATIVE(), folly::recordio_helpers::findRecord(), folly::experimental::EnvironmentState::fromCurrentEnvironment(), folly::getLinuxVersion(), proxygen::compress::CompressionSimulator::getScheme(), proxygen::ParseURL::hostIsIPAddress(), ReadStats::messageReceived(), ReadStats::parseMessage(), proxygen::ParseURL::parseNonFully(), folly::detail::splitFixed(), proxygen::HTTPMessage::splitNameValue(), folly::gen::detail::splitPrefix(), folly::toAppend(), and proxygen::validateScheme().
|
inline |
Definition at line 725 of file Range.h.
|
inline |
Definition at line 733 of file Range.h.
|
inline |
Definition at line 744 of file Range.h.
|
inline |
Definition at line 749 of file Range.h.
|
inline |
Definition at line 757 of file Range.h.
|
inline |
Definition at line 765 of file Range.h.
|
inline |
Definition at line 773 of file Range.h.
Referenced by BENCHMARK(), and folly::gen::detail::splitPrefix().
|
inline |
Definition at line 777 of file Range.h.
|
inline |
Definition at line 786 of file Range.h.
|
inline |
Definition at line 791 of file Range.h.
|
inline |
Definition at line 795 of file Range.h.
|
inline |
|
inline |
|
inline |
Definition at line 464 of file Range.h.
Referenced by folly::LogName::cmp(), folly::ltrimWhitespace(), folly::prettyToDouble(), and proxygen::ParseURL::stripBrackets().
|
inline |
|
inline |
|
inlineexplicitnoexcept |
explicit operator conversion to any compatible type
A compatible type is one which is constructible with an iterator and a size (preferred), or a pair of iterators (fallback), passed by const-ref.
Participates in overload resolution precisely when the target type is compatible. This allows std::is_constructible compile-time checks to work.
Definition at line 525 of file Range.h.
|
inlineexplicitnoexcept |
|
default |
|
default |
|
delete |
|
inline |
|
inline |
|
inline |
Definition at line 715 of file Range.h.
Referenced by folly::gen::detail::StringResplitter::Generator< Source >::apply(), folly::rtrimWhitespace(), and TYPED_TEST().
|
inline |
|
inline |
Remove the given prefix and return true if the range starts with the given prefix; return false otherwise.
Definition at line 893 of file Range.h.
Referenced by my::parseTo(), folly::symbolizer::Dwarf::Section::Section(), folly::gen::detail::splitPrefix(), and TEST().
|
inline |
Definition at line 896 of file Range.h.
|
inline |
Remove the given suffix and return true if the range ends with the given suffix; return false otherwise.
Definition at line 904 of file Range.h.
Referenced by folly::symbolizer::Dwarf::Section::Section(), and TEST().
|
inline |
|
inline |
Replaces all occurences of 'source' with 'dest'. Returns number of replacements made. Source and dest have to have the same length. Throws if the lengths are different. If 'source' is a pattern that is overlapping with itself, we perform sequential replacement: "aaaaaaa".replaceAll("aa", "ba") –> "bababaa"
Example use:
char in[] = "buffer"; auto msp = MutablesStringPiece(input); EXPECT_EQ(msp.replaceAll("ff","tt"), 1); EXPECT_EQ(msp, "butter");
Definition at line 949 of file Range.h.
|
inline |
Replaces the content of the range, starting at position 'pos', with contents of 'replacement'. Entire 'replacement' must fit into the range. Returns false if 'replacements' does not fit. Example use:
char in[] = "buffer"; auto msp = MutablesStringPiece(input); EXPECT_TRUE(msp.replaceAt(2, "tt")); EXPECT_EQ(msp, "butter");
// not enough space EXPECT_FALSE(msp.replace(msp.size() - 1, "rr")); EXPECT_EQ(msp, "butter"); // unchanged
Definition at line 925 of file Range.h.
|
inline |
Definition at line 421 of file Range.h.
Referenced by createProtectedBuf(), proxygen::HTTPMessage::doHeaderTokenCheck(), folly::format_value::formatString(), folly::MemoryMapping::init(), folly::symbolizer::Dwarf::Section::next(), proxygen::HTTP1xCodec::onHeaderField(), proxygen::RFC1867Codec::onHeadersComplete(), proxygen::GzipHeaderCodec::parseNameValues(), and folly::recordio_helpers::validateRecord().
|
inline |
|
inline |
Definition at line 761 of file Range.h.
Referenced by folly::LogMessage::getFileBaseName(), LoggerTest::pathBasename(), and folly::symbolizer::test::TEST().
|
inline |
Definition at line 431 of file Range.h.
Referenced by proxygen::HTTPHeaders::add(), folly::RecordIOReader::Iterator::advanceToValid(), folly::io::detail::CursorStringAppender::append(), folly::IOBufQueue::append(), folly::MemoryMapping::asRange(), folly::symbolizer::SignalSafeElfCache::Path::assign(), folly::MemoryMapping::asWritableRange(), folly::detail::atDelim(), folly::backslashify(), proxygen::base64Encode(), BENCHMARK(), folly::compression::BitVectorEncoder< Value, SkipValue, kSkipQuantum, kForwardQuantum >::BitVectorEncoder(), folly::bser::bserEncodeString(), folly::LogName::canonicalize(), proxygen::caseInsensitiveEqual(), folly::cEscape(), folly::ssl::OpenSSLHash::check_out_size(), folly::ssl::OpenSSLHash::check_out_size_throw(), fizz::CryptoUtils::clean(), clibAtoiMeasure(), folly::Subprocess::communicate(), folly::io::Codec::compress(), folly::io::StreamCodec::compressStream(), folly::gen::detail::consumeFixedSizeChunks(), folly::IOBuf::copyBuffer(), fizz::jni::createByteArray(), createProtectedBuf(), proxygen::HTTPMessage::createUrl(), folly::cUnescape(), fizz::detail::decFunc(), fizz::detail::decFuncBlocks(), fizz::detail::decodeECPublicKey(), folly::detail::delimSize(), folly::ssl::OpenSSLCertUtils::derDecode(), fizz::KeyDerivationImpl< Hash >::deriveSecret(), folly::io::StreamCodec::doCompress(), folly::symbolizer::FDSymbolizePrinter::doPrint(), folly::symbolizer::FILESymbolizePrinter::doPrint(), folly::symbolizer::StringSymbolizePrinter::doPrint(), folly::io::StreamCodec::doUncompress(), folly::dynamic::dynamic(), fizz::detail::ecSign(), fizz::detail::ecVerify(), proxygen::Base64::encode(), proxygen::huffman::HuffTree::encode(), fizz::encodeHkdfLabel(), proxygen::HPACKEncodeBuffer::encodeLiteral(), fizz::CryptoUtils::equal(), folly::detail::estimatesFromDigest(), folly::estimateSpaceNeeded(), fizz::detail::evpDecrypt(), proxygen::HTTPHeaders::exists(), fizz::HkdfImpl< Hash >::expand(), folly::symbolizer::test::expect(), follyAtoiMeasure(), proxygen::HTTPHeaders::forEachValueOfHeader(), folly::LogStreamProcessor::formatLogString(), folly::CustomLogFormatter::formatMessage(), folly::format_value::formatString(), folly::IPAddressV4::fromBinary(), folly::IPAddressV6::fromBinary(), fizz::X25519KeyExchange::generateSharedSecret(), fizz::test::getCert(), proxygen::huffman::HuffTree::getEncodeSize(), folly::symbolizer::SignalSafeElfCache::getFile(), folly::LogName::getParent(), fizz::test::getPrivateKey(), fizz::test::getPublicKey(), folly::symbolizer::Dwarf::getStringFromStringSection(), folly::ssl::OpenSSLUtils::getTLSClientRandom(), folly::ssl::OpenSSLUtils::getTLSMasterKey(), handwrittenAtoiMeasure(), fizz::Sha< T >::hash(), folly::LogName::hash(), folly::ssl::OpenSSLHash::Hmac::hash_init(), folly::ssl::OpenSSLHash::Digest::hash_update(), folly::ssl::OpenSSLHash::Hmac::hash_update(), folly::detail::TransparentRangeHash< detail::ValueTypeForTransparentConversionToRange< T >::type >::hashImpl(), fizz::Sha< T >::hmac(), folly::symbolizer::Dwarf::LineNumberVM::init(), folly::detail::internalSplit(), folly::RecordIOReader::Iterator::Iterator(), lexicalCastMeasure(), folly::SSLContext::loadCertificateFromBufferPEM(), folly::SSLContext::loadPrivateKeyFromBufferPEM(), folly::makeConversionError(), fizz::test::MATCHER_P(), proxygen::md5Encode(), SimpleDigest< MergeSize >::merge(), folly::TDigest::merge(), folly::mmapFileCopy(), folly::symbolizer::Dwarf::Section::next(), proxygen::HTTP1xCodec::onHeaderField(), proxygen::RFC1867Codec::onHeadersComplete(), proxygen::HTTP1xCodec::onIngress(), folly::gen::StreamSplitter< Callback >::operator()(), EqTraits::operator()(), KeyConvertTraits::operator()(), folly::hasher< folly::Range< T * >, std::enable_if_t< std::is_integral< T >::value, void > >::operator()(), folly::operator<<(), folly::operator==(), proxygen::ParseURL::parse(), folly::bser::parseBser(), folly::CustomLogFormatter::parseFormatString(), ReadStats::parseMessage(), proxygen::GzipHeaderCodec::parseNameValues(), folly::parseTo(), folly::AsyncIOOp::pread(), fizz::CertUtils::prepareSignData(), folly::prettyToDouble(), folly::PriorityLifoSemMPMCQueue< T, kBehavior >::PriorityLifoSemMPMCQueue(), folly::io::detail::Writable< Appender >::push(), folly::io::detail::Writable< Appender >::pushAtMost(), proxygen::HTTP1xCodec::pushHeaderNameAndValue(), folly::AsyncIOOp::pwrite(), folly::qfind(), readCertFromData(), folly::ssl::OpenSSLCertUtils::readCertsFromBuffer(), proxygen::HTTPHeaders::remove(), folly::rfind(), fizz::detail::rsaPssSign(), fizz::detail::rsaPssVerify(), folly::run(), folly::symbolizer::Dwarf::Section::Section(), fizz::server::SlidingBloomReplayCache::set(), folly::MacAddress::setFromBinary(), folly::SocketAddress::setFromPath(), folly::setThreadName(), folly::symbolizer::Dwarf::Path::size(), folly::io::test::StreamingCompressionTest::split(), folly::Range< unsigned char * >::split_step(), proxygen::HTTPMessage::splitNameValue(), folly::gen::detail::splitPrefix(), proxygen::HPACKHeaderName::storeAddress(), folly::stringPieceDel(), folly::stringPieceDup(), folly::stringToLogLevel(), proxygen::ParseURL::stripBrackets(), folly::json::stripComments(), fizz::server::SlidingBloomReplayCache::test(), folly::TEST(), TEST(), TEST_F(), fizz::testing::TEST_P(), folly::io::test::TEST_P(), fizz::server::SlidingBloomReplayCache::testAndSet(), testRangeFunc(), folly::test::testVarint(), folly::toAppend(), folly::toLowerAscii(), proxygen::HTTPHeaders::transferHeaderIfPresent(), fizz::transformBufferBlocks(), fizz::trimBytes(), folly::io::Codec::uncompress(), folly::io::StreamCodec::uncompressStream(), folly::detail::SlowFingerprint< BITS >::update(), folly::uriEscape(), folly::uriUnescape(), proxygen::CodecUtil::validateHeaderName(), folly::recordio_helpers::validateRecord(), folly::IOBuf::wrapBuffer(), folly::gen::detail::FileWriter::write(), folly::writeFileAtomic(), folly::writeFileAtomicNoThrow(), folly::ImmediateFileWriter::writeMessage(), and fizz::XOR().
|
inline |
Splits this Range
[b, e)
in the position i
dictated by the next occurence of delimiter
.
Returns a new Range
[b, i)
and adjusts this range to start right after the delimiter's position. This range will be empty if the delimiter is not found. If called on an empty Range
, both this and the returned Range
will be empty.
Example:
folly::StringPiece s("sample string for split_next"); auto p = s.split_step(' ');
// prints "string for split_next" cout << s << endl;
// prints "sample" cout << p << endl;
Example 2:
void tokenize(StringPiece s, char delimiter) { while (!s.empty()) { cout << s.split_step(delimiter); } }
Definition at line 1001 of file Range.h.
Referenced by TEST().
|
inline |
|
inline |
Convenience method that calls split_step()
and passes the result to a functor, returning whatever the functor does. Any additional arguments args
passed to this function are perfectly forwarded to the functor.
Say you have a functor with this signature:
Foo fn(Range r) { }
split_step()
's return type will be Foo
. It works just like:
auto result = fn(myRange.split_step(' '));
A functor returning void
is also supported.
Example:
void do_some_parsing(folly::StringPiece s) { auto version = s.split_step(' ', [&](folly::StringPiece x) { if (x.empty()) { throw std::invalid_argument("empty string"); } return std::strtoull(x.begin(), x.end(), 16); });
// ... }
struct Foo { void parse(folly::StringPiece s) { s.split_step(' ', parse_field, bar, 10); s.split_step('', parse_field, baz, 20);
auto const kludge = [](folly::StringPiece x, int &out, int def) { if (x == "null") { out = 0; } else { parse_field(x, out, def); } };
s.split_step('', kludge, gaz); s.split_step(' ', kludge, foo); }
private: int bar; int baz; int gaz; int foo;
static parse_field(folly::StringPiece s, int &out, int def) { try { out = folly::to<int>(s); } catch (std::exception const &) { value = def; } } };
Definition at line 1087 of file Range.h.
|
inline |
|
inline |
Definition at line 449 of file Range.h.
Referenced by folly::detail::atDelim(), folly::detail::delimFront(), folly::detail::internalSplit(), folly::operator<<(), and folly::detail::SlowFingerprint< BITS >::update().
|
inline |
Does this Range start with another range?
Definition at line 828 of file Range.h.
Referenced by folly::getXlogCategoryNameForFile(), proxygen::HeaderDecodeInfo::onHeader(), proxygen::RFC2616::parseByteRangeSpec(), folly::parseLogConfig(), ReadStats::parseMessage(), folly::prettyToDouble(), folly::symbolizer::Dwarf::Section::Section(), and TEST().
|
inline |
|
inline |
Definition at line 837 of file Range.h.
|
inline |
Definition at line 591 of file Range.h.
Referenced by folly::FunctionScheduler::addFunctionConsistentDelay(), folly::FunctionScheduler::addFunctionOnce(), folly::FunctionScheduler::addFunctionUniformDistribution(), wangle::LoadShedConfiguration::addWhitelistAddr(), folly::AsyncFileWriter::AsyncFileWriter(), BENCHMARK(), BENCHMARK_RELATIVE(), proxygen::HTTPMessage::createUrl(), folly::NestedCommandLineApp::doRun(), example::ExampleObject::ExampleObject(), folly::symbolizer::test::expect(), folly::settings::Snapshot::getAsString(), folly::symbolizer::ElfCache::getFile(), fizz::Factory::getHkdfPrefix(), proxygen::compress::CompressionSimulator::getScheme(), folly::settings::getSettingsMeta(), proxygen::ParseURL::hostAndPort(), proxygen::ParseURL::hostIsIPAddress(), folly::ImmediateFileWriter::ImmediateFileWriter(), folly::LogHandlerConfig::LogHandlerConfig(), my::makeConversionError(), folly::NestedCommandLineApp::NestedCommandLineApp(), proxygen::RFC1867Codec::onHeadersComplete(), StubLogger::operator()(), proxygen::ParseURL::parse(), proxygen::SPDYCodec::parseHeaders(), proxygen::ParseURL::parseNonFully(), LoggerTest::pathBasename(), folly::PrintTo(), folly::FileHandlerFactory::WriterFactory::processOption(), folly::StreamHandlerFactory::WriterFactory::processOption(), folly::settings::Snapshot::resetToDefault(), proxygen::HTTPRequestVerifier::setAuthority(), folly::settings::detail::SettingCore< T >::setFromString(), folly::settings::Snapshot::setFromString(), proxygen::HTTPMessage::setMethod(), folly::NamedThreadFactory::setNamePrefix(), proxygen::HTTPRequestVerifier::setPath(), folly::setThreadName(), folly::FunctionScheduler::setThreadName(), proxygen::HTTPMessage::setURL(), proxygen::HTTPMessage::splitNameValue(), folly::symbolizer::test::TEST(), fizz::testing::TEST(), folly::test::TEST(), TEST(), fizz::test::TEST_F(), fizz::testing::TEST_P(), folly::TestLogHandlerFactory::TestLogHandlerFactory(), folly::test::WriteFileAtomic::tmpPath(), folly::IPAddressV4::toLong(), ReadStats::trailingData(), folly::LoggerDB::unregisterHandlerFactory(), proxygen::URL::URL(), folly::writeFileAtomic(), folly::AsyncFileWriter::writeMessage(), and folly::FunctionScheduler::~FunctionScheduler().
|
inline |
Definition at line 686 of file Range.h.
Referenced by BENCHMARK(), clibAtoiMeasure(), follyAtoiMeasure(), folly::format_value::formatNumber(), folly::experimental::EnvironmentState::fromCurrentEnvironment(), getContainingDirectory(), folly::LogMessage::getFileBaseName(), folly::getLinuxVersion(), handwrittenAtoiMeasure(), folly::detail::internalSplit(), lexicalCastMeasure(), Lines_Gen(), ReadStats::messageReceived(), folly::compression::BitVectorEncoder< Value, SkipValue, kSkipQuantum, kForwardQuantum >::Layout::openList(), folly::compression::EliasFanoEncoderV2< Value, SkipValue, kSkipQuantum, kForwardQuantum >::Layout::openList(), proxygen::ParseURL::parse(), ReadStats::parseMessage(), proxygen::ParseURL::parseNonFully(), LoggerTest::pathBasename(), folly::setThreadName(), folly::io::test::StreamingCompressionTest::split(), proxygen::HTTPMessage::splitNameValue(), proxygen::ParseURL::stripBrackets(), folly::json::stripComments(), TEST(), and proxygen::validateScheme().
|
inline |
Definition at line 679 of file Range.h.
Referenced by folly::gen::detail::SplitStringSource< DelimiterType >::apply(), ReadStats::parseMessage(), and TEST().
|
inline |
|
inlinenoexcept |
explicit non-operator conversion to any compatible type
A compatible type is one which is constructible with an iterator and a size (preferred), or a pair of iterators (fallback), passed by const-ref.
Participates in overload resolution precisely when the target type is compatible. This allows is_invocable compile-time checks to work.
Provided in addition to the explicit operator conversion to permit passing additional arguments to the target type constructor. A canonical example of an additional argument might be an allocator, where the target type is some specialization of std::vector or std::basic_string in a context which requires a non-default-constructed allocator.
Definition at line 574 of file Range.h.
|
inlinenoexcept |
|
inline |
Definition at line 594 of file Range.h.
Referenced by folly::FormatValue< dynamic >::format(), and folly::experimental::EnvironmentState::fromCurrentEnvironment().
|
inline |
Definition at line 695 of file Range.h.
Referenced by folly::LogName::cmp(), folly::io::StreamCodec::doUncompress(), folly::io::test::StreamingCompressionTest::split(), and folly::tryDecodeVarint().
|
inline |
|
inline |
|
inline |
|
private |
Definition at line 1099 of file Range.h.
Referenced by folly::Range< unsigned char * >::swap().
|
private |
Definition at line 1099 of file Range.h.
Referenced by folly::Range< unsigned char * >::swap().
|
static |
Definition at line 197 of file Range.h.
Referenced by folly::experimental::EnvironmentState::fromCurrentEnvironment().