| 412 | } |
| 413 | |
| 414 | static constexpr int codepointSize( TextFormat::Encoding enc ) { |
| 415 | switch ( enc ) { |
| 416 | case TextFormat::Encoding::UTF16LE: |
| 417 | case TextFormat::Encoding::UTF16BE: |
| 418 | return 2; |
| 419 | case TextFormat::Encoding::UTF8: |
| 420 | default: |
| 421 | break; |
| 422 | } |
| 423 | return 1; |
| 424 | } |
| 425 | |
| 426 | static inline void searchSubstr( char* data, const size_t& size, size_t& position, |
| 427 | const std::string_view& substr, const std::string_view& substrfb, |