diff options
| author | наб <nabijaczleweli@nabijaczleweli.xyz> | 2025-01-23 20:37:35 +0100 |
|---|---|---|
| committer | Julian Andres Klode <julian.klode@canonical.com> | 2025-02-14 19:45:12 +0100 |
| commit | 384cfa1fe9dfd30b35d6f8b0ae87be643ab75d06 (patch) | |
| tree | cbda3ac7c585141a4900d41a7162be78f9a61150 /apt-pkg/contrib/strutl.h | |
| parent | 7f4c339d6fe19ff7e26144e373a6e5c73344539f (diff) | |
Return string_view from Apt::String::Strip(). Take string_view in VectorizeString(), StringSplit(), SubstVar()
Diffstat (limited to 'apt-pkg/contrib/strutl.h')
| -rw-r--r-- | apt-pkg/contrib/strutl.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/apt-pkg/contrib/strutl.h b/apt-pkg/contrib/strutl.h index 7e6aba272..92df7c9d3 100644 --- a/apt-pkg/contrib/strutl.h +++ b/apt-pkg/contrib/strutl.h @@ -42,7 +42,7 @@ namespace { namespace APT { namespace String { - APT_PUBLIC std::string Strip(std::string_view s); + APT_PUBLIC std::string_view Strip(std::string_view s); APT_PUBLIC bool Endswith(const std::string_view &s, const std::string_view &ending); APT_PUBLIC bool Startswith(const std::string_view &s, const std::string_view &starting); APT_PUBLIC std::string Join(std::vector<std::string> list, const std::string_view &sep); @@ -111,7 +111,7 @@ APT_PUBLIC bool TokSplitString(char Tok,char *Input,char **List, unsigned long ListMax); // split a given string by a char -APT_PUBLIC std::vector<std::string> VectorizeString(std::string const &haystack, char const &split) APT_PURE; +APT_PUBLIC std::vector<std::string> VectorizeString(std::string_view const &haystack, char const &split) APT_PURE; /* \brief Return a vector of strings from string "input" where "sep" * is used as the delimiter string. @@ -127,8 +127,8 @@ APT_PUBLIC std::vector<std::string> VectorizeString(std::string const &haystack, * if used the string is only split on maxsplit places and the last * item in the vector contains the remainder string. */ -APT_PUBLIC std::vector<std::string> StringSplit(std::string const &input, - std::string const &sep, +APT_PUBLIC std::vector<std::string> StringSplit(std::string_view const &input, + std::string_view const &sep, unsigned int maxsplit=std::numeric_limits<unsigned int>::max()) APT_PURE; @@ -248,7 +248,7 @@ struct SubstVar const std::string *Contents; }; APT_PUBLIC std::string SubstVar(std::string Str,const struct SubstVar *Vars); -APT_PUBLIC std::string SubstVar(const std::string &Str,const std::string &Subst,const std::string &Contents); +APT_PUBLIC std::string SubstVar(const std::string_view &Str,const std::string_view &Subst,const std::string_view &Contents); struct RxChoiceList { |
