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:
2 files changed
+4
-5
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user