---
 src/base/PdfVariant.h | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/src/base/PdfVariant.h b/src/base/PdfVariant.h
index f9217d8..fbd3c32 100644
--- a/src/base/PdfVariant.h
+++ b/src/base/PdfVariant.h
@@ -275,6 +275,14 @@ class PODOFO_API PdfVariant {
      *  \return the value of the number
      */
     inline double GetReal() const;
+
+    /** Set the string value of this object
+    *  \param d the string value
+    *
+    *  This will set the dirty flag of this object.
+    *  \see IsDirty
+    */
+    inline void SetString(const PdfString &);
/** \returns the value of the object as string.
      */
@@ -722,6 +730,23 @@ PdfData & PdfVariant::GetRawData()
     // We need a c-style casts here to avoid crashes
     // because a reinterpret_cast might point to a different position.
     return *((PdfData*)m_Data.pData);
+}
+
+// -----------------------------------------------------
+//
+// -----------------------------------------------------
+void PdfVariant::SetString(const PdfString &str)
+{
+    DelayedLoad();
+
+    if (!IsString())
+    {
+        PODOFO_RAISE_ERROR(ePdfError_InvalidDataType);
+    }
+
+    AssertMutable();
+    *((PdfString*)m_Data.pData) = str;
+    SetDirty(true);
 }
// -----------------------------------------------------
--
2.16.1.windows.1



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to