aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2013-01-23 15:38:05 +0100
committerJay Berkenbilt <ejb@ql.org>2013-01-23 15:38:05 +0100
commitbfda71774907263f5263a3ae2e8c8fa40fbc2cca (patch)
tree0861f846c89f67fc18b11793fdb662313c5dfd9e /libqpdf
parent913eb5ac35011b3d28c653b6f89d936c8f99c844 (diff)
downloadqpdf-bfda71774907263f5263a3ae2e8c8fa40fbc2cca.tar.zst
Cosmetic changes to be closer to Adobe terminology
Change object type Keyword to Operator, and place the order of the object types in object_type_e in the same order as they are mentioned in the PDF specification. Note that this change only breaks backward compatibility with code that has not yet been released.
Diffstat (limited to 'libqpdf')
-rw-r--r--libqpdf/QPDFObjectHandle.cc28
-rw-r--r--libqpdf/QPDF_Keyword.cc36
-rw-r--r--libqpdf/QPDF_Operator.cc36
-rw-r--r--libqpdf/build.mk2
-rw-r--r--libqpdf/qpdf/QPDF_Operator.hh (renamed from libqpdf/qpdf/QPDF_Keyword.hh)12
5 files changed, 57 insertions, 57 deletions
diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc
index b53dd577..fca8191d 100644
--- a/libqpdf/QPDFObjectHandle.cc
+++ b/libqpdf/QPDFObjectHandle.cc
@@ -7,7 +7,7 @@
#include <qpdf/QPDF_Real.hh>
#include <qpdf/QPDF_Name.hh>
#include <qpdf/QPDF_String.hh>
-#include <qpdf/QPDF_Keyword.hh>
+#include <qpdf/QPDF_Operator.hh>
#include <qpdf/QPDF_InlineImage.hh>
#include <qpdf/QPDF_Array.hh>
#include <qpdf/QPDF_Dictionary.hh>
@@ -180,10 +180,10 @@ QPDFObjectHandle::isString()
}
bool
-QPDFObjectHandle::isKeyword()
+QPDFObjectHandle::isOperator()
{
dereference();
- return QPDFObjectTypeAccessor<QPDF_Keyword>::check(obj.getPointer());
+ return QPDFObjectTypeAccessor<QPDF_Operator>::check(obj.getPointer());
}
bool
@@ -233,7 +233,7 @@ bool
QPDFObjectHandle::isScalar()
{
return (! (isArray() || isDictionary() || isStream() ||
- isKeyword() || isInlineImage()));
+ isOperator() || isInlineImage()));
}
// Bool accessors
@@ -288,13 +288,13 @@ QPDFObjectHandle::getUTF8Value()
return dynamic_cast<QPDF_String*>(obj.getPointer())->getUTF8Val();
}
-// Keyword and Inline Image accessors
+// Operator and Inline Image accessors
std::string
-QPDFObjectHandle::getKeywordValue()
+QPDFObjectHandle::getOperatorValue()
{
- assertKeyword();
- return dynamic_cast<QPDF_Keyword*>(obj.getPointer())->getVal();
+ assertOperator();
+ return dynamic_cast<QPDF_Operator*>(obj.getPointer())->getVal();
}
std::string
@@ -760,7 +760,7 @@ QPDFObjectHandle::parseContentStream_internal(QPDFObjectHandle stream,
}
callbacks->handleObject(obj);
- if (obj.isKeyword() && (obj.getKeywordValue() == "ID"))
+ if (obj.isOperator() && (obj.getOperatorValue() == "ID"))
{
// Discard next character; it is the space after ID that
// terminated the token. Read until end of inline image.
@@ -970,7 +970,7 @@ QPDFObjectHandle::parseInternal(PointerHolder<InputSource> input,
}
else if (content_stream)
{
- object = QPDFObjectHandle::newKeyword(token.getValue());
+ object = QPDFObjectHandle::newOperator(token.getValue());
}
else
{
@@ -1108,9 +1108,9 @@ QPDFObjectHandle::newString(std::string const& str)
}
QPDFObjectHandle
-QPDFObjectHandle::newKeyword(std::string const& value)
+QPDFObjectHandle::newOperator(std::string const& value)
{
- return QPDFObjectHandle(new QPDF_Keyword(value));
+ return QPDFObjectHandle(new QPDF_Operator(value));
}
QPDFObjectHandle
@@ -1404,9 +1404,9 @@ QPDFObjectHandle::assertString()
}
void
-QPDFObjectHandle::assertKeyword()
+QPDFObjectHandle::assertOperator()
{
- assertType("Keyword", isKeyword());
+ assertType("Operator", isOperator());
}
void
diff --git a/libqpdf/QPDF_Keyword.cc b/libqpdf/QPDF_Keyword.cc
deleted file mode 100644
index f55088e2..00000000
--- a/libqpdf/QPDF_Keyword.cc
+++ /dev/null
@@ -1,36 +0,0 @@
-#include <qpdf/QPDF_Keyword.hh>
-
-#include <qpdf/QUtil.hh>
-
-QPDF_Keyword::QPDF_Keyword(std::string const& val) :
- val(val)
-{
-}
-
-QPDF_Keyword::~QPDF_Keyword()
-{
-}
-
-std::string
-QPDF_Keyword::unparse()
-{
- return this->val;
-}
-
-QPDFObject::object_type_e
-QPDF_Keyword::getTypeCode() const
-{
- return QPDFObject::ot_keyword;
-}
-
-char const*
-QPDF_Keyword::getTypeName() const
-{
- return "keyword";
-}
-
-std::string
-QPDF_Keyword::getVal() const
-{
- return this->val;
-}
diff --git a/libqpdf/QPDF_Operator.cc b/libqpdf/QPDF_Operator.cc
new file mode 100644
index 00000000..c6c68816
--- /dev/null
+++ b/libqpdf/QPDF_Operator.cc
@@ -0,0 +1,36 @@
+#include <qpdf/QPDF_Operator.hh>
+
+#include <qpdf/QUtil.hh>
+
+QPDF_Operator::QPDF_Operator(std::string const& val) :
+ val(val)
+{
+}
+
+QPDF_Operator::~QPDF_Operator()
+{
+}
+
+std::string
+QPDF_Operator::unparse()
+{
+ return this->val;
+}
+
+QPDFObject::object_type_e
+QPDF_Operator::getTypeCode() const
+{
+ return QPDFObject::ot_operator;
+}
+
+char const*
+QPDF_Operator::getTypeName() const
+{
+ return "operator";
+}
+
+std::string
+QPDF_Operator::getVal() const
+{
+ return this->val;
+}
diff --git a/libqpdf/build.mk b/libqpdf/build.mk
index 0b248a91..16342b9f 100644
--- a/libqpdf/build.mk
+++ b/libqpdf/build.mk
@@ -43,8 +43,8 @@ SRCS_libqpdf = \
libqpdf/QPDF_InlineImage.cc \
libqpdf/QPDF_Integer.cc \
libqpdf/QPDF_Name.cc \
- libqpdf/QPDF_Keyword.cc \
libqpdf/QPDF_Null.cc \
+ libqpdf/QPDF_Operator.cc \
libqpdf/QPDF_Real.cc \
libqpdf/QPDF_Reserved.cc \
libqpdf/QPDF_Stream.cc \
diff --git a/libqpdf/qpdf/QPDF_Keyword.hh b/libqpdf/qpdf/QPDF_Operator.hh
index 78ae5791..9d18ad37 100644
--- a/libqpdf/qpdf/QPDF_Keyword.hh
+++ b/libqpdf/qpdf/QPDF_Operator.hh
@@ -1,13 +1,13 @@
-#ifndef __QPDF_KEYWORD_HH__
-#define __QPDF_KEYWORD_HH__
+#ifndef __QPDF_OPERATOR_HH__
+#define __QPDF_OPERATOR_HH__
#include <qpdf/QPDFObject.hh>
-class QPDF_Keyword: public QPDFObject
+class QPDF_Operator: public QPDFObject
{
public:
- QPDF_Keyword(std::string const& val);
- virtual ~QPDF_Keyword();
+ QPDF_Operator(std::string const& val);
+ virtual ~QPDF_Operator();
virtual std::string unparse();
virtual QPDFObject::object_type_e getTypeCode() const;
virtual char const* getTypeName() const;
@@ -17,4 +17,4 @@ class QPDF_Keyword: public QPDFObject
std::string val;
};
-#endif // __QPDF_KEYWORD_HH__
+#endif // __QPDF_OPERATOR_HH__