MCPcopy Create free account
hub / github.com/Genivia/RE-flex / wstring_size

Method wstring_size

lib/input.cpp:1070–1096  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1068}
1069
1070void Input::wstring_size()
1071{
1072 unsigned int c;
1073 for (const wchar_t *s = wstring_; (c = *s) != L'\0'; ++s)
1074 {
1075 if (c >= 0xD800 && c < 0xE000)
1076 {
1077 if (c < 0xDC00 && (s[1] & 0xFC00) == 0xDC00)
1078 {
1079 ++s;
1080 size_ += 4;
1081 }
1082 else
1083 {
1084 size_ += sizeof(REFLEX_NONCHAR_UTF8) - 1; // REFLEX_NONCHAR_UTF8 is a literal string, not a pointer
1085 }
1086 }
1087 else
1088 {
1089#ifndef WITH_UTF8_UNRESTRICTED
1090 size_ += 1 + (c >= 0x80) + (c >= 0x0800) + (c >= 0x010000);
1091#else
1092 size_ += 1 + (c >= 0x80) + (c >= 0x0800) + (c >= 0x010000) + (c >= 0x200000) + (c >= 0x04000000);
1093#endif
1094 }
1095 }
1096}
1097
1098void Input::file_size()
1099{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected