static bool setValue(const PolicyDomain domain_, const std::string name_,
const std::string value_);
+ template <typename T>
+ static std::string toString(const T& value);
+
}; // class SecurityPolicy
} // Magick namespace
#include "Magick++/SecurityPolicy.h"
#include "Magick++/Exception.h"
#include <string>
+#include <sstream>
using namespace std;
string
value;
- value=std::to_string(precision_);
+ value=toString(precision_);
return(setValue(SystemPolicyDomain,"precision",value));
}
string
value;
- value=std::to_string(limit_);
+ value=toString(limit_);
return(setValue(SystemPolicyDomain,"max-memory-request",value));
}
string
value;
- value=std::to_string(passes_);
+ value=toString(passes_);
return(setValue(SystemPolicyDomain,"shred",value));
}
value_.c_str(),exceptionInfo);
ThrowPPException(false);
return(status != MagickFalse);
+}
+
+template <typename T>
+static std::string Magick::SecurityPolicy::toString(const T& value)
+{
+ stringstream ss;
+ ss << value;
+ return ss.str();
}
\ No newline at end of file