MCPcopy Create free account
hub / github.com/abbeycode/UnrarKit / RecVolumesRestore

Function RecVolumesRestore

Libraries/unrar/recvol.cpp:8–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6
7
8bool RecVolumesRestore(RAROptions *Cmd,const wchar *Name,bool Silent)
9{
10 Archive Arc(Cmd);
11 if (!Arc.Open(Name))
12 {
13 if (!Silent)
14 ErrHandler.OpenErrorMsg(Name);
15 return false;
16 }
17
18 RARFORMAT Fmt=RARFMT15;
19 if (Arc.IsArchive(true))
20 Fmt=Arc.Format;
21 else
22 {
23 byte Sign[REV5_SIGN_SIZE];
24 Arc.Seek(0,SEEK_SET);
25 if (Arc.Read(Sign,REV5_SIGN_SIZE)==REV5_SIGN_SIZE && memcmp(Sign,REV5_SIGN,REV5_SIGN_SIZE)==0)
26 Fmt=RARFMT50;
27 }
28 Arc.Close();
29
30 // We define RecVol as local variable for proper stack unwinding when
31 // handling exceptions. So it can close and delete files on Cancel.
32 if (Fmt==RARFMT15)
33 {
34 RecVolumes3 RecVol(Cmd,false);
35 return RecVol.Restore(Cmd,Name,Silent);
36 }
37 else
38 {
39 RecVolumes5 RecVol(Cmd,false);
40 return RecVol.Restore(Cmd,Name,Silent);
41 }
42}
43
44
45void RecVolumesTest(RAROptions *Cmd,Archive *Arc,const wchar *Name)

Callers 2

MergeArchiveFunction · 0.85
ExtractCurrentFileMethod · 0.85

Calls 7

OpenErrorMsgMethod · 0.80
IsArchiveMethod · 0.80
OpenMethod · 0.45
SeekMethod · 0.45
ReadMethod · 0.45
CloseMethod · 0.45
RestoreMethod · 0.45

Tested by

no test coverage detected