summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/string_view.h
Commit message (Collapse)AuthorAgeFilesLines
* string_view: Drop constexpr constructor for standard compatibilityJulian Andres Klode2016-01-151-10/+4
| | | | | | | | | | | | | APT::StringView is supposed to be a temporary measure, until support for the standardized string_view is widely available. Introducing additional unstandardized features just makes porting to the standard version harder. The constexpr constructor also won't have any real effect on most systems, as the compiler will happily optimise the strlen() call away for constant strings. Gbp-Dch: ignore
* provide a constexpr char[] overload for APT::StringViewDavid Kalnischkies2016-01-151-4/+10
| | | | | | The commit also adds a few trivial tests Git-Dch: Ignore
* return correct position in APT::StringView::(r)findDavid Kalnischkies2016-01-151-8/+16
| | | | | | | The position returned is supposed to be the position of the character counted from the start of the string, but if we used the substr calling overloads the skipped over prefix wasn't considered. The pos parameter of rfind had also the wrong semantic.
* operator==(char*, StringView) use StringView.operator==Julian Andres Klode2016-01-081-1/+1
| | | | | | | | Use the same path for both comparisons, as the operator== path is faster than just calling compare() - it avoids any comparison if the size differs. Gbp-Dch: ignore
* StringView: rfind: pos should be end of substr, not startJulian Andres Klode2016-01-071-1/+1
| | | | Gbp-Dch: ignore
* StringView: pos argument default should be nposJulian Andres Klode2016-01-071-2/+2
| | | | Gbp-Dch: ignore
* StringView::rfind(): Call rfind() instead of find() on substJulian Andres Klode2016-01-071-1/+1
| | | | | Thanks: Niels Thykier for reporting on IRC Gbp-Dch: ignore
* Introduce internal APT::StringView classJulian Andres Klode2016-01-071-0/+112
The class APT::StringView implements a drop-in replacement for a subset of C++17 std::string_view() features. It will be dropped at a later point and may not be used in public interfaces.