Foxit PDF SDK
foxit::addon::pageeditor::TextSearchReplace类 参考
类 foxit::addon::pageeditor::TextSearchReplace 继承关系图:
foxit::Base

Public 成员函数

 TextSearchReplace (const foxit::pdf::PDFDoc &doc)
 构造函数。 更多...
 
 TextSearchReplace (const TextSearchReplace &other)
 拷贝构造函数。 更多...
 
 ~TextSearchReplace ()
 析构函数。
 
bool IsEmpty () const
 检查当前对象是否为空。 更多...
 
bool operator!= (const TextSearchReplace &other) const
 不等操作符。 更多...
 
TextSearchReplaceoperator= (const TextSearchReplace &other)
 赋值操作符。 更多...
 
bool operator== (const TextSearchReplace &other) const
 相等操作符。 更多...
 
bool ReplaceNext (const WString &replace_text)
 用替换文本替换下一个文本。 更多...
 
bool ReplacePrev (const WString &replace_text)
 用替换文本替换上一个文本。 更多...
 
void SetPattern (const WString &keywords, int page_index, const FindOption &find_option)
 设置关键字和页面索引以进行搜索和替换。 更多...
 
void SetReplaceCallback (ReplaceCallback *replace_callback)
 设置替换回调函数。 更多...
 
- Public 成员函数 继承自 foxit::Base
FS_HANDLE Handle () const
 获取当前对象的句柄。 更多...
 

详细描述

此类可用于搜索和替换文本。 在使用此模块中的任何类或方法之前,请确保 Foxit PDF SDK 已成功初始化 通过函数 common::Library::Initialize 使用包含 "AdvEdit" 模块的密钥。

参见
common::Library

构造及析构函数说明

◆ TextSearchReplace() [1/2]

foxit::addon::pageeditor::TextSearchReplace::TextSearchReplace ( const foxit::pdf::PDFDoc doc)

构造函数。

参数
[in]doc要搜索或替换的有效 PDF 文档对象。 目前,Foxit PDF SDK 不支持对动态 XFA 文档进行替换。

此构造函数用于构造文本搜索替换对象。

◆ TextSearchReplace() [2/2]

foxit::addon::pageeditor::TextSearchReplace::TextSearchReplace ( const TextSearchReplace other)

拷贝构造函数。

参数
[in]other另一个文本搜索替换对象。

成员函数说明

◆ IsEmpty()

bool foxit::addon::pageeditor::TextSearchReplace::IsEmpty ( ) const

检查当前对象是否为空。

当前对象为空时,意味着当前对象无用。

返回
true 表示当前对象为空,而 false 表示不为空。

◆ operator!=()

bool foxit::addon::pageeditor::TextSearchReplace::operator!= ( const TextSearchReplace other) const

不等操作符。

参数
[in]other另一个文本搜索替换对象。此函数将检查当前对象是否与此对象不相等。
返回
true 表示不相等,而 false 表示相等。

◆ operator=()

TextSearchReplace& foxit::addon::pageeditor::TextSearchReplace::operator= ( const TextSearchReplace other)

赋值操作符。

参数
[in]other另一个文本搜索替换对象,其值将被赋给当前对象。
返回
当前对象本身的引用。

◆ operator==()

bool foxit::addon::pageeditor::TextSearchReplace::operator== ( const TextSearchReplace other) const

相等操作符。

参数
[in]other另一个文本搜索替换对象。此函数将检查当前对象是否与此对象相等。
返回
true 表示相等,而 false 表示不相等。

◆ ReplaceNext()

bool foxit::addon::pageeditor::TextSearchReplace::ReplaceNext ( const WString replace_text)

用替换文本替换下一个文本。

参数
[in]replace_text要替换的文本。不应为空字符串。
返回
true 表示成功,false 表示未找到 keywords。 如果用户不想替换,仍然返回 true

◆ ReplacePrev()

bool foxit::addon::pageeditor::TextSearchReplace::ReplacePrev ( const WString replace_text)

用替换文本替换上一个文本。

参数
[in]replace_text要替换的文本。不应为空字符串。
返回
true 表示成功,false 表示未找到 keywords。 如果用户不想替换,仍然返回 true

◆ SetPattern()

void foxit::addon::pageeditor::TextSearchReplace::SetPattern ( const WString keywords,
int  page_index,
const FindOption find_option 
)

设置关键字和页面索引以进行搜索和替换。

参数
[in]keywords要替换的文本内容。不应为空字符串。
[in]page_index将被搜索和替换的页面索引。有效范围:从 0 到 (count-1)。count 由 PDF 文档的函数 PDFDoc::GetPageCount 返回。 这仅用于 TextSearchReplace::ReplacePrevTextSearchReplace::ReplaceNext
[in]find_option查找选项。应该是有效的查找选项对象。
返回
true 表示成功,false 表示失败。

◆ SetReplaceCallback()

void foxit::addon::pageeditor::TextSearchReplace::SetReplaceCallback ( ReplaceCallback replace_callback)

设置替换回调函数。

参数
[in]replace_callback用于替换的回调对象。这应该由用户实现, 可以为 NULL。如果为 NULL,表示找到的文本总是需要被替换。
返回
无。