4#include "Stroika/Foundation/StroikaPreComp.h"
6#include "Stroika/Foundation/Execution/Exceptions.h"
7#include "Stroika/Foundation/Execution/Throw.h"
8#if qStroika_Foundation_Common_Platform_Windows
9#include "Stroika/Foundation/Execution/Platform/Windows/Exception.h"
12#include "FStreamSupport.h"
15using namespace Stroika::Foundation::Streams;
23 constexpr auto kErrBitsToTreatAsExceptions_ = ifstream::badbit | ifstream::failbit;
31ifstream& Streams::iostream::OpenInputFileStream (ifstream* ifStream,
const filesystem::path& fileName, ios_base::openmode mode)
34 ifStream->exceptions (kErrBitsToTreatAsExceptions_);
35 ifStream->open (fileName, mode | ios_base::in);
36 Assert (ifStream->is_open ());
40ifstream& Streams::iostream::OpenInputFileStream (ifstream& tmpIFStream,
const filesystem::path& fileName, ios_base::openmode mode)
42 OpenInputFileStream (&tmpIFStream, fileName, mode);
51ofstream& Streams::iostream::OpenOutputFileStream (ofstream* ofStream,
const filesystem::path& fileName, ios_base::openmode mode)
54 ofStream->exceptions (kErrBitsToTreatAsExceptions_);
55 ofStream->open (fileName, mode | ios_base::out);
56 Assert (ofStream->is_open ());
60ofstream& Streams::iostream::OpenOutputFileStream (ofstream& tmpOfStream,
const filesystem::path& fileName, ios_base::openmode mode)
62 OpenOutputFileStream (&tmpOfStream, fileName, mode);
#define RequireNotNull(p)