From 18759092e17422bf290f95f52243a73fd16d867f Mon Sep 17 00:00:00 2001 From: Ryan Long Date: Wed, 22 Sep 2021 14:53:12 -0400 Subject: Explanations: Convert to C++ --- tester/covoar/Explanations.cc | 10 +++++----- tester/covoar/Explanations.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tester/covoar/Explanations.cc b/tester/covoar/Explanations.cc index 4142418..028c00e 100644 --- a/tester/covoar/Explanations.cc +++ b/tester/covoar/Explanations.cc @@ -27,14 +27,14 @@ namespace Coverage { } void Explanations::load( - const char* const explanations + const std::string& explanations ) { std::ifstream explain; Explanation e; int line = 1; - if (!explanations) + if (explanations.empty()) return; explain.open( explanations ); @@ -121,13 +121,13 @@ namespace Coverage { } void Explanations::writeNotFound( - const char* const fileName + const std::string& fileName ) { std::ofstream notFoundFile; bool notFoundOccurred = false; - if (!fileName) + if (fileName.empty()) return; notFoundFile.open( fileName ); @@ -151,7 +151,7 @@ namespace Coverage { } if (!notFoundOccurred) { - if (!unlink( fileName )) { + if (!unlink( fileName.c_str())) { std::cerr << "Warning: Unable to unlink " << fileName << std::endl << std::endl; diff --git a/tester/covoar/Explanations.h b/tester/covoar/Explanations.h index de0c051..ca7c749 100644 --- a/tester/covoar/Explanations.h +++ b/tester/covoar/Explanations.h @@ -88,7 +88,7 @@ namespace Coverage { * the explanation information */ void load( - const char* const explanations + const std::string& explanations ); /*! @@ -109,7 +109,7 @@ namespace Coverage { * @param[in] fileName specifies the name of the file to write */ void writeNotFound( - const char* const fileName + const std::string& fileName ); }; -- cgit v1.2.3