Function open

Synopsis

#include <Source/Falcor/Utils/BinaryFileStream.h>

void open(const std::string &filename, Mode mode=Mode::ReadWrite)

Description

Opens a file stream. Fails if a file is already open.

Parameters:

[ in ] filename - Name of file to open or create

[ in ] mode - Mode to open file as

Source

Lines 72-79 in Source/Falcor/Utils/BinaryFileStream.h.

void open(const std::string& filename, Mode mode = Mode::ReadWrite)
{
    std::ios::openmode iosMode = std::ios::binary;
    iosMode |= ((mode == Mode::Read) || (mode == Mode::ReadWrite)) ? std::ios::in : (std::ios::openmode)0;
    iosMode |= ((mode == Mode::Write) || (mode == Mode::ReadWrite))? std::ios::out : (std::ios::openmode)0;
    mStream.open(filename.c_str(), iosMode);
    mFilename = filename;
}





Add Discussion as Guest

Log in to DocsForge