proxygen
folly::detail::StringPieceLite Class Reference

#include <RangeCommon.h>

Public Member Functions

 StringPieceLite (const char *b, const char *e)
 
template<typename Range >
 StringPieceLite (const Range &r)
 
const char * data () const
 
const char * begin () const
 
const char * end () const
 
size_t size () const
 
bool empty () const
 
const char & operator[] (size_t i) const
 
template<typename Range >
 operator Range () const
 

Private Attributes

const char * b_
 
const char * e_
 

Detailed Description

Definition at line 37 of file RangeCommon.h.

Constructor & Destructor Documentation

folly::detail::StringPieceLite::StringPieceLite ( const char *  b,
const char *  e 
)
inline

Definition at line 39 of file RangeCommon.h.

39 : b_(b), e_(e) {}
char b
template<typename Range >
folly::detail::StringPieceLite::StringPieceLite ( const Range r)
inline

Definition at line 41 of file RangeCommon.h.

42  : StringPieceLite(r.data(), r.data() + r.size()) {}
StringPieceLite(const char *b, const char *e)
Definition: RangeCommon.h:39

Member Function Documentation

const char* folly::detail::StringPieceLite::begin ( ) const
inline

Definition at line 46 of file RangeCommon.h.

References b_.

Referenced by operator Range(), and folly::detail::qfind_first_byte_of_std().

46  {
47  return b_;
48  }
const char* folly::detail::StringPieceLite::data ( ) const
inline

Definition at line 43 of file RangeCommon.h.

References b_.

Referenced by folly::detail::qfind_first_byte_of_sse42().

43  {
44  return b_;
45  }
bool folly::detail::StringPieceLite::empty ( ) const
inline

Definition at line 55 of file RangeCommon.h.

References size().

Referenced by folly::detail::qfind_first_byte_of_nosse(), and folly::detail::qfind_first_byte_of_sse42().

55  {
56  return size() == 0;
57  }
const char* folly::detail::StringPieceLite::end ( ) const
inline

Definition at line 49 of file RangeCommon.h.

References e_.

Referenced by operator Range(), folly::detail::qfind_first_byte_of_sse42(), and folly::detail::qfind_first_byte_of_std().

49  {
50  return e_;
51  }
template<typename Range >
folly::detail::StringPieceLite::operator Range ( ) const
inlineexplicit

Definition at line 63 of file RangeCommon.h.

References begin(), and end().

63  {
64  return Range(begin(), end());
65  }
const char * begin() const
Definition: RangeCommon.h:46
const char * end() const
Definition: RangeCommon.h:49
const char& folly::detail::StringPieceLite::operator[] ( size_t  i) const
inline

Definition at line 58 of file RangeCommon.h.

References b_, i, and size().

58  {
59  DCHECK_GT(size(), i);
60  return b_[i];
61  }
size_t folly::detail::StringPieceLite::size ( ) const
inline

Member Data Documentation

const char* folly::detail::StringPieceLite::b_
private

Definition at line 68 of file RangeCommon.h.

Referenced by begin(), data(), operator[](), and size().

const char* folly::detail::StringPieceLite::e_
private

Definition at line 69 of file RangeCommon.h.

Referenced by end(), and size().


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