MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / getInStream

Function getInStream

src/common/FileManager.cpp:68–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66
67
68static std::ifstream* getInStream(const std::string& path,
69 std::ios::openmode mode) {
70 if (isDirectory(path)) {
71 return NULL;
72 }
73 std::ifstream* stream = new std::ifstream(path.c_str(), mode);
74 if (stream && *stream) {
75 return stream; // ready for reading
76 }
77 delete stream;
78 return NULL;
79}
80
81
82std::istream* FileManager::createDataInStream(const std::string& filename,

Callers 1

createDataInStreamMethod · 0.85

Calls 2

isDirectoryFunction · 0.85
c_strMethod · 0.80

Tested by

no test coverage detected