MCPcopy Create free account
hub / github.com/beefytech/Beef / Init

Method Init

IDEHelper/Backend/BeLibManger.cpp:171–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169}
170
171bool BeLibFile::Init(const StringImpl& filePath, bool moveFile)
172{
173 bool isInitialized = false;
174
175 if (FileExists(filePath))
176 {
177 String altName;
178 if (moveFile)
179 {
180 altName = filePath + "_";
181 if (!::MoveFileA(filePath.c_str(), altName.c_str()))
182 {
183 ::DeleteFileA(altName.c_str());
184 if (!::MoveFileA(filePath.c_str(), altName.c_str()))
185 {
186 mFilePath = filePath;
187 return false;
188 }
189 }
190 }
191 else
192 altName = filePath;
193 mOldFilePath = altName;
194
195 if (!mOldFileStream.Open(altName, "rb"))
196 return false;
197
198 if (!ReadLib())
199 return false;
200 }
201
202 String newLibName = filePath;
203 mFilePath = newLibName;
204
205 return true;
206}
207
208bool BeLibFile::Finish()
209{

Callers 2

FinishMethod · 0.45
AddFileMethod · 0.45

Calls 2

c_strMethod · 0.45
OpenMethod · 0.45

Tested by

no test coverage detected