MCPcopy Create free account
hub / github.com/comaps/comaps / CountChar

Function CountChar

libs/base/string_utils.hpp:117–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115
116template <std::convertible_to<std::string_view> Utf8>
117size_t CountChar(Utf8 const & utf8)
118{
119 size_t codePoints = 0;
120
121 for (auto const c : utf8)
122 if ((c & 0xC0) != 0x80)
123 ++codePoints;
124
125 return codePoints;
126}
127
128bool Truncate(std::string & utf8, size_t const maxTextLengthPlus1);
129

Callers 14

ValidateWebsiteFunction · 0.85
ValidateFacebookPageFunction · 0.85
ValidateInstagramPageFunction · 0.85
ValidateTwitterPageFunction · 0.85
ValidateVkPageFunction · 0.85
ValidateLinePageFunction · 0.85
ValidateFediversePageFunction · 0.85
ValidateBlueskyPageFunction · 0.85
ValidateFlatsMethod · 0.85
ValidatePhoneListMethod · 0.85
ValidateEmailMethod · 0.85
ValidateLevelMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected