MCPcopy Create free account
hub / github.com/brofield/simpleini / AppendCodePoint

Function AppendCodePoint

SimpleIni.h:3078–3100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3076
3077template <class SI_CHAR>
3078inline bool AppendCodePoint(char32_t a_cp, SI_CHAR *&a_dst, SI_CHAR *a_dstEnd) {
3079 if (sizeof(SI_CHAR) >= sizeof(char32_t)) {
3080 if (a_dst >= a_dstEnd)
3081 return false;
3082 *a_dst++ = (SI_CHAR)a_cp;
3083 return true;
3084 }
3085 if (sizeof(SI_CHAR) == 2) {
3086 if (a_cp < 0x10000) {
3087 if (a_dst >= a_dstEnd)
3088 return false;
3089 *a_dst++ = (SI_CHAR)a_cp;
3090 return true;
3091 }
3092 if (a_dst + 1 >= a_dstEnd)
3093 return false;
3094 a_cp -= 0x10000;
3095 *a_dst++ = (SI_CHAR)(0xD800 + (a_cp >> 10));
3096 *a_dst++ = (SI_CHAR)(0xDC00 + (a_cp & 0x3FF));
3097 return true;
3098 }
3099 return false;
3100}
3101
3102template <class SI_CHAR>
3103inline bool ReadCodePoint(const SI_CHAR *&a_src, char32_t &a_cp) {

Callers 1

ConvertFromStoreMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected