MCPcopy Create free account
hub / github.com/Scobalula/Greyhound / OpenFile

Method OpenFile

src/WraithXCOD/WraithXCOD/CascFileSystem.cpp:33–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33HANDLE CascFileSystem::OpenFile(const std::string& fileName, const std::string& mode)
34{
35 // Casc only supports reading
36 if (mode != "r")
37 {
38 LastErrorCode = 0x345300;
39 return NULL;
40 }
41
42 HANDLE result = NULL;
43
44 if (!CascOpenFile(StorageHandle, fileName.c_str(), CASC_LOCALE_NONE, CASC_OPEN_BY_NAME, &result))
45 {
46 LastErrorCode = GetCascError();
47 result = NULL;
48 }
49 else
50 {
51 LastErrorCode = 0;
52 OpenHandles.push_back(result);
53 }
54
55 return result;
56}
57
58void CascFileSystem::CloseHandle(HANDLE handle)
59{

Callers

nothing calls this directly

Calls 2

CascOpenFileFunction · 0.85
GetCascErrorFunction · 0.85

Tested by

no test coverage detected