summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/strutl.h
diff options
context:
space:
mode:
authorАлексей Шилин <rootlexx@mail.ru>2019-11-23 00:56:46 +0300
committerАлексей Шилин <rootlexx@mail.ru>2019-11-25 19:02:47 +0300
commit6ad35af2b63b32f9070c622b69da1c05535086a0 (patch)
tree334c9f557c360caa72e3ee3122ccf6431e7e817d /apt-pkg/contrib/strutl.h
parent83f2732b10498c4a3abdfbc072da63803557ce9b (diff)
strutl: Add APT::String::DisplayLength() function
Returns string length, but unlike std::string::size() it honors multibyte characters. This allows to properly calculate visible sizes of console messages.
Diffstat (limited to 'apt-pkg/contrib/strutl.h')
-rw-r--r--apt-pkg/contrib/strutl.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/apt-pkg/contrib/strutl.h b/apt-pkg/contrib/strutl.h
index fc02357a8..738480402 100644
--- a/apt-pkg/contrib/strutl.h
+++ b/apt-pkg/contrib/strutl.h
@@ -33,6 +33,8 @@ namespace APT {
bool Endswith(const std::string &s, const std::string &ending);
bool Startswith(const std::string &s, const std::string &starting);
std::string Join(std::vector<std::string> list, const std::string &sep);
+ // Returns string display length honoring multi-byte characters
+ size_t DisplayLength(StringView str);
}
}