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
widetext_buffer.h
Go to the documentation of this file.
1// Copyright 2017 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// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#ifndef CORE_FXCRT_WIDETEXT_BUFFER_H_
8#define CORE_FXCRT_WIDETEXT_BUFFER_H_
9
10#include <stddef.h>
11
12#include "core/fxcrt/binary_buffer.h"
13#include "core/fxcrt/fx_string.h"
14#include "third_party/base/containers/span.h"
15
16namespace fxcrt {
17
18class WideTextBuffer final : public BinaryBuffer {
19 public:
20 // BinaryBuffer:
21 size_t GetLength() const override;
22
23 pdfium::span<wchar_t> GetWideSpan();
24 pdfium::span<const wchar_t> GetWideSpan() const;
25 WideStringView AsStringView() const;
26 WideString MakeString() const;
27
28 void AppendChar(wchar_t wch);
29 void Delete(size_t start_index, size_t count);
30
31 WideTextBuffer& operator<<(ByteStringView ascii);
32 WideTextBuffer& operator<<(const wchar_t* lpsz);
33 WideTextBuffer& operator<<(WideStringView str);
34 WideTextBuffer& operator<<(const WideString& str);
35 WideTextBuffer& operator<<(const WideTextBuffer& buf);
36
37 private:
38 void AppendWideString(WideStringView str);
39
40 // Returned span is the newly-expanded space.
41 pdfium::span<wchar_t> ExpandWideBuf(size_t char_count);
42};
43
44} // namespace fxcrt
45
46using fxcrt::WideTextBuffer;
47
48#endif // CORE_FXCRT_WIDETEXT_BUFFER_H_
std::vector< CFX_FloatRect > GetRects(size_t index) const
WideString GetURL(size_t index) const
UnownedPtr< const CPDF_TextPage > const m_pTextPage
absl::optional< Range > GetTextRange(size_t index) const
CPDF_LinkExtract(const CPDF_TextPage *pTextPage)
absl::optional< Link > CheckWebLink(const WideString &str)
std::vector< Link > m_LinkArray
bool CheckMailLink(WideString *str)
size_t CountLinks() const
CharInfo(const CharInfo &)
UnownedPtr< const CPDF_TextObject > m_pTextObj
int CharIndexFromTextIndex(int text_index) const
WideString GetAllPageText() const
bool GetRect(int rectIndex, CFX_FloatRect *pRect) const
int CountChars() const
WideString GetTextByRect(const CFX_FloatRect &rect) const
const CharInfo & GetCharInfo(size_t index) const
CFX_FloatRect GetCharLooseBounds(size_t index) const
CPDF_TextPage(const CPDF_Page *pPage, bool rtl)
WideString GetTextByObject(const CPDF_TextObject *pTextObj) const
int GetIndexAtPos(const CFX_PointF &point, const CFX_SizeF &tolerance) const
float GetCharFontSize(size_t index) const
int CountRects(int start, int nCount)
int TextIndexFromCharIndex(int char_index) const
std::vector< CFX_FloatRect > GetRectArray(int start, int count) const
WideString GetPageText(int start, int count) const
size_t size() const
WideString & operator=(WideString &&that) noexcept
void TrimRight(wchar_t target)
CharType Back() const
Definition widestring.h:152
pdfium::span< wchar_t > GetWideSpan()
void AppendChar(wchar_t wch)
void Delete(size_t start_index, size_t count)
pdfium::span< const wchar_t > GetWideSpan() const
WideString MakeString() const
WideStringView AsStringView() const
size_t GetLength() const override
bool FXSYS_iswalnum(wchar_t c)
#define FX_DATA_PARTITION_EXCEPTION(T)
WideString operator+(const wchar_t *str1, const WideString &str2)
Definition widestring.h:281