MCPcopy Create free account
hub / github.com/assimp/assimp / Open

Method Open

code/Common/DefaultIOSystem.cpp:121–142  ·  view source on GitHub ↗

------------------------------------------------------------------------------------------------ Open a new file with a given path.

Source from the content-addressed store, hash-verified

119// ------------------------------------------------------------------------------------------------
120// Open a new file with a given path.
121IOStream *DefaultIOSystem::Open(const char *strFile, const char *strMode) {
122 ai_assert(strFile != nullptr);
123 ai_assert(strMode != nullptr);
124 FILE *file;
125
126#ifdef _WIN32
127 std::wstring name = Utf8ToWide(strFile);
128 if (name.empty()) {
129 return nullptr;
130 }
131
132 file = ::_wfopen(name.c_str(), Utf8ToWide(strMode).c_str());
133#else
134 file = ::fopen(strFile, strMode);
135#endif
136
137 if (!file) {
138 return nullptr;
139 }
140
141 return new DefaultIOStream(file, strFile);
142}
143
144// ------------------------------------------------------------------------------------------------
145// Closes the given file and releases all resources associated with it.

Callers 15

InternReadFileMethod · 0.45
readDataMethod · 0.45
ParseFileMethod · 0.45
InternReadFileMethod · 0.45
X3DExporterMethod · 0.45
InternReadFileMethod · 0.45
ExportBinaryMethod · 0.45
ExportAsciiMethod · 0.45
InternReadFileMethod · 0.45
InternReadFileMethod · 0.45
InternReadFileMethod · 0.45

Calls 2

Utf8ToWideFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected