comparison 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
comparison
equal deleted inserted replaced
303:495b6f325e35 304:dd4b0edd1661
25 25
26 #include <boost/lexical_cast.hpp> 26 #include <boost/lexical_cast.hpp>
27 27
28 namespace OrthancDatabases 28 namespace OrthancDatabases
29 { 29 {
30 Dialect GenericFormatter::GetDialect() const
31 {
32 if (autoincrementDialect_ != namedDialect_)
33 {
34 // The two dialects do not match because of a previous call to
35 // SetAutoincrementDialect() or SetNamedDialect()
36 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
37 }
38 else
39 {
40 return namedDialect_;
41 }
42 }
43
44
30 void GenericFormatter::Format(std::string& target, 45 void GenericFormatter::Format(std::string& target,
31 const std::string& source, 46 const std::string& source,
32 ValueType type) 47 ValueType type)
33 { 48 {
34 if (source.empty()) 49 if (source.empty())