Advanced functions

This commit is contained in:
Jakub Melka
2019-03-07 19:57:03 +01:00
parent 2023e17c4c
commit 234b7c77f7
6 changed files with 901 additions and 32 deletions

View File

@ -174,6 +174,14 @@ public:
}
}
/// Tries to read array of real values from dictionary. If entry dictionary doesn't exist,
/// or error occurs, empty record is returned.
std::vector<PDFReal> readNumberArrayFromDictionary(const PDFDictionary *dictionary, const char *key);
/// Tries to read array of integer values from dictionary. If entry dictionary doesn't exist,
/// or error occurs, empty record is returned.
std::vector<PDFInteger> readIntegerArrayFromDictionary(const PDFDictionary *dictionary, const char *key);
/// Reads number from dictionary. If dictionary entry doesn't exist, or error occurs, default value is returned.
/// \param dictionary Dictionary containing desired data
/// \param key Entry key
@ -192,6 +200,12 @@ public:
/// \param object Object containing array of numbers
std::vector<PDFReal> readNumberArray(const PDFObject& object) const;
/// Reads integer array from dictionary. Reads all values. If some value is not
/// integer number, empty array is returned. Empty array is also returned,
/// if \p object is invalid.
/// \param object Object containing array of numbers
std::vector<PDFInteger> readIntegerArray(const PDFObject& object) const;
private:
const PDFDocument* m_document;
};