MCPcopy Create free account
hub / github.com/ModOrganizer2/modorganizer / createFile

Method createFile

src/shared/fileregister.cpp:28–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28FileEntryPtr FileRegister::createFile(std::wstring name, DirectoryEntry* parent,
29 DirectoryStats& stats)
30{
31 const auto index = generateIndex();
32 auto p = FileEntryPtr(new FileEntry(index, std::move(name), parent));
33
34 {
35 std::scoped_lock lock(m_Mutex);
36
37 if (index >= m_Files.size()) {
38 m_Files.resize(index + 1);
39 }
40
41 m_Files[index] = p;
42 }
43
44 return p;
45}
46
47FileIndex FileRegister::generateIndex()
48{

Callers 1

insertMethod · 0.45

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected