mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-27 15:09:33 +00:00
Fixed toString for NSString* in Xcode 4.4
This commit is contained in:
parent
61756974d0
commit
0dc9e43c02
7 changed files with 135 additions and 80 deletions
|
@ -11,6 +11,10 @@
|
|||
#include "catch_common.h"
|
||||
#include <sstream>
|
||||
|
||||
#ifdef __OBJC__
|
||||
#include "catch_objc_arc.hpp"
|
||||
#endif
|
||||
|
||||
namespace Catch {
|
||||
namespace Detail {
|
||||
|
||||
|
@ -131,6 +135,21 @@ inline std::string toString( std::nullptr_t ) {
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef __OBJC__
|
||||
// inline std::string toString( NSString* const& nsstring ) {
|
||||
// return std::string( "@\"" ) + [nsstring UTF8String] + "\"";
|
||||
// }
|
||||
inline std::string toString( NSString const * const& nsstring ) {
|
||||
return std::string( "@\"" ) + [nsstring UTF8String] + "\"";
|
||||
}
|
||||
inline std::string toString( NSString * CATCH_ARC_STRONG const& nsstring ) {
|
||||
return std::string( "@\"" ) + [nsstring UTF8String] + "\"";
|
||||
}
|
||||
inline std::string toString( NSObject* const& nsObject ) {
|
||||
return toString( [nsObject description] );
|
||||
}
|
||||
#endif
|
||||
|
||||
} // end namespace Catch
|
||||
|
||||
#endif // TWOBLUECUBES_CATCH_TOSTRING_HPP_INCLUDED
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue