GridDataOutput: avoid stringstream member

This commit is contained in:
Arne Morten Kvarving 2024-01-30 11:52:22 +01:00
parent 54c386ae2c
commit a588d4196d

View File

@ -24,7 +24,8 @@
#include <dune/grid/common/partitionset.hh> #include <dune/grid/common/partitionset.hh>
#include <sstream> #include <iosfwd>
#include <string>
/** @file /** @file
@brief Allows model geometry data to be passed to external code - via a copy @brief Allows model geometry data to be passed to external code - via a copy
@ -338,20 +339,17 @@ public:
std::string getError() const std::string getError() const
{ {
return error_strm_.str(); return error_;
} }
void clearError() void clearError()
{ {
error_strm_.str(""); error_.clear();
} }
bool hasError() const bool hasError() const
{ {
if (error_strm_.str().length() > 0) return !error_.empty();
return true;
else
return false;
} }
protected: protected:
@ -376,7 +374,7 @@ protected:
int dimw_; // dimensions of the input grid int dimw_; // dimensions of the input grid
private: private:
std::stringstream error_strm_; std::string error_;
}; };
} // namespace Opm::GridDataOutput } // namespace Opm::GridDataOutput