Use std::string instead of StringRef as argument to the makeStream

This is done because `makeStream` was the only place using
`StringRef::c_str()`, which is an error-prone and unsafe API that
I want to remove.
This commit is contained in:
Martin Hořeňovský committed 2021-03-26 21:11:42 +01:00
1 parent 2c269eb633
commit e50e10ef8f
2 files changed
+4 -5

No files matched your search

+2 -3
View File
@@ -13,6 +13,7 @@
#include <iosfwd>
#include <cstddef>
#include <ostream>
#include <string>
namespace Catch {
@@ -20,14 +21,12 @@ namespace Catch {
std::ostream& cerr();
std::ostream& clog();
class StringRef;
struct IStream {
virtual ~IStream();
virtual std::ostream& stream() const = 0;
};
auto makeStream( StringRef const &filename ) -> IStream const*;
auto makeStream( std::string const& filename ) -> IStream const*;
class ReusableStringStream : Detail::NonCopyable {
std::size_t m_index;