/*************************************************************************** TmDmCreator Create SQL code for ToolMap project ------------------- copyright : (C) 2013 CREALP Lucien Schreiber email : lucien.schreiber at crealp dot vs dot ch ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include #include #include #include static const wxCmdLineEntryDesc cmdLineDesc[] = { { wxCMD_LINE_SWITCH, "h", "help", "show this help message", wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP }, { wxCMD_LINE_SWITCH, "v", "verbose", "Be more verbose" }, { wxCMD_LINE_PARAM, NULL, NULL, "[structure sql file]"}, { wxCMD_LINE_PARAM, NULL, NULL, "[content txt file]"}, { wxCMD_LINE_PARAM, NULL, NULL, "[result sql file]"}, { wxCMD_LINE_NONE } }; void PrintArray(const wxArrayString & array, const wxString & msg){ wxPrintf(msg + _T("\n")); for (unsigned int i = 0; i< array.GetCount(); i++) { wxPrintf(array[i] + _T("\n")); } } int main(int argc, char **argv){ // debugging string for OSX // this is needed for viewing string content with Xcode !! wxString myTest = _T("Test debugging"); myTest.ToUTF8().data(); myTest.Len(); wxApp::CheckBuildOptions(WX_BUILD_OPTIONS_SIGNATURE, "program"); wxInitializer initializer; if ( !initializer ){ fprintf(stderr, "Failed to initialize the wxWidgets library, aborting."); return -1; } wxString myLogoTxt = _T("*\n* TmDmCreator \n* Create SQL file for ToolMap projects \n* (c) Copyright 2013 Lucien Schreiber - CREALP . All Rights Reserved. \n*\n"); wxCmdLineParser parser(cmdLineDesc, argc, argv); parser.SetLogo(myLogoTxt); if (parser.Parse() != 0) { return 0; } // cmd line is correct !! wxPrintf(myLogoTxt); return 0; }