mirror of
https://github.com/qpdf/qpdf.git
synced 2024-05-29 00:10:54 +00:00
API contract: qpdf_get_qpdf_version() returns a static
This commit is contained in:
parent
5f3f78822b
commit
8cf7f2bfb5
|
@ -1,5 +1,8 @@
|
||||||
2022-02-05 Jay Berkenbilt <ejb@ql.org>
|
2022-02-05 Jay Berkenbilt <ejb@ql.org>
|
||||||
|
|
||||||
|
* Add comments letting people know that the version string
|
||||||
|
returned by QPDF::QPDFVersion and qpdf_get_qpdf_version is static.
|
||||||
|
|
||||||
* Add QUtil::make_unique_cstr to return a std::unique_ptr<char[]>
|
* Add QUtil::make_unique_cstr to return a std::unique_ptr<char[]>
|
||||||
as an alternative to QUtil::copy_string and
|
as an alternative to QUtil::copy_string and
|
||||||
QUtil::make_shared_cstr.
|
QUtil::make_shared_cstr.
|
||||||
|
|
|
@ -773,7 +773,7 @@ class QPDF
|
||||||
friend class Pipe;
|
friend class Pipe;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static std::string qpdf_version;
|
static std::string const qpdf_version;
|
||||||
|
|
||||||
class ObjCache
|
class ObjCache
|
||||||
{
|
{
|
||||||
|
|
|
@ -171,7 +171,9 @@ extern "C" {
|
||||||
QPDF_DLL
|
QPDF_DLL
|
||||||
void qpdf_silence_errors(qpdf_data qpdf);
|
void qpdf_silence_errors(qpdf_data qpdf);
|
||||||
|
|
||||||
/* Returns the version of the qpdf software */
|
/* Returns the version of the qpdf software. This is guaranteed to
|
||||||
|
* be a static value.
|
||||||
|
*/
|
||||||
QPDF_DLL
|
QPDF_DLL
|
||||||
char const* qpdf_get_qpdf_version();
|
char const* qpdf_get_qpdf_version();
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,9 @@
|
||||||
#include <qpdf/QPDF_Stream.hh>
|
#include <qpdf/QPDF_Stream.hh>
|
||||||
#include <qpdf/QPDF_Array.hh>
|
#include <qpdf/QPDF_Array.hh>
|
||||||
|
|
||||||
std::string QPDF::qpdf_version(QPDF_VERSION);
|
// This must be a fixed value. This API returns a const reference to
|
||||||
|
// it, and the C API relies on its being static as well.
|
||||||
|
std::string const QPDF::qpdf_version(QPDF_VERSION);
|
||||||
|
|
||||||
static char const* EMPTY_PDF =
|
static char const* EMPTY_PDF =
|
||||||
"%PDF-1.3\n"
|
"%PDF-1.3\n"
|
||||||
|
@ -178,6 +180,7 @@ QPDF::StringDecrypter::decryptString(std::string& val)
|
||||||
std::string const&
|
std::string const&
|
||||||
QPDF::QPDFVersion()
|
QPDF::QPDFVersion()
|
||||||
{
|
{
|
||||||
|
// The C API relies on this being a static value.
|
||||||
return QPDF::qpdf_version;
|
return QPDF::qpdf_version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -161,6 +161,7 @@ static QPDF_ERROR_CODE trap_errors(
|
||||||
char const* qpdf_get_qpdf_version()
|
char const* qpdf_get_qpdf_version()
|
||||||
{
|
{
|
||||||
QTC::TC("qpdf", "qpdf-c called qpdf_get_qpdf_version");
|
QTC::TC("qpdf", "qpdf-c called qpdf_get_qpdf_version");
|
||||||
|
// The API guarantees that this is a static value.
|
||||||
return QPDF::QPDFVersion().c_str();
|
return QPDF::QPDFVersion().c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user