Remove gmx::File (except for File::exists())
[alexxy/gromacs.git] / src / gromacs / utility / textwriter.h
index c473b8c279e63c7113047ea998ec8297e7709db8..de83c98d8a9e609d8d08b216a628a209c18e6b89 100644 (file)
@@ -66,6 +66,19 @@ namespace gmx
 class TextWriter
 {
     public:
+        /*! \brief
+         * Convenience method for writing a file from a string in a single call.
+         *
+         * \param[in] filename  Name of the file to read.
+         * \param[in] text      String to write to \p filename.
+         * \throws    std::bad_alloc if out of memory.
+         * \throws    FileIOError on any I/O error.
+         *
+         * If \p filename exists, it is overwritten.
+         */
+        static void writeFileFromString(const std::string &filename,
+                                        const std::string &text);
+
         /*! \brief
          * Creates a writer that writes to specified file.
          *