From: Eduardo Ramos Testillano Date: Mon, 6 Apr 2015 16:03:29 +0000 (+0200) Subject: Code is more portable (older compilers does not accept ofstream with std::string... X-Git-Tag: REFACTORING_TESTING_LIBRARY~180 X-Git-Url: https://git.teslayout.com/public/public/public/?a=commitdiff_plain;h=8e8c238b257e920a77a94c5db25afb50dc3418c0;p=anna.git Code is more portable (older compilers does not accept ofstream with std::string as file) --- 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(