pstore2
Classes | Typedefs | Functions
sstring_view.hpp File Reference

Implements sstring_view, a class which is based on std::string_view but holds a pointer which may be a std::shared_ptr<char> or std::unique_ptr<char> as well has a raw pointer. More...

#include <cstring>
#include "pstore/support/fnv.hpp"
#include "pstore/support/unsigned_cast.hpp"
#include "pstore/support/varint.hpp"
Include dependency graph for sstring_view.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  pstore::string_traits< StringType >
 
struct  pstore::string_traits< std::string >
 
struct  pstore::string_traits< gsl::czstring >
 
struct  pstore::string_traits< char const [Size]>
 
struct  pstore::string_traits< char[Size]>
 
struct  pstore::pointer_traits< PointerType >
 
struct  pstore::pointer_traits< char const * >
 
struct  pstore::details::pointer_traits_helper< T >
 
struct  pstore::pointer_traits< std::shared_ptr< char const > >
 
struct  pstore::pointer_traits< std::shared_ptr< char > >
 
struct  pstore::pointer_traits< std::unique_ptr< char const []> >
 
struct  pstore::pointer_traits< std::unique_ptr< char[]> >
 
class  pstore::sstring_view< PointerType >
 
struct  pstore::string_traits< sstring_view< PointerType > >
 
struct  std::equal_to<::pstore::sstring_view< StringType > >
 
struct  std::hash<::pstore::sstring_view< StringType > >
 

Typedefs

using pstore::shared_sstring_view = sstring_view< std::shared_ptr< char const > >
 
using pstore::unique_sstring_view = sstring_view< std::unique_ptr< char const > >
 
using pstore::raw_sstring_view = sstring_view< gsl::czstring >
 

Functions

template<typename PointerType1 , typename PointerType2 >
bool pstore::operator== (sstring_view< PointerType1 > const &lhs, sstring_view< PointerType2 > const &rhs) noexcept
 
template<typename PointerType , typename StringType >
bool pstore::operator== (sstring_view< PointerType > const &lhs, StringType const &rhs) noexcept
 
template<typename StringType , typename PointerType >
bool pstore::operator== (StringType const &lhs, sstring_view< PointerType > const &rhs) noexcept
 
template<typename PointerType1 , typename PointerType2 >
bool pstore::operator!= (sstring_view< PointerType1 > const &lhs, sstring_view< PointerType2 > const &rhs) noexcept
 
template<typename PointerType , typename StringType >
bool pstore::operator!= (sstring_view< PointerType > const &lhs, StringType const &rhs) noexcept
 
template<typename StringType , typename PointerType >
bool pstore::operator!= (StringType const &lhs, sstring_view< PointerType > const &rhs) noexcept
 
template<typename PointerType1 , typename PointerType2 >
bool pstore::operator>= (sstring_view< PointerType1 > const &lhs, sstring_view< PointerType2 > const &rhs) noexcept
 
template<typename PointerType , typename StringType >
bool pstore::operator>= (sstring_view< PointerType > const &lhs, StringType const &rhs) noexcept
 
template<typename StringType , typename PointerType >
bool pstore::operator>= (StringType const &lhs, sstring_view< PointerType > const &rhs) noexcept
 
template<typename PointerType1 , typename PointerType2 >
bool pstore::operator> (sstring_view< PointerType1 > const &lhs, sstring_view< PointerType2 > const &rhs) noexcept
 
template<typename PointerType , typename StringType >
bool pstore::operator> (sstring_view< PointerType > const &lhs, StringType const &rhs) noexcept
 
template<typename StringType , typename PointerType >
bool pstore::operator> (StringType const &lhs, sstring_view< PointerType > const &rhs) noexcept
 
template<typename PointerType1 , typename PointerType2 >
bool pstore::operator<= (sstring_view< PointerType1 > const &lhs, sstring_view< PointerType2 > const &rhs) noexcept
 
template<typename PointerType , typename StringType >
bool pstore::operator<= (sstring_view< PointerType > const &lhs, StringType const &rhs) noexcept
 
template<typename StringType , typename PointerType >
bool pstore::operator<= (StringType const &lhs, sstring_view< PointerType > const &rhs) noexcept
 
template<typename PointerType1 , typename PointerType2 >
bool pstore::operator< (sstring_view< PointerType1 > const &lhs, sstring_view< PointerType2 > const &rhs) noexcept
 
template<typename PointerType , typename StringType >
bool pstore::operator< (sstring_view< PointerType > const &lhs, StringType const &rhs) noexcept
 
template<typename StringType , typename PointerType >
bool pstore::operator< (StringType const &lhs, sstring_view< PointerType > const &rhs) noexcept
 
template<typename OStream , typename PointerType >
OStream & pstore::operator<< (OStream &os, sstring_view< PointerType > const &str)
 
template<typename ValueType >
sstring_view< std::shared_ptr< ValueType > > pstore::make_shared_sstring_view (std::shared_ptr< ValueType > const &ptr, std::size_t length)
 
shared_sstring_view pstore::make_shared_sstring_view (std::string const &str)
 
shared_sstring_view pstore::make_shared_sstring_view (gsl::czstring str)
 
template<typename ValueType >
sstring_view< std::unique_ptr< ValueType > > pstore::make_unique_sstring_view (std::unique_ptr< ValueType > ptr, std::size_t length)
 
template<std::ptrdiff_t Extent>
raw_sstring_view pstore::make_sstring_view (gsl::span< char const, Extent > const &span)
 
raw_sstring_view pstore::make_sstring_view (char const *const ptr, std::size_t const length)
 
raw_sstring_view pstore::make_sstring_view (gsl::czstring str)
 
raw_sstring_view pstore::make_sstring_view (std::string const &str)
 

Detailed Description

Implements sstring_view, a class which is based on std::string_view but holds a pointer which may be a std::shared_ptr<char> or std::unique_ptr<char> as well has a raw pointer.

This class is intended to improve the performance of the string set – where it avoids the construction of std::string instances – and to enable string values from the database and in-memory string values to be used interchangably.