From 8e8c238b257e920a77a94c5db25afb50dc3418c0 Mon Sep 17 00:00:00 2001 From: Eduardo Ramos Testillano Date: Mon, 6 Apr 2015 18:03:29 +0200 Subject: [PATCH] Code is more portable (older compilers does not accept ofstream with std::string as file) --- example/diameter/launcher/main.cpp | 2 +- example/diameter/pcapDecoder/main.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/example/diameter/launcher/main.cpp b/example/diameter/launcher/main.cpp index 2916704..5a5db42 100644 --- a/example/diameter/launcher/main.cpp +++ b/example/diameter/launcher/main.cpp @@ -1503,7 +1503,7 @@ throw(anna::RuntimeException) { if(lst.size() > 1) { std::string all_in_one = "./dictionary-all-in-one.xml"; - std::ofstream out(all_in_one, std::ifstream::out); + std::ofstream out(all_in_one.c_str(), std::ifstream::out); std::string buffer = d->asXMLString(); out.write(buffer.c_str(), buffer.size()); out.close(); diff --git a/example/diameter/pcapDecoder/main.cpp b/example/diameter/pcapDecoder/main.cpp index 672c619..cfa6c5f 100644 --- a/example/diameter/pcapDecoder/main.cpp +++ b/example/diameter/pcapDecoder/main.cpp @@ -439,7 +439,7 @@ int main(int argc, char **argv) { decodeDataBlock(db_aux, detectedApplicationId); // Open output file: outputFile += ".as.xml"; - std::ofstream out(outputFile, std::ifstream::out); + std::ofstream out(outputFile.c_str(), std::ifstream::out); out << G_codecMsg.asXMLString(); // Close output file: out.close(); @@ -475,7 +475,7 @@ int main(int argc, char **argv) { // Print payloads ////////////////////////////////////////////////////////////////////////////////////////////// // Open output file: outputFile += ".report"; - std::ofstream out(outputFile, std::ifstream::out); + std::ofstream out(outputFile.c_str(), std::ifstream::out); for(payloads_it it = G_payloads.begin(); it != G_payloads.end(); it++) { LOGDEBUG( -- 2.20.1