From 3c5700c255f4603b5df9c6d183d13dd71a083cc3 Mon Sep 17 00:00:00 2001 From: m-holger Date: Sat, 27 May 2023 18:19:52 +0100 Subject: Code tidy - reflow comments and strings --- examples/pdf-count-strings.cc | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'examples/pdf-count-strings.cc') diff --git a/examples/pdf-count-strings.cc b/examples/pdf-count-strings.cc index c70e183e..2061a499 100644 --- a/examples/pdf-count-strings.cc +++ b/examples/pdf-count-strings.cc @@ -1,7 +1,7 @@ // -// This example illustrates the use of QPDFObjectHandle::TokenFilter -// with filterContents. See also pdf-filter-tokens.cc for an example -// that uses QPDFObjectHandle::TokenFilter with addContentTokenFilter. +// This example illustrates the use of QPDFObjectHandle::TokenFilter with filterContents. See also +// pdf-filter-tokens.cc for an example that uses QPDFObjectHandle::TokenFilter with +// addContentTokenFilter. // #include @@ -46,16 +46,15 @@ StringCounter::handleToken(QPDFTokenizer::Token const& token) if (token.getType() == QPDFTokenizer::tt_string) { ++this->count; } - // Preserve input verbatim by passing each token to any specified - // downstream filter. + // Preserve input verbatim by passing each token to any specified downstream filter. writeToken(token); } void StringCounter::handleEOF() { - // Write a comment at the end of the stream just to show how we - // can enhance the output if we want. + // Write a comment at the end of the stream just to show how we can enhance the output if we + // want. write("\n% strings found: "); write(std::to_string(this->count)); } @@ -82,10 +81,9 @@ main(int argc, char* argv[]) int pageno = 0; for (auto& page: QPDFPageDocumentHelper(pdf).getAllPages()) { ++pageno; - // Pass the contents of a page through our string counter. - // If it's an even page, capture the output. This - // illustrates that you may capture any output generated - // by the filter, or you may ignore it. + // Pass the contents of a page through our string counter. If it's an even page, capture + // the output. This illustrates that you may capture any output generated by the filter, + // or you may ignore it. StringCounter counter; if (pageno % 2) { // Ignore output for odd pages. -- cgit v1.2.3-54-g00ecf