MCPcopy Create free account
hub / github.com/apngasm/apngasm / outputFile

Method outputFile

cli/src/options.cpp:180–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178bool Options::has(const std::string &key) const { return !!vm.count(key); }
179
180bool Options::outputFile(std::string &out) const {
181 using std::string;
182 if (vm.count("output")) {
183 out = vm["output"].as<string>();
184 return true;
185 }
186#ifdef FIRST_FILE_IS_OUT
187 if (vm.count("files")) {
188#else
189 if (vm.count("disassemble") && vm.count("files")) {
190#endif
191 if (vm["files"].as<std::vector<string>>().size() == 1) {
192 out = vm["files"].as<std::vector<string>>()[0];
193 return true;
194 }
195 }
196 return false;
197}
198
199bool Options::disassembleFile(std::string &out) const {
200 if (!vm.count("disassemble")) {
201 return false;
202 }
203 out = vm["disassemble"].as<std::string>();
204 return true;
205}
206
207bool Options::specFile(std::string &out) const {
208 if (!vm.count("file")) {
209 return false;
210 }
211 out = vm["file"].as<std::string>();
212 return true;
213}
214
215bool Options::outputJSONFile(std::string &out) const {
216 if (!vm.count("json")) {
217 return false;
218 }
219 out = vm["json"].as<std::string>();
220 return true;
221}
222
223bool Options::outputXMLFile(std::string &out) const {
224 if (!vm.count("xml")) {
225 return false;
226 }
227 out = vm["xml"].as<std::string>();
228 return true;
229}
230
231const std::vector<std::string>::const_iterator
232Options::inputFilesBegin(void) const {
233 using std::string;
234 using std::vector;
235 if (!vm.count("files")) {
236 return inputFilesEnd();
237 }

Callers 2

assembleMethod · 0.80
disassembleMethod · 0.80

Calls 1

countMethod · 0.80

Tested by

no test coverage detected