1 ////////////////////////////////////////////////////////////////////////////////
2 /// Name: Main wxBase App
4 /// Purpose: aMule ed2k link creator
6 /// Author: ThePolish <thepolish@vipmail.ru>
8 /// Copyright (c) 2004-2008 ThePolish
10 /// This program is free software; you can redistribute it and/or modify
11 /// it under the terms of the GNU General Public License as published by
12 /// the Free Software Foundation; either version 2 of the License, or
13 /// (at your option) any later version.
15 /// This program is distributed in the hope that it will be useful,
16 /// but WITHOUT ANY WARRANTY; without even the implied warranty of
17 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 /// GNU General Public License for more details.
20 /// You should have received a copy of the GNU General Public License
21 /// along with this program; if not, write to the
22 /// Free Software Foundation, Inc.,
23 /// 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24 ////////////////////////////////////////////////////////////////////////////////
34 // For all others, include the necessary headers
39 #include <wx/cmdline.h>
41 //-----------------------------------------------------------------------------
42 // This can be put in a separete include file
43 #include <wx/strconv.h>
44 static wxCSConv
aMuleConv(wxT("iso8859-1"));
46 #define unicode2char(x) (const char*) aMuleConv.cWX2MB(x)
47 #define char2unicode(x) aMuleConv.cMB2WX(x)
49 #define unicode2char(x) x.c_str()
50 #define char2unicode(x) x
52 //-----------------------------------------------------------------------------
54 /// Command line parameters
55 static const wxCmdLineEntryDesc cmdLineDesc
[] =
58 wxCMD_LINE_SWITCH
, wxT("h"), wxT("help"), wxT("show this help message"), wxCMD_LINE_VAL_NONE
, wxCMD_LINE_OPTION_HELP
60 { wxCMD_LINE_SWITCH
, wxT("v"), wxT("verbose"), wxT("be verbose"), wxCMD_LINE_VAL_NONE
, wxCMD_LINE_PARAM_OPTIONAL
},
62 { wxCMD_LINE_SWITCH
, wxT("p"), wxT("parthashes"), wxT("add part-hashes to ed2k link"), wxCMD_LINE_VAL_NONE
,wxCMD_LINE_PARAM_OPTIONAL
},
64 { wxCMD_LINE_PARAM
, NULL
, NULL
, wxT("input files"), wxCMD_LINE_VAL_STRING
, wxCMD_LINE_PARAM_MULTIPLE
},
66 { wxCMD_LINE_NONE
, NULL
, NULL
, NULL
, wxCMD_LINE_VAL_NONE
, 0 }
71 class alcc
: public wxAppConsole
75 bool m_flagPartHashes
;
76 wxArrayString m_filesToHash
;
78 /// Parse command line
79 virtual void OnInitCmdLine(wxCmdLineParser
& cmdline
);
81 /// Command line preocessing
82 virtual bool OnCmdLineParsed(wxCmdLineParser
& cmdline
);
85 wxLocale m_locale
; // Used to tell wxCas to use aMule catalog
99 // File_checked_for_headers