aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorm-holger <m-holger@kubitscheck.org>2022-02-05 15:46:25 +0100
committerJay Berkenbilt <jberkenbilt@users.noreply.github.com>2022-02-05 17:24:35 +0100
commite58b1174c7f8b617a1253e70df9b95a1cac10fab (patch)
tree3ed228458d61ae38704ef93cd546a789ad0118ce /include
parentcfaa2de804f91b8130486848ced44d0aa283acef (diff)
downloadqpdf-e58b1174c7f8b617a1253e70df9b95a1cac10fab.tar.zst
Add new QPDFObjectHandle::getValueAs... accessors
Diffstat (limited to 'include')
-rw-r--r--include/qpdf/QPDFObjectHandle.hh25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/qpdf/QPDFObjectHandle.hh b/include/qpdf/QPDFObjectHandle.hh
index c632574e..855c14c2 100644
--- a/include/qpdf/QPDFObjectHandle.hh
+++ b/include/qpdf/QPDFObjectHandle.hh
@@ -678,6 +678,8 @@ class QPDFObjectHandle
// Methods for bool objects
QPDF_DLL
bool getBoolValue();
+ QPDF_DLL
+ bool getValueAsBool(bool&);
// Methods for integer objects. Note: if an integer value is too
// big (too far away from zero in either direction) to fit in the
@@ -688,29 +690,46 @@ class QPDFObjectHandle
QPDF_DLL
long long getIntValue();
QPDF_DLL
+ bool getValueAsInt(long long&);
+ QPDF_DLL
int getIntValueAsInt();
QPDF_DLL
+ bool getValueAsInt(int&);
+ QPDF_DLL
unsigned long long getUIntValue();
QPDF_DLL
+ bool getValueAsUInt(unsigned long long&);
+ QPDF_DLL
unsigned int getUIntValueAsUInt();
+ QPDF_DLL
+ bool getValueAsUInt(unsigned int&);
// Methods for real objects
QPDF_DLL
std::string getRealValue();
+ QPDF_DLL
+ bool getValueAsReal(std::string&);
// Methods that work for both integer and real objects
QPDF_DLL
bool isNumber();
QPDF_DLL
double getNumericValue();
+ QPDF_DLL
+ bool getValueAsNumber(double&);
// Methods for name objects; see also name and array objects
QPDF_DLL
std::string getName();
+ QPDF_DLL
+ bool getValueAsName(std::string&);
// Methods for string objects
QPDF_DLL
std::string getStringValue();
+ QPDF_DLL
+ bool getValueAsString(std::string&);
+
// If a string starts with the UTF-16 marker, it is converted from
// UTF-16 to UTF-8. Otherwise, it is treated as a string encoded
// with PDF Doc Encoding. PDF Doc Encoding is identical to
@@ -720,12 +739,18 @@ class QPDFObjectHandle
// unmapped.
QPDF_DLL
std::string getUTF8Value();
+ QPDF_DLL
+ bool getValueAsUTF8(std::string&);
// Methods for content stream objects
QPDF_DLL
std::string getOperatorValue();
QPDF_DLL
+ bool getValueAsOperator(std::string&);
+ QPDF_DLL
std::string getInlineImageValue();
+ QPDF_DLL
+ bool getValueAsInlineImage(std::string&);
// Methods for array objects; see also name and array objects.