Author: dmacvicar Date: Thu Jul 31 19:08:18 2008 New Revision: 10711 URL: http://svn.opensuse.org/viewcvs/zypp?rev=10711&view=rev Log: add example code Modified: trunk/libzypp/zypp/ExternalProgram.h Modified: trunk/libzypp/zypp/ExternalProgram.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ExternalProgram.h?rev=10711&r1=10710&r2=10711&view=diff ============================================================================== --- trunk/libzypp/zypp/ExternalProgram.h (original) +++ trunk/libzypp/zypp/ExternalProgram.h Thu Jul 31 19:08:18 2008 @@ -27,6 +27,30 @@ * an external program. It starts the program using fork * and some exec.. call, gives you access to the program's * stdio and closes the program after use. + * + * \code + * + * const char* argv[] = + * { + * "/usr/bin/foo, + * "--option1", + * "--option2", + * NULL + * }; + * + * ExternalProgram prog( argv, + * ExternalProgram::Discard_Stderr, + * false, -1, true); + * string line; + * for(line = prog.receiveLine(); + * ! line.empty(); + * line = prog.receiveLine() ) + * { + * stream << line; + * } + * prog.close(); + * + * \endcode */ class ExternalProgram : public zypp::externalprogram::ExternalDataSource { -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org