0
Files
src/pdf/text_search.h
Lei Zhang 68cd51a0be Move PDF text search code into its own standalone function.
The code in PdfViewWebPlugin::SearchString() has little to do with the
rest of PdfViewWebPlugin. Make it a standalone function, and use it to
replace the text search code used for testing in FindTextTestClient. The
function can also be easily unit tested in the future.

Change-Id: Ic359757c0c299be1b7f792158902c60e391bd916
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4137334
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Alan Screen <awscreen@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1369464}
2024-10-16 16:43:53 +00:00

23 lines
525 B
C++

// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef PDF_TEXT_SEARCH_H_
#define PDF_TEXT_SEARCH_H_
#include <string>
#include <vector>
#include "pdf/pdfium/pdfium_engine_client.h"
namespace chrome_pdf {
std::vector<PDFiumEngineClient::SearchStringResult> TextSearch(
const std::u16string& needle,
const std::u16string& haystack,
bool case_sensitive);
} // namespace chrome_pdf
#endif // PDF_TEXT_SEARCH_H_