| 1068 | } |
| 1069 | |
| 1070 | void 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 | |
| 1098 | void Input::file_size() |
| 1099 | { |
nothing calls this directly
no outgoing calls
no test coverage detected