From 236f03c0b9a4982328ed1201978f7f69d192d9b2 Mon Sep 17 00:00:00 2001 From: Anton Novoselov Date: Tue, 1 Aug 2017 12:53:38 +0300 Subject: Blast 1.1 release (windows / linux) see docs/release_notes.txt for details --- tools/DataConverter/src/Main.cpp | 88 ---------------------------------------- 1 file changed, 88 deletions(-) delete mode 100644 tools/DataConverter/src/Main.cpp (limited to 'tools/DataConverter/src/Main.cpp') diff --git a/tools/DataConverter/src/Main.cpp b/tools/DataConverter/src/Main.cpp deleted file mode 100644 index fb9be66..0000000 --- a/tools/DataConverter/src/Main.cpp +++ /dev/null @@ -1,88 +0,0 @@ -#include "NvBlastExtDataConverter.h" -#include -#include -#include "tclap/CmdLine.h" -#include -#include -#include -#include - -#define IDE_DEBUG_MODE 0 - -int customMain(std::vector& args) -{ - try - { - // setup cmd line - TCLAP::CmdLine cmd("Blast SDK: Data Converter", ' ', "0.1"); - - TCLAP::ValueArg outversionArg("v", "outversion", "Output binary block version. Pass -1 or ignore this parameter to convert to latest version.", false, -1, "outversion"); - cmd.add(outversionArg); - TCLAP::ValueArg outfileArg("o", "outfile", "Output binary file.", true, "", "outfile"); - cmd.add(outfileArg); - TCLAP::ValueArg infileArg("i", "infile", "Input binary file.", true, "", "infile"); - cmd.add(infileArg); - - // parse cmd input - cmd.parse(args); - - // get cmd parse results - std::string infile = infileArg.getValue(); - std::string outfile = outfileArg.getValue(); - int32_t outBlockVersion = outversionArg.getValue(); - - // read input file - std::ifstream infileStream(infile.c_str(), std::ios::binary); - if (!infileStream.is_open()) - { - std::cerr << "FAIL: Can't open input file: " << infile << std::endl; - return 0; - } - std::vector inBlock((std::istreambuf_iterator(infileStream)), std::istreambuf_iterator()); - infileStream.close(); - - // convert - std::vector outBlock; - if (Nv::Blast::convertDataBlock(outBlock, inBlock, outBlockVersion >= 0 ? (uint32_t*)&outBlockVersion : nullptr)) - { - std::ofstream outfileStream(outfile, std::ios::binary | std::ios::out); - if (!outfileStream.is_open()) - { - std::cerr << "FAIL: Can't open output file: " << outfile << std::endl; - return 0; - } - outfileStream.write((char*)&outBlock[0], outBlock.size()); - outfileStream.close(); - - std::cout << "Conversion success, result written in file: " << outfile << std::endl; - } - else - { - std::cout << "Conversion failed." << std::endl; - } - } - catch (TCLAP::ArgException &e) // catch any exceptions - { - std::cout << "error: " << e.error() << " for arg " << e.argId() << std::endl; - } - - return 0; -} - -int main(int argc, const char* const* argv) -{ - std::vector args; -#if IDE_DEBUG_MODE - NV_UNUSED(argc); - NV_UNUSED(argv); - - args.push_back(""); - args.push_back("-i wall.blast"); - args.push_back("-o wall_new.blast"); - args.push_back("-v 5"); -#else - for (int i = 0; i < argc; i++) - args.push_back(argv[i]); -#endif - return customMain(args); -} -- cgit v1.2.3