diff options
author | Jay Berkenbilt <ejb@ql.org> | 2009-10-21 02:27:24 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2009-10-21 02:27:24 +0200 |
commit | 748ab301d4f17c77393b08de4ef541b957bde275 (patch) | |
tree | 5801b2c2f64a3ea3873bfd46fb3ac0cfeb9cc411 /include/qpdf/QPDFObjectHandle.hh | |
parent | eff113fa6891387fc16c179ab5ef6f15674513ec (diff) | |
download | qpdf-748ab301d4f17c77393b08de4ef541b957bde275.tar.zst |
go back to function-based DLL_EXPORT rather than class-based to avoid creation of export files with executables under msvc
git-svn-id: svn+q:///qpdf/trunk@849 71b93d88-0707-0410-a8cf-f5a4172ac649
Diffstat (limited to 'include/qpdf/QPDFObjectHandle.hh')
-rw-r--r-- | include/qpdf/QPDFObjectHandle.hh | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/include/qpdf/QPDFObjectHandle.hh b/include/qpdf/QPDFObjectHandle.hh index 0948fefe..6fc9e5aa 100644 --- a/include/qpdf/QPDFObjectHandle.hh +++ b/include/qpdf/QPDFObjectHandle.hh @@ -23,40 +23,61 @@ class Pipeline; class QPDF; -class DLL_EXPORT QPDFObjectHandle +class QPDFObjectHandle { public: + DLL_EXPORT QPDFObjectHandle(); + DLL_EXPORT bool isInitialized() const; // Exactly one of these will return true for any object. + DLL_EXPORT bool isBool(); + DLL_EXPORT bool isNull(); + DLL_EXPORT bool isInteger(); + DLL_EXPORT bool isReal(); + DLL_EXPORT bool isName(); + DLL_EXPORT bool isString(); + DLL_EXPORT bool isArray(); + DLL_EXPORT bool isDictionary(); + DLL_EXPORT bool isStream(); // This returns true in addition to the query for the specific // type for indirect objects. + DLL_EXPORT bool isIndirect(); // True for everything except array, dictionary, and stream + DLL_EXPORT bool isScalar(); // Public factory methods + DLL_EXPORT static QPDFObjectHandle newNull(); + DLL_EXPORT static QPDFObjectHandle newBool(bool value); + DLL_EXPORT static QPDFObjectHandle newInteger(int value); + DLL_EXPORT static QPDFObjectHandle newReal(std::string const& value); + DLL_EXPORT static QPDFObjectHandle newName(std::string const& name); + DLL_EXPORT static QPDFObjectHandle newString(std::string const& str); + DLL_EXPORT static QPDFObjectHandle newArray( std::vector<QPDFObjectHandle> const& items); + DLL_EXPORT static QPDFObjectHandle newDictionary( std::map<std::string, QPDFObjectHandle> const& items); @@ -65,58 +86,78 @@ class DLL_EXPORT QPDFObjectHandle // type, an exception is thrown. // Methods for bool objects + DLL_EXPORT bool getBoolValue(); // Methods for integer objects + DLL_EXPORT int getIntValue(); // Methods for real objects + DLL_EXPORT std::string getRealValue(); // Methods that work for both integer and real objects + DLL_EXPORT bool isNumber(); + DLL_EXPORT double getNumericValue(); // Methods for name objects; see also name and array objects + DLL_EXPORT std::string getName(); // Methods for string objects + DLL_EXPORT std::string getStringValue(); + DLL_EXPORT std::string getUTF8Value(); // Methods for array objects; see also name and array objects + DLL_EXPORT int getArrayNItems(); + DLL_EXPORT QPDFObjectHandle getArrayItem(int n); // Methods for dictionary objects + DLL_EXPORT bool hasKey(std::string const&); + DLL_EXPORT QPDFObjectHandle getKey(std::string const&); + DLL_EXPORT std::set<std::string> getKeys(); // Methods for name and array objects + DLL_EXPORT bool isOrHasName(std::string const&); // Mutator methods. Use with caution. // Recursively copy this object, making it direct. Throws an // exception if a loop is detected or any sub-object is a stream. + DLL_EXPORT void makeDirect(); // Mutator methods for array objects + DLL_EXPORT void setArrayItem(int, QPDFObjectHandle const&); // Mutator methods for dictionary objects // Replace value of key, adding it if it does not exist + DLL_EXPORT void replaceKey(std::string const& key, QPDFObjectHandle const&); // Remove key, doing nothing if key does not exist + DLL_EXPORT void removeKey(std::string const& key); // Methods for stream objects + DLL_EXPORT QPDFObjectHandle getDict(); // Returns filtered (uncompressed) stream data. Throws an // exception if the stream is filtered and we can't decode it. + DLL_EXPORT PointerHolder<Buffer> getStreamData(); // Write stream data through the given pipeline. A null pipeline @@ -136,14 +177,19 @@ class DLL_EXPORT QPDFObjectHandle // value of this function to determine whether or not the /Filter // and /DecodeParms keys in the stream dictionary should be // replaced if writing a new stream object. + DLL_EXPORT bool pipeStreamData(Pipeline*, bool filter, bool normalize, bool compress); // return 0 for direct objects + DLL_EXPORT int getObjectID() const; + DLL_EXPORT int getGeneration() const; + DLL_EXPORT std::string unparse(); + DLL_EXPORT std::string unparseResolved(); // Convenience routines for commonly performed functions @@ -153,6 +199,7 @@ class DLL_EXPORT QPDFObjectHandle // function does not presently support inherited resources. See // comment in the source for details. Return value is a map from // XObject name to the image object, which is always a stream. + DLL_EXPORT std::map<std::string, QPDFObjectHandle> getPageImages(); // Throws an exception if this is not a Page object. Returns a @@ -160,6 +207,7 @@ class DLL_EXPORT QPDFObjectHandle // the given page. This routine allows the caller to not care // whether there are one or more than one content streams for a // page. + DLL_EXPORT std::vector<QPDFObjectHandle> getPageContents(); // Initializers for objects. This Factory class gives the QPDF |