MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / DeleteDirectoryStructure

Function DeleteDirectoryStructure

engine/Poseidon/UI/DisplayUI.cpp:78–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76RString GetNetworkPassword();
77
78RString GetIdentityText(const PlayerIdentity& identity);
79
80void CopyDirectoryStructure(const char* dst, const char* src)
81{
82 char buffer[256];
83 snprintf(buffer, sizeof(buffer), "%s\\*.*", src);
84
85 _finddata_t info;
86 intptr_t h = _findfirst(buffer, &info);
87 if (h != -1)
88 {
89 do
90 {
91 if ((info.attrib & _A_SUBDIR) != 0)
92 {
93 // FIX - do not delete only current and parent directory
94 if (strcmp(info.name, ".") != 0 && strcmp(info.name, "..") != 0)
95 {
96 char srcNew[256];
97 char dstNew[256];
98 snprintf(srcNew, sizeof(srcNew), "%s\\%s", src, info.name);
99 snprintf(dstNew, sizeof(dstNew), "%s\\%s", dst, info.name);
100 CreateDirectory(dstNew, nullptr);
101 CopyDirectoryStructure(dstNew, srcNew);
102 }
103 }
104 else
105 {
106 char srcNew[256];
107 char dstNew[256];
108 snprintf(srcNew, sizeof(srcNew), "%s\\%s", src, info.name);
109 snprintf(dstNew, sizeof(dstNew), "%s\\%s", dst, info.name);
110 ::CopyFile(srcNew, dstNew, FALSE);
111 }
112 } while (_findnext(h, &info) == 0);
113 _findclose(h);
114 }
115}
116void RunInitScript()
117{
118 RString initScript = GetMissionDirectory() + RString("init.sqs");
119 if (QIFStreamB::FileExist(initScript))
120 {

Callers 6

NetworkServerMethod · 0.85
DoneMethod · 0.85
NetworkClientMethod · 0.85
~NetworkClientMethod · 0.85
CreateMissionMethod · 0.85
OnChildDestroyedMethod · 0.85

Calls 3

_findfirstFunction · 0.85
_findnextFunction · 0.85
_findcloseFunction · 0.85

Tested by

no test coverage detected