9#ifndef ZYPP_NG_CORE_STRING_H_INCLUDED
10#define ZYPP_NG_CORE_STRING_H_INCLUDED
14#include <boost/utility/string_view.hpp>
27 const int entryVal = zypp::str::strtonum<T>( val.data() );
34 template<
typename StrType,
typename T = std::remove_reference_t<StrType> >
37 T
ret( std::forward<StrType>(
s) );
44 typename T::size_type
p =
ret.find_first_not_of(
" \t\r\n" );
47 if constexpr ( std::is_same_v<std::string_view, StrType> )
54 ret.remove_prefix(
p );
59 typename T::size_type
p =
ret.find_last_not_of(
" \t\r\n" );
62 if constexpr ( std::is_same_v<std::string_view, StrType> )
69 ret.remove_suffix(
ret.size() - (
p+1 ) );
75 template<
class TOutputIterator>
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
String related utilities and Regular expression matching.
Trim
To define how to trim.
std::string strerror(int errno_r)
Return string describing the error_r code.
unsigned split(const C_Str &line_r, TOutputIterator result_r, const C_Str &sepchars_r=" \t", const Trim trim_r=NO_TRIM)
Split line_r into words.
std::string trim(const std::string &s, const Trim trim_r)
std::optional< T > safe_strtonum(const std::string_view &val)