apt: StringView Class Reference

apt 2.7.5 commandline package manager

Public Member Functions | Static Public Attributes | List of all members
StringView Class Reference

Simple subset of std::string_view from C++17. More...

`#include <apt-pkg/contrib/string_view.h>`

## Public Member Functions
constexpr | StringView (const char *data, size_t size)
| StringView (const char *data)
| StringView (std::string const &str)
void | remove_prefix (size_t n)
void | remove_suffix (size_t n)
void | clear ()
constexpr StringView | substr (size_t pos, size_t n=npos) const
size_t | find (int c, size_t pos) const
size_t | find (int c) const
size_t | rfind (int c, size_t pos) const
size_t | rfind (int c) const
size_t | find (APT::StringView const needle) const
size_t | find (APT::StringView const needle, size_t pos) const
std::string | to_string () const
int | compare (size_t pos, size_t n, StringView other) const
int | compare (StringView other) const
bool | operator== (StringView other) const
bool | operator!= (StringView other) const
constexpr bool | empty () const
constexpr const char * | data () const
constexpr const char * | begin () const
constexpr const char * | end () const
constexpr char | operator[] (size_t i) const
constexpr size_t | size () const
constexpr size_t | length () const

## Static Public Attributes
static constexpr size_t | npos = static_cast<size_t>(-1)

## Detailed Description

Simple subset of std::string_view from C++17.

This is an internal implementation of the subset of std::string_view used by APT. It is not meant to be used in programs, only inside the library for performance critical paths.

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

- apt-pkg/contrib/string_view.h