MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / open

Method open

Source/3rdParty/bx/src/file.cpp:181–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179 }
180
181 virtual bool open(const FilePath& _filePath, bool _append, Error* _err) override
182 {
183 BX_ASSERT(NULL != _err, "Reader/Writer interface calling functions must handle errors.");
184
185 if (NULL != m_file)
186 {
187 BX_ERROR_SET(_err, kErrorReaderWriterAlreadyOpen, "FileReader: File is already open.");
188 return false;
189 }
190
191 m_file = fopen(_filePath.getCPtr(), _append ? "ab" : "wb");
192
193 if (NULL == m_file)
194 {
195 BX_ERROR_SET(_err, kErrorReaderWriterOpen, "FileWriter: Failed to open file.");
196 return false;
197 }
198
199 m_open = true;
200 return true;
201 }
202
203 virtual void close() override
204 {

Callers

nothing calls this directly

Calls 3

fopenFunction · 0.85
openFunction · 0.85
getCPtrMethod · 0.80

Tested by

no test coverage detected