summaryrefslogtreecommitdiff
path: root/src/options/open_ostream.h
diff options
context:
space:
mode:
authorGereon Kremer <nafur42@gmail.com>2021-08-04 11:35:41 -0700
committerGitHub <noreply@github.com>2021-08-04 18:35:41 +0000
commitcc9155e74a4c7fbbf66f736e0d6f67499329ba69 (patch)
tree7285753f9645683bc5190856bf61f250a9f62225 /src/options/open_ostream.h
parent3f2e127061ee03db1ba8ff56d9dfb42fbe9d60b1 (diff)
Refactor managed streams (#6934)
This PR introduces a new ManagedStream class that replaces the previous ManagedOstream. It allows to directly store the (wrapped) stream objects in the options. Handling the stream options is moved from the options manager to option predicates and the different options for input and output streams are combined into a single one. Some associated utilities (open_ostream.h and update_ostream.h) are now obsolete and thus removed.
Diffstat (limited to 'src/options/open_ostream.h')
-rw-r--r--src/options/open_ostream.h61
1 files changed, 0 insertions, 61 deletions
diff --git a/src/options/open_ostream.h b/src/options/open_ostream.h
deleted file mode 100644
index 162bf3f11..000000000
--- a/src/options/open_ostream.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/******************************************************************************
- * Top contributors (to current version):
- * Tim King, Mathias Preiner
- *
- * This file is part of the cvc5 project.
- *
- * Copyright (c) 2009-2021 by the authors listed in the file AUTHORS
- * in the top-level source directory and their institutional affiliations.
- * All rights reserved. See the file COPYING in the top-level source
- * directory for licensing information.
- * ****************************************************************************
- *
- * [[ Add one-line brief description here ]]
- *
- * [[ Add lengthier description here ]]
- * \todo document this file
- */
-
-#include "cvc5_private.h"
-
-#ifndef CVC5__OPEN_OSTREAM_H
-#define CVC5__OPEN_OSTREAM_H
-
-#include <iosfwd>
-#include <map>
-#include <string>
-#include <utility>
-
-namespace cvc5 {
-
-class OstreamOpener {
- public:
- OstreamOpener(const char* channelName);
-
- void addSpecialCase(const std::string& name, std::ostream* out);
-
- /**
- * If name == "", this throws OptionException with the message, messageIfEmpty.
- * If name is a special case, this return <false, out> where out is the
- * special case that was added.
- * If name == "std::cerr", this return <false, &cerr>.
- * If none of the previous conditions hold and !options::filesystemAccess(),
- * this throws an OptionException.
- * Otherwise, this attempts to open a ofstream using the filename, name.
- * If this fails, this throws and OptionException. If this succeeds, this
- * returns <true, stream> where stream is a ostream allocated by new.
- * The caller is in this case the owner of the allocated memory.
- */
- std::pair<bool, std::ostream*> open(const std::string& name) const;
-
- private:
- const char* d_channelName;
- std::map< std::string, std::ostream* > d_specialCases;
-
-}; /* class OstreamOpener */
-
-std::string cvc5_errno_failreason();
-
-} // namespace cvc5
-
-#endif /* CVC5__OPEN_OSTREAM_H */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback