Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
code_point_view.cpp
Go to the documentation of this file.
1// Copyright 2024 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "core/fxcrt/code_point_view.h"
6
7#include "core/fxcrt/utf16.h"
8
9#if !defined(WCHAR_T_IS_16_BIT)
10#error "Building on wrong platform".
11#endif
12
13namespace pdfium {
14
16
17CodePointView::~CodePointView() = default;
18
21
22CodePointView::Iterator::~Iterator() = default;
23
24char32_t CodePointView::Iterator::Decode() {
25 if (current_.IsEmpty()) {
26 return kSentinel;
27 }
28 char32_t code_point = current_.Front();
31 if (!next_.IsEmpty() && IsLowSurrogate(next_.Front())) {
33 next_ = next_.Substr(1);
34 }
35 }
36 return code_point;
37}
38
39} // namespace pdfium