Permalink
Browse files

reformatting files and adding copiright notice where missing

  • Loading branch information...
Adrian Michel
Adrian Michel committed Sep 9, 2017
1 parent 23f6ea0 commit 648e7ebd22c90fd1fa60be5744334e5bce2ee157
Showing with 697 additions and 796 deletions.
  1. +0 −3 include/misc.h
  2. +1 −5 misc/misc.cpp
  3. +9 −11 miscwin/miscwinapp.h
  4. +16 −6 miscwin/stdafx.cpp
  5. +55 −62 plugin/PluginExplorer.cpp
  6. +17 −24 plugin/hinstance.cpp
  7. +1 −1 plugin/plugin.cpp
  8. +76 −97 plugin/plugin.h
  9. +514 −579 plugin/plugintree.h
  10. +8 −8 plugin/stdafx.h
View
@@ -341,8 +341,6 @@ class StrVector : public StrVectorBase {
typedef std::set<std::wstring> StrSet;
/**
* Generic Info that all plug-ins and plug-in configurations, as well as other
* classes must have.
@@ -554,7 +552,6 @@ inline void printDashedLine(const TCHAR* str) {
printDashedLine(std::wstring(str));
}
#pragma warning(default : 4800)
/**
* Diagnostic class - counts instances of a class as they are created and
View
@@ -15,14 +15,10 @@ You should have received a copy of the GNU General Public License
along with this program.If not, see <http://www.gnu.org/licenses/>.
*/
#include <misc.h>
#include "stdafx.h"
#include <datetime.h>
// misc.cpp : Defines the entry point for the DLL application.
//
#include <misc.h>
#include <versionno.h>
#include "stdafx.h"
#pragma comment(lib, "rpcrt4")
#include <math.h>
#include <clocale>
View
@@ -18,25 +18,23 @@ along with this program.If not, see <http://www.gnu.org/licenses/>.
#pragma once
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#error include 'stdafx.h' before including this file for PCH
#endif
//#include "resource.h" // main symbols
// Cfile_dsApp
// See file_ds.cpp for the implementation of this class
//
class CMiscWinApp : public CWinApp
{
public:
CMiscWinApp();
class CMiscWinApp : public CWinApp {
public:
CMiscWinApp();
// Overrides
public:
virtual BOOL InitInstance();
virtual int CMiscWinApp::ExitInstance();
// Overrides
public:
virtual BOOL InitInstance();
virtual int CMiscWinApp::ExitInstance();
DECLARE_MESSAGE_MAP()
DECLARE_MESSAGE_MAP()
};
View
@@ -1,8 +1,18 @@
// stdafx.cpp : source file that includes just the standard includes
// miscwin.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
/*
Copyright (C) 2017 YLoader.com
#include "stdafx.h"
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 3 of the License, or
(at your option) any later version.
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
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, see <http://www.gnu.org/licenses/>.
*/
#include "stdafx.h"
View
@@ -18,82 +18,75 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
#include <plugin.h>
void yloader::PluginExplorer::initIgnoreModulesSet( std::set< std::wstring >& ignoreModulesSet )
{
ignoreModulesSet.insert( yloader::to_lower_case( _T( "misc.dll" ) ) );
ignoreModulesSet.insert( yloader::to_lower_case( _T( "miscwin.dll" ) ) );
void yloader::PluginExplorer::initIgnoreModulesSet(
std::set<std::wstring>& ignoreModulesSet) {
ignoreModulesSet.insert(yloader::to_lower_case(_T( "misc.dll" )));
ignoreModulesSet.insert(yloader::to_lower_case(_T( "miscwin.dll" )));
}
bool yloader::PluginExplorer::ignoreModule( const std::wstring& _fileName )
{
static std::set< std::wstring > ignoreModules;
bool yloader::PluginExplorer::ignoreModule(const std::wstring& _fileName) {
static std::set<std::wstring> ignoreModules;
initIgnoreModulesSet( ignoreModules );
initIgnoreModulesSet(ignoreModules);
const std::wstring fileName( yloader::to_lower_case( _fileName ) );
const std::wstring fileName(yloader::to_lower_case(_fileName));
return ignoreModules.find( fileName ) != ignoreModules.end();
return ignoreModules.find(fileName) != ignoreModules.end();
}
void yloader::PluginExplorer::explore( const std::wstring& p, const std::wstring& ext, bool recursive, PluginLoadingStatusHandler* loadingStatusHandler, std::vector< InfoPtr >& duplicates )
{
void yloader::PluginExplorer::explore(
const std::wstring& p, const std::wstring& ext, bool recursive,
PluginLoadingStatusHandler* loadingStatusHandler,
std::vector<InfoPtr>& duplicates) {
std::wstring path = p.length() == 0 ? _T( "." ) : p;
{
std::wstring fileName( yloader::addBackSlash( path ) + _T( "*.*" ) );
std::wstring fileName(yloader::addBackSlash(path) + _T( "*.*" ));
CFileFind finder;
CFileFind finder;
BOOL bWorking = finder.FindFile( fileName.c_str() );
while (bWorking)
{
bWorking = finder.FindNextFile();
BOOL bWorking = finder.FindFile(fileName.c_str());
while (bWorking) {
bWorking = finder.FindNextFile();
// skip . and .. files; otherwise, we'd
// recur infinitely!
if (finder.IsDots())
continue;
// skip . and .. files; otherwise, we'd
// recur infinitely!
if (finder.IsDots()) continue;
// if it's a directory, recursively search it
if (finder.IsDirectory() && recursive )
explore( std::wstring( finder.GetFilePath() ), ext, recursive, loadingStatusHandler, duplicates );
}
finder.Close();
// if it's a directory, recursively search it
if (finder.IsDirectory() && recursive)
explore(std::wstring(finder.GetFilePath()), ext, recursive,
loadingStatusHandler, duplicates);
}
finder.Close();
}
{
std::wstring fileName( yloader::addBackSlash( path ) );
if ( ext.length() == 0 )
fileName += _T( "*.*" );
else if ( fileName.at( 0 ) == _TCHAR( '.' ) )
fileName += std::wstring( _T( "*" ) ) + ext;
else
fileName += std::wstring( _T( "*." ) ) + ext;
CFileFind finder;
BOOL bWorking = finder.FindFile( fileName.c_str() );
while (bWorking)
{
bWorking = finder.FindNextFile();
// skip . and .. files; otherwise, we'd
// recur infinitely!
if (finder.IsDots())
continue;
if (finder.IsDirectory() || ignoreModule( (LPCTSTR)( finder.GetFileName() ) ) )
continue;
else
{
std::wstring filePath( finder.GetFilePath() );
process( filePath, loadingStatusHandler, duplicates );
}
}
finder.Close();
std::wstring fileName(yloader::addBackSlash(path));
if (ext.length() == 0)
fileName += _T( "*.*" );
else if (fileName.at(0) == _TCHAR('.'))
fileName += std::wstring(_T( "*" )) + ext;
else
fileName += std::wstring(_T( "*." )) + ext;
CFileFind finder;
BOOL bWorking = finder.FindFile(fileName.c_str());
while (bWorking) {
bWorking = finder.FindNextFile();
// skip . and .. files; otherwise, we'd
// recur infinitely!
if (finder.IsDots()) continue;
if (finder.IsDirectory() || ignoreModule((LPCTSTR)(finder.GetFileName())))
continue;
else {
std::wstring filePath(finder.GetFilePath());
process(filePath, loadingStatusHandler, duplicates);
}
}
finder.Close();
}
}
View
@@ -18,35 +18,28 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
#include <hinstance.h>
HInstance::HInstance( const std::wstring& fileName ) throw( HInstanceException )
: _hInstance( init( fileName ) ), _path( fileName )
{
if ( !_hInstance )
{
throw HInstanceException();
HInstance::HInstance(const std::wstring& fileName) throw(HInstanceException)
: _hInstance(init(fileName)), _path(fileName) {
if (!_hInstance) {
throw HInstanceException();
}
}
HInstance::~HInstance()
{
if( _hInstance != 0 )
AfxFreeLibrary( _hInstance );
HInstance::~HInstance() {
if (_hInstance != 0) AfxFreeLibrary(_hInstance);
}
HINSTANCE HInstance::init( const std::wstring& path )
{
return AfxLoadLibrary( path.c_str() );
HINSTANCE HInstance::init(const std::wstring& path) {
return AfxLoadLibrary(path.c_str());
}
FARPROC HInstance::getProcAddress( const std::wstring& procName ) const throw( HInstanceMethodException )
{
assert( _hInstance != 0 );
FARPROC proc = GetProcAddress( _hInstance, yloader::ws2s( procName).c_str() );
if( proc != 0 )
return proc;
else
throw HInstanceMethodException( procName );
}
FARPROC HInstance::getProcAddress(const std::wstring& procName) const
throw(HInstanceMethodException) {
assert(_hInstance != 0);
FARPROC proc = GetProcAddress(_hInstance, yloader::ws2s(procName).c_str());
if (proc != 0)
return proc;
else
throw HInstanceMethodException(procName);
}
View
@@ -16,4 +16,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "stdafx.h"
#include "plugin.h"
#include "plugin.h"
Oops, something went wrong.

0 comments on commit 648e7eb

Please sign in to comment.