proxygen
folly::dummy_fbstring_core< Char > Class Template Reference

#include <FBString.h>

Public Member Functions

 dummy_fbstring_core ()
 
 dummy_fbstring_core (const dummy_fbstring_core &another)
 
 dummy_fbstring_core (const Char *s, size_t n)
 
void swap (dummy_fbstring_core &rhs)
 
const Char * data () const
 
Char * mutableData ()
 
void shrink (size_t delta)
 
Char * expandNoinit (size_t delta)
 
void push_back (Char c)
 
size_t size () const
 
size_t capacity () const
 
bool isShared () const
 
void reserve (size_t minCapacity)
 

Private Attributes

std::basic_string< Char > backend_
 

Detailed Description

template<class Char>
class folly::dummy_fbstring_core< Char >

Dummy fbstring core that uses an actual std::string. This doesn't make any sense - it's just for testing purposes.

Definition at line 1011 of file FBString.h.

Constructor & Destructor Documentation

template<class Char >
folly::dummy_fbstring_core< Char >::dummy_fbstring_core ( )
inline

Definition at line 1013 of file FBString.h.

1013 {}
template<class Char >
folly::dummy_fbstring_core< Char >::dummy_fbstring_core ( const dummy_fbstring_core< Char > &  another)
inline

Definition at line 1014 of file FBString.h.

1015  : backend_(another.backend_) {}
std::basic_string< Char > backend_
Definition: FBString.h:1052
template<class Char >
folly::dummy_fbstring_core< Char >::dummy_fbstring_core ( const Char *  s,
size_t  n 
)
inline

Definition at line 1016 of file FBString.h.

1016 : backend_(s, n) {}
std::basic_string< Char > backend_
Definition: FBString.h:1052
static set< string > s

Member Function Documentation

template<class Char >
size_t folly::dummy_fbstring_core< Char >::capacity ( ) const
inline

Definition at line 1041 of file FBString.h.

1041  {
1042  return backend_.capacity();
1043  }
std::basic_string< Char > backend_
Definition: FBString.h:1052
template<class Char >
const Char* folly::dummy_fbstring_core< Char >::data ( ) const
inline

Definition at line 1020 of file FBString.h.

1020  {
1021  return backend_.data();
1022  }
std::basic_string< Char > backend_
Definition: FBString.h:1052
template<class Char >
Char* folly::dummy_fbstring_core< Char >::expandNoinit ( size_t  delta)
inline

Definition at line 1030 of file FBString.h.

References folly::size().

1030  {
1031  auto const sz = size();
1032  backend_.resize(size() + delta);
1033  return backend_.data() + sz;
1034  }
std::basic_string< Char > backend_
Definition: FBString.h:1052
size_t size() const
Definition: FBString.h:1038
template<class Char >
bool folly::dummy_fbstring_core< Char >::isShared ( ) const
inline

Definition at line 1044 of file FBString.h.

1044  {
1045  return false;
1046  }
template<class Char >
Char* folly::dummy_fbstring_core< Char >::mutableData ( )
inline

Definition at line 1023 of file FBString.h.

References testing::gmock_generated_actions_test::Char().

1023  {
1024  return const_cast<Char*>(backend_.data());
1025  }
std::basic_string< Char > backend_
Definition: FBString.h:1052
template<class Char >
void folly::dummy_fbstring_core< Char >::push_back ( Char  c)
inline

Definition at line 1035 of file FBString.h.

1035  {
1036  backend_.push_back(c);
1037  }
std::basic_string< Char > backend_
Definition: FBString.h:1052
char c
template<class Char >
void folly::dummy_fbstring_core< Char >::reserve ( size_t  minCapacity)
inline

Definition at line 1047 of file FBString.h.

1047  {
1048  backend_.reserve(minCapacity);
1049  }
std::basic_string< Char > backend_
Definition: FBString.h:1052
template<class Char >
void folly::dummy_fbstring_core< Char >::shrink ( size_t  delta)
inline

Definition at line 1026 of file FBString.h.

References FBSTRING_ASSERT, and folly::size().

1026  {
1027  FBSTRING_ASSERT(delta <= size());
1028  backend_.resize(size() - delta);
1029  }
std::basic_string< Char > backend_
Definition: FBString.h:1052
#define FBSTRING_ASSERT(expr)
Definition: FBString.h:64
size_t size() const
Definition: FBString.h:1038
template<class Char >
size_t folly::dummy_fbstring_core< Char >::size ( ) const
inline

Definition at line 1038 of file FBString.h.

1038  {
1039  return backend_.size();
1040  }
std::basic_string< Char > backend_
Definition: FBString.h:1052
template<class Char >
void folly::dummy_fbstring_core< Char >::swap ( dummy_fbstring_core< Char > &  rhs)
inline

Definition at line 1017 of file FBString.h.

References folly::dummy_fbstring_core< Char >::backend_.

1017  {
1018  backend_.swap(rhs.backend_);
1019  }
std::basic_string< Char > backend_
Definition: FBString.h:1052
FOLLY_PUSH_WARNING RHS rhs
Definition: Traits.h:649

Member Data Documentation

template<class Char >
std::basic_string<Char> folly::dummy_fbstring_core< Char >::backend_
private

Definition at line 1052 of file FBString.h.

Referenced by folly::dummy_fbstring_core< Char >::swap().


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