Sort all includes in src/gromacs
[alexxy/gromacs.git] / src / gromacs / commandline / cmdlinemodulemanager.h
index 785667e1663ab12d73dc37b565440581be8b9f89..62b39488ca28461e37673d088c16cbd36b9bc236 100644 (file)
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-/*! \file
+/*! \libinternal \file
  * \brief
  * Declares gmx::CommandLineModuleManager.
  *
  * \author Teemu Murtola <teemu.murtola@gmail.com>
- * \inpublicapi
+ * \inlibraryapi
  * \ingroup module_commandline
  */
 #ifndef GMX_COMMANDLINE_CMDLINEMODULEMANAGER_H
 #define GMX_COMMANDLINE_CMDLINEMODULEMANAGER_H
 
-#include "../onlinehelp/helptopicinterface.h"
-#include "../utility/common.h"
-#include "../utility/uniqueptr.h"
+#include "gromacs/onlinehelp/helptopicinterface.h"
+#include "gromacs/utility/common.h"
+#include "gromacs/utility/uniqueptr.h"
 
 namespace gmx
 {
@@ -54,12 +54,16 @@ class CommandLineModuleGroup;
 class CommandLineModuleGroupData;
 class CommandLineModuleInterface;
 class CommandLineProgramContext;
+class File;
+
+//! \addtogroup module_commandline
+//! \{
 
 //! Smart pointer type for managing a CommandLineModuleInterface.
 typedef gmx_unique_ptr<CommandLineModuleInterface>::type
     CommandLineModulePointer;
 
-/*! \brief
+/*! \libinternal \brief
  * Implements a wrapper command-line interface for multiple modules.
  *
  * Typical usage:
@@ -83,8 +87,8 @@ typedef gmx_unique_ptr<CommandLineModuleInterface>::type
    }
  * \endcode
  *
- * \inpublicapi
- * \ingroup module_commandline
+ * \see page_wrapperbinary
+ * \inlibraryapi
  */
 class CommandLineModuleManager
 {
@@ -179,12 +183,26 @@ class CommandLineModuleManager
          *
          * \param[in] bQuiet  Whether the module manager should remain silent.
          *
-         * Normally, the module manager prints out some information to stderr
+         * Normally, the module manager prints out some information to `stderr`
          * before it starts the module and after it finishes.  This removes
          * that output, which is useful in particular for unit tests so that
-         * they don't spam stderr.
+         * they don't spam `stderr`.
          */
         void setQuiet(bool bQuiet);
+        /*! \brief
+         * Redirects the output of the module manager to a file.
+         *
+         * \param[in] output  File to write the output to.
+         *
+         * Normally, the module manager prints explicitly requested text such
+         * as help output to `stdout`, but this method can be used to redirect
+         * that output to a file.  This is used for unit tests, either to keep
+         * them quiet or to verify that output.  To keep implementation options
+         * open, behavior with `output == NULL` is undefined and should not be
+         * relied on.  For tests, there should only be need to call this a
+         * single time, right after creating the manager.
+         */
+        void setOutputRedirect(File *output);
 
         /*! \brief
          * Makes the manager always run a single module.
@@ -301,7 +319,7 @@ class CommandLineModuleManager
         PrivateImplPointer<Impl> impl_;
 };
 
-/*! \brief
+/*! \libinternal \brief
  * Handle to add content to a group added with
  * CommandLineModuleManager::addModuleGroup().
  *
@@ -310,8 +328,7 @@ class CommandLineModuleManager
  * point to the same group.  The actual state of the group is maintained in an
  * internal implementation class.
  *
- * \inpublicapi
- * \ingroup module_commandline
+ * \inlibraryapi
  */
 class CommandLineModuleGroup
 {
@@ -353,6 +370,8 @@ class CommandLineModuleGroup
         Impl                     *impl_;
 };
 
+//! \}
+
 } // namespace gmx
 
 #endif