Apply clang-format to source tree
[alexxy/gromacs.git] / src / gromacs / utility / fileredirector.h
index 2a190f0da88a5f57eb3490f39ad19c5947880810..3560011cfb6c30566e2f3305ac70c53120e35e5b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 2015,2019, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -70,25 +70,23 @@ namespace gmx
  */
 class IFileInputRedirector
 {
-    public:
-        virtual ~IFileInputRedirector();
+public:
+    virtual ~IFileInputRedirector();
 
-        /*! \brief
-         * Checks whether the provided path exists (and is a file).
-         *
-         * The \p onNotFound can be used to influence the behavior on error
-         * conditions.  Functions to pass as this parameter are provided as
-         * members of gmx::File.
-         */
-        virtual bool fileExists(const char            *filename,
-                                File::NotFoundHandler  onNotFound) const = 0;
+    /*! \brief
+     * Checks whether the provided path exists (and is a file).
+     *
+     * The \p onNotFound can be used to influence the behavior on error
+     * conditions.  Functions to pass as this parameter are provided as
+     * members of gmx::File.
+     */
+    virtual bool fileExists(const char* filename, File::NotFoundHandler onNotFound) const = 0;
 
-        //! Convenience method to check file existence using an std::string path.
-        bool fileExists(const std::string     &filename,
-                        File::NotFoundHandler  onNotFound) const
-        {
-            return fileExists(filename.c_str(), onNotFound);
-        }
+    //! Convenience method to check file existence using an std::string path.
+    bool fileExists(const std::string& filename, File::NotFoundHandler onNotFound) const
+    {
+        return fileExists(filename.c_str(), onNotFound);
+    }
 };
 
 /*! \libinternal \brief
@@ -119,25 +117,25 @@ class IFileInputRedirector
  */
 class IFileOutputRedirector
 {
-    public:
-        virtual ~IFileOutputRedirector();
+public:
+    virtual ~IFileOutputRedirector();
 
-        /*! \brief
-         * Returns a stream to use for `stdout` output.
-         */
-        virtual TextOutputStream &standardOutput() = 0;
-        /*! \brief
-         * Returns a stream to use for output to a file at a given path.
-         *
-         * \param[in] filename  Requested file name.
-         */
-        virtual TextOutputStreamPointer openTextOutputFile(const char *filename) = 0;
+    /*! \brief
+     * Returns a stream to use for `stdout` output.
+     */
+    virtual TextOutputStream& standardOutput() = 0;
+    /*! \brief
+     * Returns a stream to use for output to a file at a given path.
+     *
+     * \param[in] filename  Requested file name.
+     */
+    virtual TextOutputStreamPointer openTextOutputFile(const char* filename) = 0;
 
-        //! Convenience method to open a stream using an std::string path.
-        TextOutputStreamPointer openTextOutputFile(const std::string &filename)
-        {
-            return openTextOutputFile(filename.c_str());
-        }
+    //! Convenience method to open a stream using an std::string path.
+    TextOutputStreamPointer openTextOutputFile(const std::string& filename)
+    {
+        return openTextOutputFile(filename.c_str());
+    }
 };
 
 //! \cond libapi
@@ -151,7 +149,7 @@ class IFileOutputRedirector
  *
  * \ingroup module_utility
  */
-IFileInputRedirector &defaultFileInputRedirector();
+IFileInputRedirectordefaultFileInputRedirector();
 /*! \brief
  * Returns default implementation for IFileOutputRedirector.
  *
@@ -162,7 +160,7 @@ IFileInputRedirector &defaultFileInputRedirector();
  *
  * \ingroup module_utility
  */
-IFileOutputRedirector &defaultFileOutputRedirector();
+IFileOutputRedirectordefaultFileOutputRedirector();
 //! \endcond
 
 } // namespace gmx