| 3780 | } |
| 3781 | |
| 3782 | void write_string(const char_t* data) |
| 3783 | { |
| 3784 | // write the part of the string that fits in the buffer |
| 3785 | size_t offset = bufsize; |
| 3786 | |
| 3787 | while (*data && offset < bufcapacity) |
| 3788 | buffer[offset++] = *data++; |
| 3789 | |
| 3790 | // write the rest |
| 3791 | if (offset < bufcapacity) |
| 3792 | { |
| 3793 | bufsize = offset; |
| 3794 | } |
| 3795 | else |
| 3796 | { |
| 3797 | // backtrack a bit if we have split the codepoint |
| 3798 | size_t length = offset - bufsize; |
| 3799 | size_t extra = length - get_valid_length(data - length, length); |
| 3800 | |
| 3801 | bufsize = offset - extra; |
| 3802 | |
| 3803 | write_direct(data - extra, strlength(data) + extra); |
| 3804 | } |
| 3805 | } |
| 3806 | |
| 3807 | void write(char_t d0) |
| 3808 | { |
no test coverage detected