MCPcopy Create free account
hub / github.com/audeering/opensmile / CountStringCodePoint

Function CountStringCodePoint

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

Source from the content-addressed store, hash-verified

48//! Returns number of code points in a encoded string.
49template<typename Encoding>
50bool CountStringCodePoint(const typename Encoding::Ch* s, SizeType length, SizeType* outCount) {
51 RAPIDJSON_ASSERT(s != 0);
52 RAPIDJSON_ASSERT(outCount != 0);
53 GenericStringStream<Encoding> is(s);
54 const typename Encoding::Ch* end = s + length;
55 SizeType count = 0;
56 while (is.src_ < end) {
57 unsigned codepoint;
58 if (!Encoding::Decode(is, &codepoint))
59 return false;
60 count++;
61 }
62 *outCount = count;
63 return true;
64}
65
66} // namespace internal
67RAPIDJSON_NAMESPACE_END

Callers

nothing calls this directly

Calls 1

DecodeFunction · 0.85

Tested by

no test coverage detected