diff options
author | Jay Berkenbilt <ejb@ql.org> | 2022-02-08 17:07:37 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2022-02-08 18:34:14 +0100 |
commit | cfd5147d922ee4e29e10f116dfca79325398a6db (patch) | |
tree | dc2742d54e9fdec9bc170ba677be0e8861f63766 /libqpdf/PDFVersion.cc | |
parent | 8082af09bea1132cecc2d148eeb23bc05e66f6b2 (diff) | |
download | qpdf-cfd5147d922ee4e29e10f116dfca79325398a6db.tar.zst |
Add QPDF::getVersionAsPDFVersion
Diffstat (limited to 'libqpdf/PDFVersion.cc')
-rw-r--r-- | libqpdf/PDFVersion.cc | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/libqpdf/PDFVersion.cc b/libqpdf/PDFVersion.cc index c2f28bf8..18c04716 100644 --- a/libqpdf/PDFVersion.cc +++ b/libqpdf/PDFVersion.cc @@ -7,30 +7,30 @@ PDFVersion::PDFVersion() : { } -PDFVersion::PDFVersion(int major, int minor, int extension) : - major(major), - minor(minor), - extension(extension) +PDFVersion::PDFVersion(int major_version, int minor_version, int extension_level) : + major_version(major_version), + minor_version(minor_version), + extension_level(extension_level) { } bool PDFVersion::operator<(PDFVersion const& rhs) const { - return ((this->major < rhs.major) ? true : - (this->major > rhs.major) ? false : - (this->minor < rhs.minor) ? true : - (this->minor > rhs.minor) ? false : - (this->extension < rhs.minor) ? true : + return ((this->major_version < rhs.major_version) ? true : + (this->major_version > rhs.major_version) ? false : + (this->minor_version < rhs.minor_version) ? true : + (this->minor_version > rhs.minor_version) ? false : + (this->extension_level < rhs.extension_level) ? true : false); } bool PDFVersion::operator==(PDFVersion const& rhs) const { - return ((this->major == rhs.major) && - (this->minor == rhs.minor) && - (this->extension == rhs.extension)); + return ((this->major_version == rhs.major_version) && + (this->minor_version == rhs.minor_version) && + (this->extension_level == rhs.extension_level)); } void @@ -45,25 +45,25 @@ PDFVersion::updateIfGreater(PDFVersion const& other) void PDFVersion::getVersion(std::string& version, int& extension_level) const { - extension_level = this->extension; - version = QUtil::int_to_string(this->major) + "." + - QUtil::int_to_string(this->minor); + extension_level = this->extension_level; + version = QUtil::int_to_string(this->major_version) + "." + + QUtil::int_to_string(this->minor_version); } int PDFVersion::getMajor() const { - return this->major; + return this->major_version; } int PDFVersion::getMinor() const { - return this->minor; + return this->minor_version; } int PDFVersion::getExtensionLevel() const { - return this->extension; + return this->extension_level; } |