Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/internal/catch_stream.hpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2021-03-25 19:30:59 +0100
committerMartin Hořeňovský2021-03-26 21:11:42 +0100
commite50e10ef8f06dbeac8f92daffc9344bb7621daf1 (patch)
treef0b90ab50267f260a88d94873f4d235bd67b62fe /src/catch2/internal/catch_stream.hpp
parent2c269eb6332bc1dd29047851ae1efc3cd4c260d2 (diff)
downloadcatch3-e50e10ef8f06dbeac8f92daffc9344bb7621daf1.tar.gz
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.
Diffstat (limited to 'src/catch2/internal/catch_stream.hpp')
-rw-r--r--src/catch2/internal/catch_stream.hpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/catch2/internal/catch_stream.hpp b/src/catch2/internal/catch_stream.hpp
index 5f24fc38..4ff012d2 100644
--- a/src/catch2/internal/catch_stream.hpp
+++ b/src/catch2/internal/catch_stream.hpp
@@ -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;