Magick++  7.1.2-29
Convert, Edit, Or Compose Bitmap Images
SecurityPolicy.h
1 // This may look like C code, but it is really -*- C++ -*-
2 //
3 // Copyright @ 2018 ImageMagick Studio LLC, a non-profit organization
4 // dedicated to making software imaging solutions freely available.
5 //
6 // Definition of the security policy.
7 //
8 
9 #if !defined(Magick_SecurityPolicy_header)
10 #define Magick_SecurityPolicy_header
11 
12 #include "Magick++/Include.h"
13 #include <string>
14 
15 namespace Magick
16 {
17  class MagickPPExport SecurityPolicy
18  {
19  public:
20 
21  // The maximum number of significant digits to be printed.
22  static bool precision(const int precision_);
23 
24  // Enables anonymous mapping for pixel cache.
25  static bool anonymousCacheMemoryMap();
26 
27  // Enables anonymous virtual memory.
28  static bool anonymousSystemMemoryMap();
29 
30  // The memory request limit in bytes.
31  static bool maxMemoryRequest(const MagickSizeType limit_);
32 
33  // The maximum size of a profile in bytes.
34  static bool maxProfileSize(const MagickSizeType limit_);
35 
36  // The number of passes to use when shredding files.
37  static bool shred(const int passes_);
38 
39  private:
40  SecurityPolicy(void);
41 
42  static bool setValue(const PolicyDomain domain_, const std::string name_,
43  const std::string value_);
44 
45  template <typename T>
46  static std::string toString(const T& value);
47 
48  }; // class SecurityPolicy
49 
50 } // Magick namespace
51 
52 #endif // Magick_SecurityPolicy_header