| 166 | |
| 167 | |
| 168 | bool NitfWrap::parseArgs(std::vector<std::string>& argList) |
| 169 | { |
| 170 | ProgramArgs args; |
| 171 | |
| 172 | args.add("input,i", "Input filename", m_inputFile).setPositional(); |
| 173 | args.add("output,o", "Output filename", |
| 174 | m_outputFile).setOptionalPositional(); |
| 175 | args.add("unwrap,u", "Unwrap NITF file", m_unwrap); |
| 176 | try |
| 177 | { |
| 178 | m_nitfWriter.addArgs(args); |
| 179 | } |
| 180 | catch (arg_error& e) |
| 181 | { |
| 182 | throw error(e.m_error); |
| 183 | } |
| 184 | |
| 185 | try |
| 186 | { |
| 187 | args.parse(argList); |
| 188 | } |
| 189 | catch (arg_error& e) |
| 190 | { |
| 191 | std::cerr << "nitfwrap: " << e.m_error << std::endl; |
| 192 | outputHelp(args); |
| 193 | return false; |
| 194 | } |
| 195 | |
| 196 | if (!FileUtils::fileExists(m_inputFile)) |
| 197 | { |
| 198 | std::ostringstream oss; |
| 199 | |
| 200 | oss << "Input file '" << m_inputFile << "' doesn't exist."; |
| 201 | throw error(oss.str()); |
| 202 | } |
| 203 | if (m_outputFile.empty()) |
| 204 | if (!m_unwrap) |
| 205 | m_outputFile = FileUtils::stem(m_inputFile) + ".ntf"; |
| 206 | return true; |
| 207 | } |
| 208 | |
| 209 | |
| 210 | void NitfWrap::verify(BOX3D& bounds) |
nothing calls this directly
no test coverage detected