X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=blobdiff_plain;f=src%2Fgromacs%2Futility%2Ftextwriter.h;h=de83c98d8a9e609d8d08b216a628a209c18e6b89;hb=1d597ac0415f9a847715ef65daa55fe1312bd59f;hp=c473b8c279e63c7113047ea998ec8297e7709db8;hpb=8bb9e38caa59684b3731a434a603c78beaf9a87a;p=alexxy%2Fgromacs.git diff --git a/src/gromacs/utility/textwriter.h b/src/gromacs/utility/textwriter.h index c473b8c279..de83c98d8a 100644 --- a/src/gromacs/utility/textwriter.h +++ b/src/gromacs/utility/textwriter.h @@ -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. *