Skip to content

Commit

Permalink
Merge pull request #1 from furgoler/furgoler-patch-1
Browse files Browse the repository at this point in the history
Initial upload to github
  • Loading branch information
furgoler authored Apr 14, 2023
2 parents 5453b5b + a247978 commit 3b7dcc9
Show file tree
Hide file tree
Showing 136 changed files with 19,599 additions and 2 deletions.
Binary file added 3rdparty/qpdf-11.3.0-msvc64/bin/concrt140.dll
Binary file not shown.
Binary file added 3rdparty/qpdf-11.3.0-msvc64/bin/fix-qdf.exe
Binary file not shown.
Binary file added 3rdparty/qpdf-11.3.0-msvc64/bin/msvcp140.dll
Binary file not shown.
Binary file added 3rdparty/qpdf-11.3.0-msvc64/bin/msvcp140_1.dll
Binary file not shown.
Binary file added 3rdparty/qpdf-11.3.0-msvc64/bin/msvcp140_2.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added 3rdparty/qpdf-11.3.0-msvc64/bin/qpdf.exe
Binary file not shown.
Binary file added 3rdparty/qpdf-11.3.0-msvc64/bin/qpdf29.dll
Binary file not shown.
Binary file added 3rdparty/qpdf-11.3.0-msvc64/bin/vcruntime140.dll
Binary file not shown.
Binary file not shown.
Binary file added 3rdparty/qpdf-11.3.0-msvc64/bin/zlib-flate.exe
Binary file not shown.
85 changes: 85 additions & 0 deletions 3rdparty/qpdf-11.3.0-msvc64/include/qpdf/Buffer.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
// Copyright (c) 2005-2023 Jay Berkenbilt
//
// This file is part of qpdf.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Versions of qpdf prior to version 7 were released under the terms
// of version 2.0 of the Artistic License. At your option, you may
// continue to consider qpdf to be licensed under those terms. Please
// see the manual for additional information.

#ifndef BUFFER_HH
#define BUFFER_HH

#include <qpdf/DLL.h>
#include <qpdf/PointerHolder.hh> // unused -- remove in qpdf 12 (see #785)

#include <memory>
#include <stddef.h>

class Buffer
{
public:
QPDF_DLL
Buffer();

// Create a Buffer object whose memory is owned by the class and
// will be freed when the Buffer object is destroyed.
QPDF_DLL
Buffer(size_t size);

// Create a Buffer object whose memory is owned by the caller and
// will not be freed when the Buffer is destroyed.
QPDF_DLL
Buffer(unsigned char* buf, size_t size);

QPDF_DLL
Buffer(Buffer const&);
QPDF_DLL
Buffer& operator=(Buffer const&);
QPDF_DLL
Buffer(Buffer&&) noexcept;
QPDF_DLL
Buffer& operator=(Buffer&&) noexcept;
QPDF_DLL
size_t getSize() const;
QPDF_DLL
unsigned char const* getBuffer() const;
QPDF_DLL
unsigned char* getBuffer();

private:
class Members
{
friend class Buffer;

public:
QPDF_DLL
~Members();

private:
Members(size_t size, unsigned char* buf, bool own_memory);
Members(Members const&) = delete;

bool own_memory;
size_t size;
unsigned char* buf;
};

void copy(Buffer const&);

std::unique_ptr<Members> m;
};

#endif // BUFFER_HH
64 changes: 64 additions & 0 deletions 3rdparty/qpdf-11.3.0-msvc64/include/qpdf/BufferInputSource.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// Copyright (c) 2005-2023 Jay Berkenbilt
//
// This file is part of qpdf.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Versions of qpdf prior to version 7 were released under the terms
// of version 2.0 of the Artistic License. At your option, you may
// continue to consider qpdf to be licensed under those terms. Please
// see the manual for additional information.

#ifndef QPDF_BUFFERINPUTSOURCE_HH
#define QPDF_BUFFERINPUTSOURCE_HH

#include <qpdf/Buffer.hh>
#include <qpdf/InputSource.hh>

class QPDF_DLL_CLASS BufferInputSource: public InputSource
{
public:
// If own_memory is true, BufferInputSource will delete the buffer
// when finished with it. Otherwise, the caller owns the memory.
QPDF_DLL
BufferInputSource(
std::string const& description, Buffer* buf, bool own_memory = false);
QPDF_DLL
BufferInputSource(
std::string const& description, std::string const& contents);
QPDF_DLL
virtual ~BufferInputSource();
QPDF_DLL
virtual qpdf_offset_t findAndSkipNextEOL();
QPDF_DLL
virtual std::string const& getName() const;
QPDF_DLL
virtual qpdf_offset_t tell();
QPDF_DLL
virtual void seek(qpdf_offset_t offset, int whence);
QPDF_DLL
virtual void rewind();
QPDF_DLL
virtual size_t read(char* buffer, size_t length);
QPDF_DLL
virtual void unreadCh(char ch);

private:
bool own_memory;
std::string description;
Buffer* buf;
qpdf_offset_t cur_offset;
qpdf_offset_t max_offset;
};

#endif // QPDF_BUFFERINPUTSOURCE_HH
82 changes: 82 additions & 0 deletions 3rdparty/qpdf-11.3.0-msvc64/include/qpdf/ClosedFileInputSource.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// Copyright (c) 2005-2023 Jay Berkenbilt
//
// This file is part of qpdf.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Versions of qpdf prior to version 7 were released under the terms
// of version 2.0 of the Artistic License. At your option, you may
// continue to consider qpdf to be licensed under those terms. Please
// see the manual for additional information.

#ifndef QPDF_CLOSEDFILEINPUTSOURCE_HH
#define QPDF_CLOSEDFILEINPUTSOURCE_HH

// This is an input source that reads from files, like
// FileInputSource, except that it opens and close the file
// surrounding every operation. This decreases efficiency, but it allows
// many more of these to exist at once than the maximum number of open
// file descriptors. This is used for merging large numbers of files.

#include <qpdf/InputSource.hh>
#include <qpdf/PointerHolder.hh> // unused -- remove in qpdf 12 (see #785)

#include <memory>

class FileInputSource;

class QPDF_DLL_CLASS ClosedFileInputSource: public InputSource
{
public:
QPDF_DLL
ClosedFileInputSource(char const* filename);
QPDF_DLL
virtual ~ClosedFileInputSource();
QPDF_DLL
virtual qpdf_offset_t findAndSkipNextEOL();
QPDF_DLL
virtual std::string const& getName() const;
QPDF_DLL
virtual qpdf_offset_t tell();
QPDF_DLL
virtual void seek(qpdf_offset_t offset, int whence);
QPDF_DLL
virtual void rewind();
QPDF_DLL
virtual size_t read(char* buffer, size_t length);
QPDF_DLL
virtual void unreadCh(char ch);

// The file stays open between calls to stayOpen(true) and
// stayOpen(false). You can use this to surround multiple
// operations on a single ClosedFileInputSource to reduce the
// overhead of a separate open/close on each call.
QPDF_DLL
void stayOpen(bool);

private:
ClosedFileInputSource(ClosedFileInputSource const&) = delete;
ClosedFileInputSource& operator=(ClosedFileInputSource const&) = delete;

QPDF_DLL_PRIVATE
void before();
QPDF_DLL_PRIVATE
void after();

std::string filename;
qpdf_offset_t offset;
std::shared_ptr<FileInputSource> fis;
bool stay_open;
};

#endif // QPDF_CLOSEDFILEINPUTSOURCE_HH
Loading

0 comments on commit 3b7dcc9

Please sign in to comment.