From 3f4a0d5370ae6c34afe180df96add3b8522f4af1 Mon Sep 17 00:00:00 2001 From: mattkae Date: Wed, 11 May 2022 09:23:58 -0400 Subject: initial commit --- .../server/src/support/TemporaryFile.h | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 elpa/irony-20220110.849/server/src/support/TemporaryFile.h (limited to 'elpa/irony-20220110.849/server/src/support/TemporaryFile.h') diff --git a/elpa/irony-20220110.849/server/src/support/TemporaryFile.h b/elpa/irony-20220110.849/server/src/support/TemporaryFile.h new file mode 100644 index 0000000..5bf77f4 --- /dev/null +++ b/elpa/irony-20220110.849/server/src/support/TemporaryFile.h @@ -0,0 +1,36 @@ +/**-*-C++-*- + * \file + * \author Guillaume Papin + * + * \brief Not the best piece of code out there. + * + * This file is distributed under the GNU General Public License. See + * COPYING for details. + */ + +#ifndef IRONY_MODE_SERVER_SUPPORT_TEMPORARY_FILE_H_ +#define IRONY_MODE_SERVER_SUPPORT_TEMPORARY_FILE_H_ + +#include +#include +#include + +class TemporaryFile { + enum { + // if we can't create the temp file, exits. + MAX_ATTEMPS = 25 + }; + +public: + TemporaryFile(const std::string &prefix, const std::string &suffix = ""); + ~TemporaryFile(); + + /// Returns the path of this temporary filename + const std::string &getPath(); + +private: + std::string pathOrPattern_; + std::unique_ptr openedFile_; +}; + +#endif // IRONY_MODE_SERVER_SUPPORT_TEMPORARY_FILE_H_ -- cgit v1.2.1