From 235d8f28f8b7de0f1fea3f8fecc5af6c3917c650 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Mon, 16 Dec 2013 16:03:54 -0500 Subject: Increase random data provider support Add a method to get the current random data provider, and document and test the method for resetting it. --- include/qpdf/QUtil.hh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/qpdf/QUtil.hh b/include/qpdf/QUtil.hh index f61fa844..7b910b71 100644 --- a/include/qpdf/QUtil.hh +++ b/include/qpdf/QUtil.hh @@ -142,9 +142,20 @@ namespace QUtil // memory for the RandomDataProvider. This method modifies a // static variable. If you are providing your own random data // provider, you should call this at the beginning of your program - // before creating any QPDF objects. + // before creating any QPDF objects. Passing a null to this + // method will reset the library back to whichever of the built-in + // random data handlers is appropriate basedon how qpdf was + // compiled. QPDF_DLL void setRandomDataProvider(RandomDataProvider*); + + // This returns the random data provider that would be used the + // next time qpdf needs random data. It will never return null. + // If no random data provider has been provided and the library + // was not compiled with any random data provider available, an + // exception will be thrown. + QPDF_DLL + RandomDataProvider* getRandomDataProvider(); }; #endif // __QUTIL_HH__ -- cgit v1.2.3-54-g00ecf