[Mockpp-commits] mockpp/mockpp/compat Formatter.h,1.34,1.35
Brought to you by:
ewald-arnold
From: Ewald A. <ewa...@us...> - 2005-11-27 15:34:53
|
Update of /cvsroot/mockpp/mockpp/mockpp/compat In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19644/mockpp/compat Modified Files: Formatter.h Log Message: optionally disable runtime type information (rtti) Index: Formatter.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/compat/Formatter.h,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- Formatter.h 26 Nov 2005 17:56:44 -0000 1.34 +++ Formatter.h 27 Nov 2005 15:34:36 -0000 1.35 @@ -268,6 +268,7 @@ * Replaces the lowest %-parameter with the string representation of the data. * "hello %1" << 9 gives "hello 9" * @ingroup grp_helper + * @note Only meaningful if RTTI is actually enabled at compile time. * @param formatter target string with position parameter * @param o value by reference to output * @return the resulting string @@ -276,7 +277,11 @@ mockpp::String & MOCKPP_EXPORT operator << (mockpp::String &formatter, const T &o) { mockpp::String s = MOCKPP_PCHAR("[") +#ifdef MOCKPP_NO_RTTI + + MOCKPP_GET_STRING("[rtti-disabled]") +#else + MOCKPP_GET_STRING(typeid(o).name()) +#endif + MOCKPP_PCHAR("&]"); formatter << s; return formatter; @@ -286,6 +291,7 @@ /** Fallback output: replace a positional %-parameter with a values typeid name. * Replaces the lowest %-parameter with the string representation of the data. * "hello %1" << 9 gives "hello 9" + * @note Only meaningful if RTTI is actually enabled at compile time. * @ingroup grp_helper * @param formatter target string with position parameter * @param po value by pointer to output @@ -295,7 +301,11 @@ mockpp::String & MOCKPP_EXPORT operator << (mockpp::String &formatter, const T * &po) { mockpp::String s = MOCKPP_PCHAR("[") +#ifdef MOCKPP_NO_RTTI + + MOCKPP_GET_STRING("[rtti-disabled]") +#else + MOCKPP_GET_STRING(typeid(*po).name()) +#endif + MOCKPP_PCHAR("*]"); formatter << s; return formatter; |