diff Framework/Common/GenericFormatter.cpp @ 304:dd4b0edd1661

GenericFormatter::GetDialect()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 09 Jul 2021 17:23:24 +0200
parents 495b6f325e35
children 16aac0287485
line wrap: on
line diff
--- a/Framework/Common/GenericFormatter.cpp	Fri Jul 09 16:46:50 2021 +0200
+++ b/Framework/Common/GenericFormatter.cpp	Fri Jul 09 17:23:24 2021 +0200
@@ -27,6 +27,21 @@
 
 namespace OrthancDatabases
 {
+  Dialect GenericFormatter::GetDialect() const
+  {
+    if (autoincrementDialect_ != namedDialect_)
+    {
+      // The two dialects do not match because of a previous call to
+      // SetAutoincrementDialect() or SetNamedDialect()
+      throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
+    }
+    else
+    {
+      return namedDialect_;
+    }
+  }
+  
+
   void GenericFormatter::Format(std::string& target,
                                 const std::string& source,
                                 ValueType type)