MCPcopy Create free account
hub / github.com/ChaiScript/ChaiScript / numberOfCharacters

Method numberOfCharacters

unittests/catch.hpp:9710–9724  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9708 }
9709
9710 auto StringRef::numberOfCharacters() const noexcept -> size_type {
9711 size_type noChars = m_size;
9712 // Make adjustments for uft encodings
9713 for( size_type i=0; i < m_size; ++i ) {
9714 char c = m_start[i];
9715 if( ( c & byte_2_lead ) == byte_2_lead ) {
9716 noChars--;
9717 if (( c & byte_3_lead ) == byte_3_lead )
9718 noChars--;
9719 if( ( c & byte_4_lead ) == byte_4_lead )
9720 noChars--;
9721 }
9722 }
9723 return noChars;
9724 }
9725
9726 auto operator + ( StringRef const& lhs, StringRef const& rhs ) -> std::string {
9727 std::string str;

Callers 1

TablePrinterClass · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected