mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-11-04 14:09:33 +01:00 
			
		
		
		
	Split out helper functions on std::string from catch_common.h
This commit is contained in:
		@@ -22,7 +22,6 @@
 | 
			
		||||
#define INTERNAL_CATCH_STRINGIFY( expr ) INTERNAL_CATCH_STRINGIFY2( expr )
 | 
			
		||||
 | 
			
		||||
#include <sstream>
 | 
			
		||||
#include <algorithm>
 | 
			
		||||
#include <exception>
 | 
			
		||||
 | 
			
		||||
namespace Catch {
 | 
			
		||||
@@ -45,26 +44,6 @@ namespace Catch {
 | 
			
		||||
        virtual ~NonCopyable();
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    bool startsWith( std::string const& s, std::string const& prefix );
 | 
			
		||||
    bool startsWith( std::string const& s, char prefix );
 | 
			
		||||
    bool endsWith( std::string const& s, std::string const& suffix );
 | 
			
		||||
    bool endsWith( std::string const& s, char suffix );
 | 
			
		||||
    bool contains( std::string const& s, std::string const& infix );
 | 
			
		||||
    void toLowerInPlace( std::string& s );
 | 
			
		||||
    std::string toLower( std::string const& s );
 | 
			
		||||
    std::string trim( std::string const& str );
 | 
			
		||||
    bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis );
 | 
			
		||||
 | 
			
		||||
    struct pluralise {
 | 
			
		||||
        pluralise( std::size_t count, std::string const& label );
 | 
			
		||||
 | 
			
		||||
        friend std::ostream& operator << ( std::ostream& os, pluralise const& pluraliser );
 | 
			
		||||
 | 
			
		||||
        std::size_t m_count;
 | 
			
		||||
        std::string m_label;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    struct SourceLineInfo {
 | 
			
		||||
 | 
			
		||||
        SourceLineInfo() noexcept;
 | 
			
		||||
@@ -98,9 +77,7 @@ namespace Catch {
 | 
			
		||||
    // as well as
 | 
			
		||||
    //    >> stuff +StreamEndStop
 | 
			
		||||
    struct StreamEndStop {
 | 
			
		||||
        std::string operator+() const {
 | 
			
		||||
            return std::string();
 | 
			
		||||
        }
 | 
			
		||||
        std::string operator+() const;
 | 
			
		||||
    };
 | 
			
		||||
    template<typename T>
 | 
			
		||||
    T const& operator + ( T const& value, StreamEndStop ) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user