2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-12-22 10:58:58 +00:00

Rerun format_code (after merging clang-tidy PR)

This commit is contained in:
Jay Berkenbilt 2023-05-20 14:13:09 -04:00
parent 5f02c7c9e7
commit d740c6ccce
65 changed files with 91 additions and 105 deletions

View File

@ -4,9 +4,9 @@
#include <qpdf/QPDFPageDocumentHelper.hh> #include <qpdf/QPDFPageDocumentHelper.hh>
#include <qpdf/QTC.hh> #include <qpdf/QTC.hh>
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <iostream>
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <iostream>
// This program demonstrates extraction of bookmarks using the qpdf // This program demonstrates extraction of bookmarks using the qpdf
// outlines API. Note that all the information shown by this program // outlines API. Note that all the information shown by this program

View File

@ -4,8 +4,8 @@
// that uses QPDFObjectHandle::TokenFilter with addContentTokenFilter. // that uses QPDFObjectHandle::TokenFilter with addContentTokenFilter.
// //
#include <iostream>
#include <cstdlib> #include <cstdlib>
#include <iostream>
#include <qpdf/Pl_StdioFile.hh> #include <qpdf/Pl_StdioFile.hh>
#include <qpdf/QPDF.hh> #include <qpdf/QPDF.hh>

View File

@ -14,9 +14,9 @@
#include <qpdf/QPDFPageDocumentHelper.hh> #include <qpdf/QPDFPageDocumentHelper.hh>
#include <qpdf/QPDFWriter.hh> #include <qpdf/QPDFWriter.hh>
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <cstdlib>
#include <iostream> #include <iostream>
#include <memory> #include <memory>
#include <cstdlib>
static char const* whoami = nullptr; static char const* whoami = nullptr;

View File

@ -200,8 +200,7 @@ class StreamReplacer: public QPDFObjectHandle::StreamDataProvider
public: public:
StreamReplacer(QPDF* pdf); StreamReplacer(QPDF* pdf);
~StreamReplacer() override = default; ~StreamReplacer() override = default;
void void provideStreamData(QPDFObjGen const& og, Pipeline* pipeline) override;
provideStreamData(QPDFObjGen const& og, Pipeline* pipeline) override;
void registerStream( void registerStream(
QPDFObjectHandle stream, QPDFObjectHandle stream,

View File

@ -4,9 +4,9 @@
#include <qpdf/QPDFPageObjectHelper.hh> #include <qpdf/QPDFPageObjectHelper.hh>
#include <qpdf/QPDFWriter.hh> #include <qpdf/QPDFWriter.hh>
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <iostream>
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <iostream>
static char const* whoami = nullptr; static char const* whoami = nullptr;

View File

@ -6,9 +6,9 @@
// //
#include <algorithm> #include <algorithm>
#include <cstdlib>
#include <deque> #include <deque>
#include <iostream> #include <iostream>
#include <cstdlib>
#include <qpdf/QPDF.hh> #include <qpdf/QPDF.hh>
#include <qpdf/QPDFObjectHandle.hh> #include <qpdf/QPDFObjectHandle.hh>

View File

@ -5,9 +5,9 @@
#include <qpdf/QPDFPageObjectHelper.hh> #include <qpdf/QPDFPageObjectHelper.hh>
#include <qpdf/QPDFWriter.hh> #include <qpdf/QPDFWriter.hh>
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <iostream>
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <iostream>
static char const* whoami = nullptr; static char const* whoami = nullptr;
@ -34,8 +34,7 @@ class ImageInverter: public QPDFObjectHandle::StreamDataProvider
{ {
public: public:
~ImageInverter() override = default; ~ImageInverter() override = default;
void void provideStreamData(QPDFObjGen const& og, Pipeline* pipeline) override;
provideStreamData(QPDFObjGen const& og, Pipeline* pipeline) override;
void registerImage( void registerImage(
QPDFObjectHandle image, QPDFObjectHandle image,

View File

@ -5,10 +5,10 @@
#include <qpdf/QPDFWriter.hh> #include <qpdf/QPDFWriter.hh>
#include <qpdf/QTC.hh> #include <qpdf/QTC.hh>
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <iostream>
#include <cstdio> #include <cstdio>
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <iostream>
static char const* version = "1.1"; static char const* version = "1.1";
static char const* whoami = nullptr; static char const* whoami = nullptr;

View File

@ -1,6 +1,6 @@
#include <iostream>
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <iostream>
#include <qpdf/QPDF.hh> #include <qpdf/QPDF.hh>
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>

View File

@ -3,8 +3,8 @@
#include <qpdf/QPDFPageObjectHelper.hh> #include <qpdf/QPDFPageObjectHelper.hh>
#include <qpdf/QPDFWriter.hh> #include <qpdf/QPDFWriter.hh>
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <iostream>
#include <cstdlib> #include <cstdlib>
#include <iostream>
// This program demonstrates use of form XObjects to overlay a page // This program demonstrates use of form XObjects to overlay a page
// from one file onto all pages of another file. The qpdf program's // from one file onto all pages of another file. The qpdf program's

View File

@ -1,5 +1,5 @@
#include <iostream>
#include <cstdlib> #include <cstdlib>
#include <iostream>
#include <qpdf/QIntC.hh> #include <qpdf/QIntC.hh>
#include <qpdf/QPDF.hh> #include <qpdf/QPDF.hh>

View File

@ -3,8 +3,8 @@
#include <qpdf/QPDFPageDocumentHelper.hh> #include <qpdf/QPDFPageDocumentHelper.hh>
#include <qpdf/QPDFWriter.hh> #include <qpdf/QPDFWriter.hh>
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <iostream>
#include <cstdlib> #include <cstdlib>
#include <iostream>
static char const* whoami = nullptr; static char const* whoami = nullptr;

View File

@ -10,9 +10,9 @@
#include <qpdf/QPDFWriter.hh> #include <qpdf/QPDFWriter.hh>
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <cstdlib>
#include <cstring> #include <cstring>
#include <iostream> #include <iostream>
#include <cstdlib>
#include <string> #include <string>
static bool static_id = false; static bool static_id = false;

View File

@ -25,8 +25,8 @@
#include <qpdf/DLL.h> #include <qpdf/DLL.h>
#include <qpdf/PointerHolder.hh> // unused -- remove in qpdf 12 (see #785) #include <qpdf/PointerHolder.hh> // unused -- remove in qpdf 12 (see #785)
#include <memory>
#include <cstddef> #include <cstddef>
#include <memory>
class Buffer class Buffer
{ {

View File

@ -26,8 +26,8 @@
#include <qpdf/PointerHolder.hh> // unused -- remove in qpdf 12 (see #785) #include <qpdf/PointerHolder.hh> // unused -- remove in qpdf 12 (see #785)
#include <qpdf/Types.h> #include <qpdf/Types.h>
#include <memory>
#include <cstdio> #include <cstdio>
#include <memory>
#include <string> #include <string>
// Remember to use QPDF_DLL_CLASS on anything derived from InputSource // Remember to use QPDF_DLL_CLASS on anything derived from InputSource

View File

@ -25,12 +25,12 @@
#include <qpdf/DLL.h> #include <qpdf/DLL.h>
#include <qpdf/Types.h> #include <qpdf/Types.h>
#include <cstdio>
#include <functional> #include <functional>
#include <iostream> #include <iostream>
#include <list> #include <list>
#include <map> #include <map>
#include <memory> #include <memory>
#include <cstdio>
#include <string> #include <string>
#include <string_view> #include <string_view>
#include <vector> #include <vector>
@ -113,8 +113,8 @@ class QPDF
// your own method of retrieving a PDF file, you can subclass // your own method of retrieving a PDF file, you can subclass
// InputSource and use this method. // InputSource and use this method.
QPDF_DLL QPDF_DLL
void void processInputSource(
processInputSource(std::shared_ptr<InputSource>, char const* password = nullptr); std::shared_ptr<InputSource>, char const* password = nullptr);
// Create a PDF from an input source that contains JSON as written // Create a PDF from an input source that contains JSON as written
// by writeJSON (or qpdf --json-output, version 2 or higher). The // by writeJSON (or qpdf --json-output, version 2 or higher). The

View File

@ -497,7 +497,8 @@ class QPDFJob
// Helper functions // Helper functions
static void usage(std::string const& msg); static void usage(std::string const& msg);
static JSON json_schema(int json_version, std::set<std::string>* keys = nullptr); static JSON
json_schema(int json_version, std::set<std::string>* keys = nullptr);
static void parse_object_id( static void parse_object_id(
std::string const& objspec, bool& trailer, int& obj, int& gen); std::string const& objspec, bool& trailer, int& obj, int& gen);
void parseRotationParameter(std::string const&); void parseRotationParameter(std::string const&);

View File

@ -319,8 +319,8 @@ class QPDFPageObjectHelper: public QPDFObjectHelper
// contents, as happens with addContentTokenFilter. See // contents, as happens with addContentTokenFilter. See
// examples/pdf-count-strings.cc for an example. // examples/pdf-count-strings.cc for an example.
QPDF_DLL QPDF_DLL
void void filterContents(
filterContents(QPDFObjectHandle::TokenFilter* filter, Pipeline* next = nullptr); QPDFObjectHandle::TokenFilter* filter, Pipeline* next = nullptr);
// Old name -- calls filterContents() // Old name -- calls filterContents()
QPDF_DLL QPDF_DLL

View File

@ -27,8 +27,8 @@
#include <qpdf/InputSource.hh> #include <qpdf/InputSource.hh>
#include <qpdf/PointerHolder.hh> // unused -- remove in qpdf 12 (see #785) #include <qpdf/PointerHolder.hh> // unused -- remove in qpdf 12 (see #785)
#include <memory>
#include <cstdio> #include <cstdio>
#include <memory>
#include <string> #include <string>
class QPDFTokenizer class QPDFTokenizer

View File

@ -29,12 +29,12 @@
#include <qpdf/DLL.h> #include <qpdf/DLL.h>
#include <qpdf/Types.h> #include <qpdf/Types.h>
#include <cstdio>
#include <functional> #include <functional>
#include <list> #include <list>
#include <map> #include <map>
#include <memory> #include <memory>
#include <set> #include <set>
#include <cstdio>
#include <string> #include <string>
#include <string_view> #include <string_view>
#include <vector> #include <vector>

View File

@ -25,14 +25,14 @@
#include <qpdf/DLL.h> #include <qpdf/DLL.h>
#include <qpdf/PointerHolder.hh> // unused -- remove in qpdf 12 (see #785) #include <qpdf/PointerHolder.hh> // unused -- remove in qpdf 12 (see #785)
#include <qpdf/Types.h> #include <qpdf/Types.h>
#include <cstdio>
#include <cstring> #include <cstring>
#include <ctime>
#include <functional> #include <functional>
#include <list> #include <list>
#include <memory> #include <memory>
#include <stdexcept> #include <stdexcept>
#include <cstdio>
#include <string> #include <string>
#include <ctime>
#include <vector> #include <vector>
class RandomDataProvider; class RandomDataProvider;

View File

@ -2,8 +2,8 @@
#include <qpdf/QIntC.hh> #include <qpdf/QIntC.hh>
#include <algorithm> #include <algorithm>
#include <sstream>
#include <cstring> #include <cstring>
#include <sstream>
BufferInputSource::BufferInputSource( BufferInputSource::BufferInputSource(
std::string const& description, Buffer* buf, bool own_memory) : std::string const& description, Buffer* buf, bool own_memory) :

View File

@ -2,8 +2,8 @@
#include <qpdf/QIntC.hh> #include <qpdf/QIntC.hh>
#include <qpdf/QTC.hh> #include <qpdf/QTC.hh>
#include <stdexcept>
#include <cstring> #include <cstring>
#include <stdexcept>
void void
InputSource::setLastOffset(qpdf_offset_t offset) InputSource::setLastOffset(qpdf_offset_t offset)

View File

@ -1,8 +1,8 @@
#include <qpdf/Pl_ASCII85Decoder.hh> #include <qpdf/Pl_ASCII85Decoder.hh>
#include <qpdf/QTC.hh> #include <qpdf/QTC.hh>
#include <stdexcept>
#include <cstring> #include <cstring>
#include <stdexcept>
Pl_ASCII85Decoder::Pl_ASCII85Decoder(char const* identifier, Pipeline* next) : Pl_ASCII85Decoder::Pl_ASCII85Decoder(char const* identifier, Pipeline* next) :
Pipeline(identifier, next), Pipeline(identifier, next),

View File

@ -1,9 +1,9 @@
#include <qpdf/Pl_Buffer.hh> #include <qpdf/Pl_Buffer.hh>
#include <algorithm> #include <algorithm>
#include <stdexcept>
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <stdexcept>
Pl_Buffer::Pl_Buffer(char const* identifier, Pipeline* next) : Pl_Buffer::Pl_Buffer(char const* identifier, Pipeline* next) :
Pipeline(identifier, next), Pipeline(identifier, next),

View File

@ -24,8 +24,7 @@ namespace
static void static void
error_handler(j_common_ptr cinfo) error_handler(j_common_ptr cinfo)
{ {
auto* jerr = auto* jerr = reinterpret_cast<qpdf_jpeg_error_mgr*>(cinfo->err);
reinterpret_cast<qpdf_jpeg_error_mgr*>(cinfo->err);
char buf[JMSG_LENGTH_MAX]; char buf[JMSG_LENGTH_MAX];
(*cinfo->err->format_message)(cinfo, buf); (*cinfo->err->format_message)(cinfo, buf);
jerr->msg = buf; jerr->msg = buf;
@ -261,8 +260,7 @@ jpeg_buffer_src(j_decompress_ptr cinfo, Buffer* buffer)
void void
Pl_DCT::compress(void* cinfo_p, Buffer* b) Pl_DCT::compress(void* cinfo_p, Buffer* b)
{ {
auto* cinfo = auto* cinfo = reinterpret_cast<jpeg_compress_struct*>(cinfo_p);
reinterpret_cast<jpeg_compress_struct*>(cinfo_p);
#if ( \ #if ( \
(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406) || \ (defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406) || \
@ -316,8 +314,7 @@ Pl_DCT::compress(void* cinfo_p, Buffer* b)
void void
Pl_DCT::decompress(void* cinfo_p, Buffer* b) Pl_DCT::decompress(void* cinfo_p, Buffer* b)
{ {
auto* cinfo = auto* cinfo = reinterpret_cast<jpeg_decompress_struct*>(cinfo_p);
reinterpret_cast<jpeg_decompress_struct*>(cinfo_p);
#if ( \ #if ( \
(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406) || \ (defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406) || \

View File

@ -3,8 +3,8 @@
#include <qpdf/QIntC.hh> #include <qpdf/QIntC.hh>
#include <qpdf/QTC.hh> #include <qpdf/QTC.hh>
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <stdexcept>
#include <cstring> #include <cstring>
#include <stdexcept>
Pl_LZWDecoder::Pl_LZWDecoder( Pl_LZWDecoder::Pl_LZWDecoder(
char const* identifier, Pipeline* next, bool early_code_change) : char const* identifier, Pipeline* next, bool early_code_change) :

View File

@ -4,8 +4,8 @@
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <climits> #include <climits>
#include <stdexcept>
#include <cstring> #include <cstring>
#include <stdexcept>
static int static int
abs_diff(int a, int b) abs_diff(int a, int b)

View File

@ -6,8 +6,8 @@
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <climits> #include <climits>
#include <stdexcept>
#include <cstring> #include <cstring>
#include <stdexcept>
#include <vector> #include <vector>
Pl_TIFFPredictor::Pl_TIFFPredictor( Pl_TIFFPredictor::Pl_TIFFPredictor(

View File

@ -4,13 +4,13 @@
#include <algorithm> #include <algorithm>
#include <atomic> #include <atomic>
#include <cstdlib>
#include <cstring>
#include <limits> #include <limits>
#include <map> #include <map>
#include <memory.h> #include <memory.h>
#include <regex> #include <regex>
#include <sstream> #include <sstream>
#include <cstdlib>
#include <cstring>
#include <vector> #include <vector>
#include <qpdf/BufferInputSource.hh> #include <qpdf/BufferInputSource.hh>
@ -2528,9 +2528,7 @@ QPDF::getCompressibleObjGens()
if (obj.isStream()) { if (obj.isStream()) {
QPDFObjectHandle dict = obj.getDict(); QPDFObjectHandle dict = obj.getDict();
std::set<std::string> keys = dict.getKeys(); std::set<std::string> keys = dict.getKeys();
for (auto iter = keys.rbegin(); for (auto iter = keys.rbegin(); iter != keys.rend(); ++iter) {
iter != keys.rend();
++iter) {
std::string const& key = *iter; std::string const& key = *iter;
QPDFObjectHandle value = dict.getKey(key); QPDFObjectHandle value = dict.getKey(key);
if (key == "/Length") { if (key == "/Length") {
@ -2544,9 +2542,7 @@ QPDF::getCompressibleObjGens()
} }
} else if (obj.isDictionary()) { } else if (obj.isDictionary()) {
std::set<std::string> keys = obj.getKeys(); std::set<std::string> keys = obj.getKeys();
for (auto iter = keys.rbegin(); for (auto iter = keys.rbegin(); iter != keys.rend(); ++iter) {
iter != keys.rend();
++iter) {
queue.push_front(obj.getKey(*iter)); queue.push_front(obj.getKey(*iter));
} }
} else if (obj.isArray()) { } else if (obj.isArray()) {

View File

@ -1,9 +1,9 @@
#include <qpdf/QPDFJob.hh> #include <qpdf/QPDFJob.hh>
#include <cctype>
#include <cstdio> #include <cstdio>
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <cctype>
#include <fcntl.h> #include <fcntl.h>
#include <iostream> #include <iostream>
#include <memory> #include <memory>

View File

@ -2,13 +2,13 @@
// See "HOW TO ADD A COMMAND-LINE ARGUMENT" in README-maintainer. // See "HOW TO ADD A COMMAND-LINE ARGUMENT" in README-maintainer.
#include <cstdio>
#include <cctype> #include <cctype>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream> #include <iostream>
#include <memory> #include <memory>
#include <sstream> #include <sstream>
#include <cstdlib>
#include <cstring>
#include <qpdf/QIntC.hh> #include <qpdf/QIntC.hh>
#include <qpdf/QPDFArgParser.hh> #include <qpdf/QPDFArgParser.hh>

View File

@ -29,11 +29,11 @@
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <algorithm> #include <algorithm>
#include <cstring>
#include <cctype> #include <cctype>
#include <climits> #include <climits>
#include <stdexcept>
#include <cstdlib> #include <cstdlib>
#include <cstring>
#include <stdexcept>
using namespace std::literals; using namespace std::literals;

View File

@ -10,9 +10,9 @@
#include <qpdf/QTC.hh> #include <qpdf/QTC.hh>
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <stdexcept>
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <stdexcept>
static inline bool static inline bool
is_delimiter(char ch) is_delimiter(char ch)

View File

@ -23,8 +23,8 @@
#include <qpdf/RC4.hh> #include <qpdf/RC4.hh>
#include <algorithm> #include <algorithm>
#include <stdexcept>
#include <cstdlib> #include <cstdlib>
#include <stdexcept>
QPDFWriter::ProgressReporter::~ProgressReporter() QPDFWriter::ProgressReporter::~ProgressReporter()
{ {
@ -997,8 +997,7 @@ void
QPDFWriter::activatePipelineStack(PipelinePopper& pp) QPDFWriter::activatePipelineStack(PipelinePopper& pp)
{ {
std::string stack_id("stack " + std::to_string(this->m->next_stack_id)); std::string stack_id("stack " + std::to_string(this->m->next_stack_id));
auto* c = auto* c = new Pl_Count(stack_id.c_str(), this->m->pipeline_stack.back());
new Pl_Count(stack_id.c_str(), this->m->pipeline_stack.back());
++this->m->next_stack_id; ++this->m->next_stack_id;
this->m->pipeline_stack.push_back(c); this->m->pipeline_stack.push_back(c);
this->m->pipeline = c; this->m->pipeline = c;

View File

@ -246,8 +246,7 @@ class QPDF::JSONReactor: public JSON::Reactor
void arrayStart() override; void arrayStart() override;
void containerEnd(JSON const& value) override; void containerEnd(JSON const& value) override;
void topLevelScalar() override; void topLevelScalar() override;
bool bool dictionaryItem(std::string const& key, JSON const& value) override;
dictionaryItem(std::string const& key, JSON const& value) override;
bool arrayItem(JSON const& value) override; bool arrayItem(JSON const& value) override;
bool anyErrors() const; bool anyErrors() const;

View File

@ -1,9 +1,9 @@
#include <qpdf/QTC.hh> #include <qpdf/QTC.hh>
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <cstdio>
#include <map> #include <map>
#include <set> #include <set>
#include <cstdio>
static bool static bool
tc_active(char const* const scope) tc_active(char const* const scope)

View File

@ -11,6 +11,9 @@
#include <cctype> #include <cctype>
#include <cerrno> #include <cerrno>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fcntl.h> #include <fcntl.h>
#include <fstream> #include <fstream>
#include <iomanip> #include <iomanip>
@ -21,9 +24,6 @@
#include <set> #include <set>
#include <sstream> #include <sstream>
#include <stdexcept> #include <stdexcept>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#ifndef QPDF_NO_WCHAR_T #ifndef QPDF_NO_WCHAR_T
# include <cwchar> # include <cwchar>
#endif #endif

View File

@ -2,7 +2,6 @@
#include <qpdf/QPDFCryptoProvider.hh> #include <qpdf/QPDFCryptoProvider.hh>
RC4::RC4(unsigned char const* key_data, int key_len) : RC4::RC4(unsigned char const* key_data, int key_len) :
crypto(QPDFCryptoProvider::getImpl()) crypto(QPDFCryptoProvider::getImpl())
{ {

View File

@ -3,10 +3,10 @@
#include <qpdf/QIntC.hh> #include <qpdf/QIntC.hh>
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <iostream>
#include <cstdio> #include <cstdio>
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <iostream>
static void static void
usage() usage()

View File

@ -1,8 +1,8 @@
#include <qpdf/Pl_ASCII85Decoder.hh> #include <qpdf/Pl_ASCII85Decoder.hh>
#include <qpdf/Pl_StdioFile.hh> #include <qpdf/Pl_StdioFile.hh>
#include <iostream>
#include <cstdlib> #include <cstdlib>
#include <iostream>
int int
main() main()

View File

@ -3,8 +3,8 @@
#include <qpdf/Pl_Buffer.hh> #include <qpdf/Pl_Buffer.hh>
#include <qpdf/QIntC.hh> #include <qpdf/QIntC.hh>
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <iostream>
#include <cstdlib> #include <cstdlib>
#include <iostream>
// See comments in bits_functions.hh // See comments in bits_functions.hh
#define BITS_TESTING 1 #define BITS_TESTING 1

View File

@ -4,10 +4,10 @@
#include <qpdf/Pl_Count.hh> #include <qpdf/Pl_Count.hh>
#include <qpdf/Pl_Discard.hh> #include <qpdf/Pl_Discard.hh>
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <cstdlib>
#include <cstring> #include <cstring>
#include <iostream> #include <iostream>
#include <stdexcept> #include <stdexcept>
#include <cstdlib>
static unsigned char* static unsigned char*
uc(char const* s) uc(char const* s)

View File

@ -1,8 +1,8 @@
#include <qpdf/ClosedFileInputSource.hh> #include <qpdf/ClosedFileInputSource.hh>
#include <qpdf/FileInputSource.hh> #include <qpdf/FileInputSource.hh>
#include <iostream>
#include <cstdio> #include <cstdio>
#include <iostream>
void void
check(std::string const& what, bool result) check(std::string const& what, bool result)

View File

@ -2,10 +2,10 @@
#include <qpdf/Pl_StdioFile.hh> #include <qpdf/Pl_StdioFile.hh>
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <iostream>
#include <cstdio> #include <cstdio>
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <iostream>
static void static void
usage() usage()

View File

@ -2,9 +2,9 @@
#include <qpdf/Pl_StdioFile.hh> #include <qpdf/Pl_StdioFile.hh>
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <iostream>
#include <cstdio> #include <cstdio>
#include <cstdlib> #include <cstdlib>
#include <iostream>
int int
main(int argc, char* argv[]) main(int argc, char* argv[])

View File

@ -4,8 +4,8 @@
#include <qpdf/Pl_StdioFile.hh> #include <qpdf/Pl_StdioFile.hh>
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <iostream>
#include <cstdlib> #include <cstdlib>
#include <iostream>
void void
run(char const* filename) run(char const* filename)

View File

@ -1,8 +1,8 @@
#include <qpdf/Pl_ASCIIHexDecoder.hh> #include <qpdf/Pl_ASCIIHexDecoder.hh>
#include <qpdf/Pl_StdioFile.hh> #include <qpdf/Pl_StdioFile.hh>
#include <iostream>
#include <cstdlib> #include <cstdlib>
#include <iostream>
int int
main() main()

View File

@ -15,8 +15,7 @@ namespace
void arrayStart() override; void arrayStart() override;
void containerEnd(JSON const& value) override; void containerEnd(JSON const& value) override;
void topLevelScalar() override; void topLevelScalar() override;
bool bool dictionaryItem(std::string const& key, JSON const& value) override;
dictionaryItem(std::string const& key, JSON const& value) override;
bool arrayItem(JSON const& value) override; bool arrayItem(JSON const& value) override;
private: private:

View File

@ -2,9 +2,9 @@
#include <qpdf/Pl_StdioFile.hh> #include <qpdf/Pl_StdioFile.hh>
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <iostream>
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <iostream>
int int
main(int argc, char* argv[]) main(int argc, char* argv[])

View File

@ -2,8 +2,8 @@
#include <qpdf/Pl_Discard.hh> #include <qpdf/Pl_Discard.hh>
#include <qpdf/Pl_MD5.hh> #include <qpdf/Pl_MD5.hh>
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <iostream>
#include <cstdio> #include <cstdio>
#include <iostream>
static void static void
test_string(char const* str) test_string(char const* str)

View File

@ -6,9 +6,9 @@
#include <qpdf/QIntC.hh> #include <qpdf/QIntC.hh>
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <iostream>
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <iostream>
void void
run(char const* filename, run(char const* filename,

View File

@ -3,11 +3,11 @@
#include <qpdf/Pl_Buffer.hh> #include <qpdf/Pl_Buffer.hh>
#include <qpdf/QPDFSystemError.hh> #include <qpdf/QPDFSystemError.hh>
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <fstream>
#include <iostream>
#include <climits> #include <climits>
#include <cstdio> #include <cstdio>
#include <cstring> #include <cstring>
#include <fstream>
#include <iostream>
#ifdef _WIN32 #ifdef _WIN32
# include <io.h> # include <io.h>

View File

@ -5,10 +5,10 @@
#include <qpdf/QIntC.hh> #include <qpdf/QIntC.hh>
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <iostream>
#include <cstdio> #include <cstdio>
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <iostream>
static void static void
other_tests() other_tests()

View File

@ -2,10 +2,10 @@
#include <qpdf/Pl_StdioFile.hh> #include <qpdf/Pl_StdioFile.hh>
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <iostream>
#include <cstdio> #include <cstdio>
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <iostream>
int int
main(int argc, char* argv[]) main(int argc, char* argv[])

View File

@ -1,7 +1,7 @@
#include <qpdf/Pl_SHA2.hh> #include <qpdf/Pl_SHA2.hh>
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <iostream>
#include <cstring> #include <cstring>
#include <iostream>
static void static void
test( test(

View File

@ -4,10 +4,10 @@
#include <qpdf/QPDFPageDocumentHelper.hh> #include <qpdf/QPDFPageDocumentHelper.hh>
#include <qpdf/QPDFWriter.hh> #include <qpdf/QPDFWriter.hh>
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <iostream>
#include <cstdio> #include <cstdio>
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <iostream>
static char const* whoami = nullptr; static char const* whoami = nullptr;

View File

@ -26,13 +26,13 @@
#include <qpdf/QPDFWriter.hh> #include <qpdf/QPDFWriter.hh>
#include <qpdf/QTC.hh> #include <qpdf/QTC.hh>
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <iostream>
#include <climits> #include <climits>
#include <map>
#include <sstream>
#include <cstdio> #include <cstdio>
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <iostream>
#include <map>
#include <sstream>
#define QPDF_OBJECT_NOWARN #define QPDF_OBJECT_NOWARN
#include <qpdf/QPDFObject.hh> #include <qpdf/QPDFObject.hh>

View File

@ -12,9 +12,9 @@
#include <qpdf/QPDFPageDocumentHelper.hh> #include <qpdf/QPDFPageDocumentHelper.hh>
#include <qpdf/QPDFWriter.hh> #include <qpdf/QPDFWriter.hh>
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <iostream>
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <iostream>
// Run "test_large_file write small a.pdf" to get a PDF file that you // Run "test_large_file write small a.pdf" to get a PDF file that you
// can look at in a reader. // can look at in a reader.

View File

@ -1,8 +1,8 @@
#include <qpdf/QPDFObjectHandle.hh> #include <qpdf/QPDFObjectHandle.hh>
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <iostream>
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <iostream>
static char const* whoami = nullptr; static char const* whoami = nullptr;

View File

@ -1,8 +1,8 @@
#include <qpdf/QPDFObjectHandle.hh> #include <qpdf/QPDFObjectHandle.hh>
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <iostream>
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <iostream>
static char const* whoami = nullptr; static char const* whoami = nullptr;

View File

@ -6,10 +6,10 @@
#include <qpdf/QPDFPageDocumentHelper.hh> #include <qpdf/QPDFPageDocumentHelper.hh>
#include <qpdf/QPDFTokenizer.hh> #include <qpdf/QPDFTokenizer.hh>
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <iostream>
#include <cstdio> #include <cstdio>
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <iostream>
static char const* whoami = nullptr; static char const* whoami = nullptr;
@ -203,8 +203,7 @@ process(char const* filename, bool include_ignorable, size_t max_len)
Pl_Buffer plb("buffer"); Pl_Buffer plb("buffer");
page.pipeContents(&plb); page.pipeContents(&plb);
auto content_data = plb.getBufferSharedPointer(); auto content_data = plb.getBufferSharedPointer();
auto* bis = auto* bis = new BufferInputSource("content data", content_data.get());
new BufferInputSource("content data", content_data.get());
is = std::shared_ptr<InputSource>(bis); is = std::shared_ptr<InputSource>(bis);
dump_tokens( dump_tokens(
is, is,
@ -220,8 +219,7 @@ process(char const* filename, bool include_ignorable, size_t max_len)
if (obj.isStream() && obj.getDict().getKey("/Type").isName() && if (obj.isStream() && obj.getDict().getKey("/Type").isName() &&
obj.getDict().getKey("/Type").getName() == "/ObjStm") { obj.getDict().getKey("/Type").getName() == "/ObjStm") {
std::shared_ptr<Buffer> b = obj.getStreamData(qpdf_dl_specialized); std::shared_ptr<Buffer> b = obj.getStreamData(qpdf_dl_specialized);
auto* bis = auto* bis = new BufferInputSource("object stream data", b.get());
new BufferInputSource("object stream data", b.get());
is = std::shared_ptr<InputSource>(bis); is = std::shared_ptr<InputSource>(bis);
dump_tokens( dump_tokens(
is, is,

View File

@ -5,9 +5,9 @@
# include <windows.h> # include <windows.h>
#endif #endif
#include <iostream>
#include <cstdio> #include <cstdio>
#include <cstdlib> #include <cstdlib>
#include <iostream>
static void static void
do_copy(FILE* in, FILE* out) do_copy(FILE* in, FILE* out)

View File

@ -3,11 +3,11 @@
#include <qpdf/QPDF.hh> #include <qpdf/QPDF.hh>
#include <qpdf/QUtil.hh> #include <qpdf/QUtil.hh>
#include <fcntl.h>
#include <iostream>
#include <cstdio> #include <cstdio>
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <fcntl.h>
#include <iostream>
static char const* whoami = nullptr; static char const* whoami = nullptr;