17#include <unordered_map>
22#pragma warning( push )
23#pragma warning( disable : PROTOBUF_WARNINGS )
25#include <google/protobuf/text_format.h>
35#include "PipelineTool.h"
37int main (
int argc,
char *argv[] )
39 GOOGLE_PROTOBUF_VERIFY_VERSION;
40 std::unordered_map<std::string, std::function<std::unique_ptr<AeonGames::Tool>() > > ToolFactories
42 {
"convert", [] {
return std::make_unique<AeonGames::Convert>(); } },
43 {
"pack", [] {
return std::make_unique<AeonGames::Pack>(); } },
44 {
"base64", [] {
return std::make_unique<AeonGames::Base64>(); } },
45 {
"pipeline", [] {
return std::make_unique<AeonGames::PipelineTool>(); } },
48 _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
51 _CrtSetReportMode ( _CRT_WARN, _CRTDBG_MODE_FILE );
52 _CrtSetReportFile ( _CRT_WARN, _CRTDBG_FILE_STDOUT );
53 _CrtSetReportMode ( _CRT_ERROR, _CRTDBG_MODE_FILE );
54 _CrtSetReportFile ( _CRT_ERROR, _CRTDBG_FILE_STDOUT );
55 _CrtSetReportMode ( _CRT_ASSERT, _CRTDBG_MODE_FILE );
56 _CrtSetReportFile ( _CRT_ASSERT, _CRTDBG_FILE_STDOUT );
63 if ( argc >= 2 && ToolFactories.find ( argv[1] ) != ToolFactories.end() )
65 retval = ToolFactories[argv[1]]()->
operator() ( argc, argv );
69 std::cout <<
"Usage: " << argv[0] <<
" <tool> [-help | ...]" << std::endl;
73 catch (
const std::runtime_error &e )
75 std::cout << e.what() << std::endl;
79 std::cout <<
"Error: Unknown Exception caught." << std::endl;
81#if defined(__linux__) && GOOGLE_PROTOBUF_VERSION > 3006001
83 google::protobuf::ShutdownProtobufLibrary();