pcapDecoder allows .hex files as input. Make public some Avp methods for serializatio...
[anna.git] / example / diameter / launcher / main.cpp
index 54fcbdc..7a08518 100644 (file)
@@ -358,7 +358,7 @@ public:
 bool Launcher::getDataBlockFromHexFile(const std::string &pathfile, anna::DataBlock &db) const throw() {
 
   // Get hex string
-  static char buffer[2048];
+  static char buffer[8192];
   std::ifstream infile(pathfile.c_str(), std::ifstream::in);
   if(infile.is_open()) {
     infile >> buffer;
@@ -1505,6 +1505,16 @@ throw(anna::RuntimeException) {
 
       codecEngine->setDictionary(d);
       LOGDEBUG(anna::Logger::debug(codecEngine->asString(), ANNA_FILE_LOCATION));
+
+      if (lst.size() > 1) {
+        std::string all_in_one = "./dictionary-all-in-one.xml";
+        std::ofstream out(all_in_one, std::ifstream::out);
+        std::string buffer = d->asXMLString();
+        out.write(buffer.c_str(), buffer.size());
+        out.close();
+        std::cout << "Written accumulated '" << all_in_one << "' (provide it next time to be more comfortable)." << std::endl;
+      }
+
    } catch (anna::RuntimeException &ex) {
       ex.trace();
    }