#include "core/fpdftext/cpdf_linkextract.h"
#include <wchar.h>
#include <vector>
#include "core/fpdftext/cpdf_textpage.h"
#include "core/fxcrt/fx_extension.h"
#include "core/fxcrt/fx_string.h"
#include "core/fxcrt/fx_system.h"
namespace {
size_t FindWebLinkEnding(const WideString& str, size_t start, size_t end) { … }
void TrimBackwardsToChar(const WideString& str,
wchar_t charToFind,
size_t start,
size_t* end) { … }
size_t TrimExternalBracketsFromWebLink(const WideString& str,
size_t start,
size_t end) { … }
}
CPDF_LinkExtract::CPDF_LinkExtract(const CPDF_TextPage* pTextPage)
: … { … }
CPDF_LinkExtract::~CPDF_LinkExtract() = default;
void CPDF_LinkExtract::ExtractLinks() { … }
std::optional<CPDF_LinkExtract::Link> CPDF_LinkExtract::CheckWebLink(
const WideString& strBeCheck) { … }
bool CPDF_LinkExtract::CheckMailLink(WideString* str) { … }
WideString CPDF_LinkExtract::GetURL(size_t index) const { … }
std::vector<CFX_FloatRect> CPDF_LinkExtract::GetRects(size_t index) const { … }
std::optional<CPDF_LinkExtract::Range> CPDF_LinkExtract::GetTextRange(
size_t index) const { … }