| 1101 | return true; |
| 1102 | } |
| 1103 | virtual int Execute(const CaptureOptions &) |
| 1104 | { |
| 1105 | if(list_sections) |
| 1106 | { |
| 1107 | std::cout << "Known sections:" << std::endl; |
| 1108 | for(SectionType s : values<SectionType>()) |
| 1109 | std::cout << ToStr(s) << std::endl; |
| 1110 | return 0; |
| 1111 | } |
| 1112 | |
| 1113 | if(zstd && lz4) |
| 1114 | { |
| 1115 | std::cerr << "Can't compress with Zstandard and lz4 - ignoring lz4." << std::endl; |
| 1116 | lz4 = false; |
| 1117 | } |
| 1118 | |
| 1119 | ICaptureFile *capfile = RENDERDOC_OpenCaptureFile(); |
| 1120 | |
| 1121 | ResultDetails result = capfile->OpenFile(conv(rdc), "", NULL); |
| 1122 | |
| 1123 | if(result.code != ResultCode::Succeeded) |
| 1124 | { |
| 1125 | capfile->Shutdown(); |
| 1126 | std::cerr << "Couldn't load '" << rdc << "': " << result.Message() << std::endl; |
| 1127 | return 1; |
| 1128 | } |
| 1129 | |
| 1130 | if(m_Extract) |
| 1131 | { |
| 1132 | int idx = capfile->FindSectionByName(conv(section)); |
| 1133 | |
| 1134 | if(idx < 0) |
| 1135 | { |
| 1136 | std::cerr << "'" << rdc << "' has no section called '" << section << "'" << std::endl; |
| 1137 | std::cerr << "Available sections are:" << std::endl; |
| 1138 | |
| 1139 | int num = capfile->GetSectionCount(); |
| 1140 | |
| 1141 | for(int i = 0; i < num; i++) |
| 1142 | std::cerr << " " << capfile->GetSectionProperties(i).name.c_str() << std::endl; |
| 1143 | |
| 1144 | capfile->Shutdown(); |
| 1145 | return 1; |
| 1146 | } |
| 1147 | |
| 1148 | FILE *f = NULL; |
| 1149 | |
| 1150 | if(noclobber) |
| 1151 | { |
| 1152 | bool exists = false; |
| 1153 | f = fopen(file.c_str(), "rb"); |
| 1154 | if(f) |
| 1155 | { |
| 1156 | exists = true; |
| 1157 | fclose(f); |
| 1158 | f = NULL; |
| 1159 | } |
| 1160 |
nothing calls this directly
no test coverage detected