diff OrthancServer/DicomModification.h @ 1698:d78b87f93bcf

DicomModification use Json::Value
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 09 Oct 2015 12:29:21 +0200
parents 18c02c6987d5
children b1291df2f780
line wrap: on
line diff
--- a/OrthancServer/DicomModification.h	Thu Oct 08 14:52:03 2015 +0200
+++ b/OrthancServer/DicomModification.h	Fri Oct 09 12:29:21 2015 +0200
@@ -36,7 +36,7 @@
 
 namespace Orthanc
 {
-  class DicomModification
+  class DicomModification : public boost::noncopyable
   {
     /**
      * Process:
@@ -47,7 +47,7 @@
 
   private:
     typedef std::set<DicomTag> SetOfTags;
-    typedef std::map<DicomTag, std::string> Replacements;
+    typedef std::map<DicomTag, Json::Value*> Replacements;
     typedef std::map< std::pair<ResourceType, std::string>, std::string>  UidMap;
 
     SetOfTags removals_;
@@ -63,9 +63,18 @@
 
     void MarkNotOrthancAnonymization();
 
+    void ClearReplacements();
+
+    void RemoveInternal(const DicomTag& tag);
+
+    void ReplaceInternal(const DicomTag& tag,
+                         const Json::Value& value);
+
   public:
     DicomModification();
 
+    ~DicomModification();
+
     void Keep(const DicomTag& tag);
 
     void Remove(const DicomTag& tag);
@@ -73,12 +82,14 @@
     bool IsRemoved(const DicomTag& tag) const;
 
     void Replace(const DicomTag& tag,
-                 const std::string& utf8Value,
+                 const Json::Value& value,   // Encoded using UTF-8
                  bool safeForAnonymization = false);
 
     bool IsReplaced(const DicomTag& tag) const;
 
-    const std::string& GetReplacement(const DicomTag& tag) const;
+    const Json::Value& GetReplacement(const DicomTag& tag) const;
+
+    std::string GetReplacementAsString(const DicomTag& tag) const;
 
     void SetRemovePrivateTags(bool removed);