MCPcopy Create free account
hub / github.com/ddnet/ddnet / CreateTempStorage

Function CreateTempStorage

src/engine/shared/storage.cpp:958–971  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

956}
957
958std::unique_ptr<IStorage> CreateTempStorage(const char *pDirectory, int NumArgs, const char **ppArguments)
959{
960 dbg_assert(NumArgs > 0, "Expected at least one argument");
961 std::unique_ptr<CStorage> pStorage = std::make_unique<CStorage>();
962 pStorage->FindDataDirectory(ppArguments[0]);
963 if(!pStorage->FindCurrentDirectory() ||
964 !pStorage->AddPath(pDirectory) ||
965 !pStorage->AddPath("$DATADIR") ||
966 !pStorage->AddPath("$CURRENTDIR"))
967 {
968 return std::unique_ptr<IStorage>(nullptr);
969 }
970 return pStorage;
971}

Callers 1

CreateTestStorageMethod · 0.85

Calls 3

FindDataDirectoryMethod · 0.80
FindCurrentDirectoryMethod · 0.80
AddPathMethod · 0.80

Tested by 1

CreateTestStorageMethod · 0.68