MCPcopy Create free account
hub / github.com/Tencent/rapidjson / CountStringCodePoint

Function CountStringCodePoint

include/rapidjson/internal/strfunc.h:38–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36//! Returns number of code points in a encoded string.
37template<typename Encoding>
38bool CountStringCodePoint(const typename Encoding::Ch* s, SizeType length, SizeType* outCount) {
39 GenericStringStream<Encoding> is(s);
40 const typename Encoding::Ch* end = s + length;
41 SizeType count = 0;
42 while (is.src_ < end) {
43 unsigned codepoint;
44 if (!Encoding::Decode(is, &codepoint))
45 return false;
46 count++;
47 }
48 *outCount = count;
49 return true;
50}
51
52} // namespace internal
53RAPIDJSON_NAMESPACE_END

Callers

nothing calls this directly

Calls 1

DecodeFunction · 0.85

Tested by

no test coverage detected