Fix xml representations
[anna.git] / source / diameter / codec / EngineImpl.cpp
index 9d23e57..50b8134 100644 (file)
@@ -85,9 +85,13 @@ Message* EngineImpl::createMessage(const CommandId *id) throw(anna::RuntimeExcep
 //------------------------------------------------------------------------------
 //-------------------------------------------------- EngineImpl::createMessage()
 //------------------------------------------------------------------------------
-Message *EngineImpl::createMessage(const std::string & xmlPathFile) throw(anna::RuntimeException) {
+Message *EngineImpl::createMessage(const std::string & xmlPathFile_or_string, bool pathfile_or_string) throw(anna::RuntimeException) {
   Message *result = createMessage();
-  result->loadXMLFile(xmlPathFile);
+  if (pathfile_or_string)
+    result->loadXMLFile(xmlPathFile_or_string);
+  else
+    result->loadXMLString(xmlPathFile_or_string);
+
   return result;
 }
 
@@ -106,7 +110,7 @@ std::string EngineImpl::asString(void) const throw() {
   result += "\nFixMode: ";
   result += asText(a_fixMode);
   result += "\nActivated Dictionary: ";
-  result += a_dictionary ? (a_dictionary->getName()) : "<null>";
+  result += a_dictionary ? (a_dictionary->getName()) : "[null]";
   return result;
 }