Fixed toString for NSString* in Xcode 4.4

This commit is contained in:
Phil Nash 2012-08-01 08:17:07 +01:00
parent 61756974d0
commit 0dc9e43c02
7 changed files with 135 additions and 80 deletions

View file

@ -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