Update of /cvsroot/mockpp/mockpp/mockpp/chaining
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21405/mockpp/chaining
Modified Files:
AbstractInvocationDispatcher.h
Log Message:
format multiline output
Index: AbstractInvocationDispatcher.h
===================================================================
RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/AbstractInvocationDispatcher.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- AbstractInvocationDispatcher.h 22 Mar 2005 22:03:22 -0000 1.14
+++ AbstractInvocationDispatcher.h 8 Apr 2005 21:43:51 -0000 1.15
@@ -139,16 +139,28 @@
private:
/** Transforms the invokables to a human readable string.
- * @return the string representation
+ * @param out_result reference to the output string
*/
- void writeInvokablesTo( String &result ) const
+ void writeInvokablesTo( String &out_result ) const
{
+ unsigned lines = 0;
+ String result;
for ( unsigned i = 0; i < invokables.size(); ++i )
+ {
if ( invokables[ i ] ->hasDescription() )
{
- invokables[ i ] ->describeTo( result );
- result += MOCKPP_PCHAR( "\n" );
+ ++lines;
+ String s;
+ invokables[ i ] ->describeTo( s );
+ if (lines > 1)
+ s.insert(0, MOCKPP_PCHAR(" - "));
+ result += s + MOCKPP_PCHAR( "\n" );
}
+ }
+
+ if (lines > 1)
+ out_result += MOCKPP_PCHAR("\n - ");
+ out_result += result;
}
/** Checks if any invokable has a description.
|