Skip to content

v0.2.47..v0.2.48 changeset ConfigUtils.cpp

Garret Voltz edited this page Sep 27, 2019 · 1 revision
diff --git a/hoot-core/src/main/cpp/hoot/core/util/ConfigUtils.cpp b/hoot-core/src/main/cpp/hoot/core/util/ConfigUtils.cpp
index 1d18500..4991b65 100644
--- a/hoot-core/src/main/cpp/hoot/core/util/ConfigUtils.cpp
+++ b/hoot-core/src/main/cpp/hoot/core/util/ConfigUtils.cpp
@@ -22,13 +22,17 @@
  * This will properly maintain the copyright information. DigitalGlobe
  * copyrights will be updated automatically.
  *
- * @copyright Copyright (C) 2015, 2017 DigitalGlobe (http://www.digitalglobe.com/)
+ * @copyright Copyright (C) 2015, 2017, 2019 DigitalGlobe (http://www.digitalglobe.com/)
  */
 
 #include "ConfigUtils.h"
 
 // Hoot
 #include <hoot/core/util/ConfigOptions.h>
+#include <hoot/core/visitors/ApiTagTruncateVisitor.h>
+
+// Qt
+#include <QStringList>
 
 namespace hoot
 {
@@ -41,4 +45,26 @@ bool ConfigUtils::boundsOptionEnabled()
     !conf().get(ConfigOptions::getConvertBoundingBoxOsmApiDatabaseKey()).toString().trimmed().isEmpty();
 }
 
+void ConfigUtils::checkForTagValueTruncationOverride()
+{
+  // Disable tag truncation if the override option is in place.
+  if (ConfigOptions().getConflateTagDisableValueTruncation())
+  {
+    QStringList conflatePreOps = ConfigOptions().getConflatePreOps();
+    int numFound =
+      conflatePreOps.removeAll(QString::fromStdString(ApiTagTruncateVisitor::className()));
+    if (numFound > 0)
+    {
+      conf().set("conflate.pre.ops", conflatePreOps);
+    }
+    QStringList conflatePostOps = ConfigOptions().getConflatePostOps();
+    numFound =
+      conflatePostOps.removeAll(QString::fromStdString(ApiTagTruncateVisitor::className()));
+    if (numFound > 0)
+    {
+      conf().set("conflate.post.ops", conflatePostOps);
+    }
+  }
+}
+
 }
Clone this wiki locally