Add nlohmann/json parser
[anna.git] / example / diameter / batchConverter / main.cpp
index ae2ffdc..7a7a2f4 100644 (file)
@@ -73,7 +73,7 @@ bool decodeDataBlock(const anna::DataBlock &db/*, unsigned int & detectedApplica
     G_codecMsg.clear();
     G_codecMsg.decode(db);
   } catch(RuntimeException &ex) {
-    std::cerr << ex.asString() << std::endl << std::endl; 
+    std::cerr << ex.asString() << std::endl << std::endl;
     //_exit(ex.asString());
     return false;
   }
@@ -194,7 +194,7 @@ int main(int argc, char **argv) {
   directoryHex.read(wkDir.c_str(), anna::io::Directory::Mode::FullPath);
   directoryXml.setPattern(".xml$");
   directoryXml.read(wkDir.c_str(), anna::io::Directory::Mode::FullPath);
-  
+
   // Processing .hex files:
   bool anyHexConverted = false;
   if (processHex) {
@@ -225,17 +225,17 @@ int main(int argc, char **argv) {
     for (anna::io::Directory::const_iterator it = directoryXml.begin(); it != directoryXml.end(); it++) {
       const std::string& entry = anna::io::Directory::data (it);
       LOGDEBUG(anna::Logger::debug(entry + " is being converted to hex", ANNA_FILE_LOCATION));
-  
+
       // Load file:
-      G_codecMsg.loadXML(entry);  
-      
+      G_codecMsg.loadXMLFile(entry);
+
       // Write conversion:
       std::string hexString = anna::functions::asHexString(G_codecMsg.code());
       std::string outputFile = entry + ".as.hex";
       std::ofstream out(outputFile.c_str(), std::ifstream::out);
       out.write(hexString.c_str(), hexString.size());
       out.close();
-  
+
       anyXmlConverted = true;
     }
   }