if (last)
{ if (!first.validate(last))
{ if (error) *error = last - 1; return0;
} for (;first != last; ++first, ++n_chars) if ((usv = *first) == 0 || first.error()) break;
} else
{ while ((usv = *first) != 0 && !first.error())
{
++first;
++n_chars;
}
}
if (error) *error = first.error() ? first : 0; return n_chars;
}
}
extern"C" {
size_t gr_count_unicode_characters(gr_encform enc, constvoid* buffer_begin, constvoid* buffer_end/*don't go on or past end, If NULL then ignored*/, const void** pError) //Also stops on nul. Any nul is not in the count
{
assert(buffer_begin);
switch (enc)
{ case gr_utf8: return count_unicode_chars<utf8::const_iterator>(buffer_begin, buffer_end, pError); break; case gr_utf16: return count_unicode_chars<utf16::const_iterator>(buffer_begin, buffer_end, pError); break; case gr_utf32: return count_unicode_chars<utf32::const_iterator>(buffer_begin, buffer_end, pError); break; default: return0;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.