📄 alcc.cpp
字号:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Name: Main wxBase App////// Purpose: aMule ed2k link creator////// Author: ThePolish <thepolish@vipmail.ru>////// Copyright (C) 2004 by ThePolish////// 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.////// This program is distributed in the hope that it will be useful,/// but WITHOUT ANY WARRANTY; without even the implied warranty of/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the/// GNU General Public License for more details.////// You should have received a copy of the GNU General Public License/// along with this program; if not, write to the/// Free Software Foundation, Inc.,/// 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////#ifdef __BORLANDC__ #pragma hdrstop#endif// For all others, include the necessary headers#ifndef WX_PRECOMP #include "wx/wx.h"#endif#ifdef HAVE_CONFIG_H#include "config.h" // Needed for PACKAGE#endif#include "alcc.h"#include "ed2khash.h"// Application implementationIMPLEMENT_APP (alcc)/// Running Alccint alcc::OnRun (){ // Used to tell alcc to use aMule catalog m_locale.Init(); m_locale.AddCatalog(wxT(PACKAGE)); wxLog::DontCreateOnDemand(); delete wxLog::SetActiveTarget(new wxLogStderr); // Replace printf by Log on Stderr wxLog::SetTimestamp(NULL); // Disable timestamp on messages Ed2kHash hash; size_t i; for (i=0;i<(m_filesToHash.GetCount());++i) { if (wxFileExists(m_filesToHash[i])) { if (m_flagVerbose) { wxLogMessage(_("Processing file number %u: %s"),i+1,m_filesToHash[i].c_str()); if (m_flagPartHashes) { wxLogMessage(_("You have asked for part hashes (Only used for files > 9.5 MB)")); } } if (hash.SetED2KHashFromFile(m_filesToHash[i], NULL)) { wxLogMessage(wxT("%s"), hash.GetED2KLink(m_flagPartHashes).c_str()); } } else { if (m_flagVerbose) { wxLogMessage(_("%s ---> Non existant file !\n"),m_filesToHash[i].c_str()); } } } return 0;}// On exitintalcc::OnExit(){ delete wxLog::SetActiveTarget(NULL); return 0;}/// Parse command linevoid alcc::OnInitCmdLine(wxCmdLineParser& cmdline){ cmdline.SetDesc(cmdLineDesc);}/// Command line preocessingbool alcc::OnCmdLineParsed(wxCmdLineParser& cmdline){ wxFileName filename; size_t i; m_flagVerbose = cmdline.Found(wxT("v")); m_flagPartHashes = cmdline.Found(wxT("p")); m_filesToHash.Clear(); for (i = 0; i < cmdline.GetParamCount(); ++i) { filename.Assign(cmdline.GetParam(i)); m_filesToHash.Add(filename.GetFullPath()); } m_filesToHash.Shrink(); return true;}// File_checked_for_headers
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -