summaryrefslogtreecommitdiffstats
path: root/src/OSSupport
diff options
context:
space:
mode:
Diffstat (limited to 'src/OSSupport')
-rw-r--r--src/OSSupport/File.cpp26
-rw-r--r--src/OSSupport/File.h12
2 files changed, 11 insertions, 27 deletions
diff --git a/src/OSSupport/File.cpp b/src/OSSupport/File.cpp
index 113acc3a5..8c5eb92a4 100644
--- a/src/OSSupport/File.cpp
+++ b/src/OSSupport/File.cpp
@@ -709,29 +709,3 @@ void cFile::Flush(void)
{
fflush(m_File);
}
-
-
-
-
-
-template <class StreamType>
-FileStream<StreamType>::FileStream(const std::string & Path) :
- StreamType()
-{
- // Except on failbit, which is what open sets on failure:
- FileStream::exceptions(FileStream::failbit | FileStream::badbit);
-
- // Open the file:
- FileStream::open(Path);
-
- // Only subsequently except on serious errors, and not on conditions like EOF or malformed input:
- FileStream::exceptions(FileStream::badbit);
-}
-
-
-
-
-
-// Instantiate the templated wrapper for input and output:
-template class FileStream<std::ifstream>;
-template class FileStream<std::ofstream>;
diff --git a/src/OSSupport/File.h b/src/OSSupport/File.h
index 62853ede7..59f3a5558 100644
--- a/src/OSSupport/File.h
+++ b/src/OSSupport/File.h
@@ -192,7 +192,17 @@ class FileStream final : public StreamType
{
public:
- FileStream(const std::string & Path);
+ FileStream(const std::string & Path)
+ {
+ // Except on failbit, which is what open sets on failure:
+ FileStream::exceptions(FileStream::failbit | FileStream::badbit);
+
+ // Open the file:
+ FileStream::open(Path);
+
+ // Only subsequently except on serious errors, and not on conditions like EOF or malformed input:
+ FileStream::exceptions(FileStream::badbit);
+ }
};