9#ifndef ZYPP_NG_CORE_STRING_H_INCLUDED
10#define ZYPP_NG_CORE_STRING_H_INCLUDED
14#include <boost/utility/string_view.hpp>
26 const int entryVal = zypp::str::strtonum<T>( val.data() );
32 template<
typename StrType,
typename T = std::remove_reference_t<StrType> >
35 T
ret( std::forward<StrType>(
s) );
42 typename T::size_type
p =
ret.find_first_not_of(
" \t\r\n" );
45 if constexpr ( std::is_same_v<std::string_view, StrType> )
52 ret.remove_prefix(
p );
57 typename T::size_type
p =
ret.find_last_not_of(
" \t\r\n" );
60 if constexpr ( std::is_same_v<std::string_view, StrType> )
67 ret.remove_suffix(
ret.size() - (
p+1 ) );
73 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)