Fixed up the filemon a bit, added isEnable function to the logmanager

and moved the FileMonitor from debug to discio to prevert cross 
dependencies


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4197 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
nakeee 2009-09-04 11:34:21 +00:00
parent 7badedf054
commit e147b9eb91
11 changed files with 20 additions and 25 deletions

View File

@ -133,13 +133,13 @@ private:
class LogManager class LogManager
{ {
private: private:
LogContainer* m_Log[LogTypes::NUMBER_OF_LOGS];
Common::CriticalSection logMutex; Common::CriticalSection logMutex;
FileLogListener *m_fileLog; FileLogListener *m_fileLog;
ConsoleListener *m_consoleLog; ConsoleListener *m_consoleLog;
static LogManager *m_logManager; // Singleton. Ugh. static LogManager *m_logManager; // Singleton. Ugh.
public: public:
LogContainer* m_Log[LogTypes::NUMBER_OF_LOGS];
static u32 GetMaxLevel() { return MAX_LOGLEVEL; } static u32 GetMaxLevel() { return MAX_LOGLEVEL; }
void Log(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, void Log(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type,
@ -153,6 +153,10 @@ public:
m_Log[type]->setEnable(enable); m_Log[type]->setEnable(enable);
} }
bool isEnable(LogTypes::LOG_TYPE type) {
return m_Log[type]->isEnable();
}
const char *getShortName(LogTypes::LOG_TYPE type) const { const char *getShortName(LogTypes::LOG_TYPE type) const {
return m_Log[type]->getShortName(); return m_Log[type]->getShortName();
} }

View File

@ -372,12 +372,6 @@ bool SplitPath(const std::string& full_path, std::string* _pPath, std::string* _
} }
#endif #endif
std::string PathToFilename(std::string Path)
{
std::string Name, Ending;
SplitPath(Path, 0, &Name, &Ending);
return Name + Ending;
}
void BuildCompleteFilename(std::string& _CompleteFilename, const std::string& _Path, const std::string& _Filename) void BuildCompleteFilename(std::string& _CompleteFilename, const std::string& _Path, const std::string& _Filename)
{ {

View File

@ -74,8 +74,6 @@ int ChooseStringFrom(const char* str, const char* * items);
// "C:\Windows\winhelp.exe" to "C:\Windows\", "winhelp", "exe" // "C:\Windows\winhelp.exe" to "C:\Windows\", "winhelp", "exe"
bool SplitPath(const std::string& full_path, std::string* _pPath, std::string* _pFilename, std::string* _pExtension); bool SplitPath(const std::string& full_path, std::string* _pPath, std::string* _pFilename, std::string* _pExtension);
// "C:\Windows\winhelp.exe" to "winhelp.exe"
std::string PathToFilename(std::string Path);
void BuildCompleteFilename(std::string& _CompleteFilename, const std::string& _Path, const std::string& _Filename); void BuildCompleteFilename(std::string& _CompleteFilename, const std::string& _Path, const std::string& _Filename);
void NormalizeDirSep(std::string* str); void NormalizeDirSep(std::string* str);

View File

@ -27,7 +27,7 @@
#include "VolumeCreator.h" #include "VolumeCreator.h"
#include "Filesystem.h" #include "Filesystem.h"
#include "../../../Core/DebuggerWX/Src/FileMonitor.h" #include "../../DiscIO/Src/FileMonitor.h"
using namespace DVDInterface; using namespace DVDInterface;

View File

@ -787,14 +787,6 @@
RelativePath=".\src\Debugger.h" RelativePath=".\src\Debugger.h"
> >
</File> </File>
<File
RelativePath=".\Src\FileMonitor.cpp"
>
</File>
<File
RelativePath=".\Src\FileMonitor.h"
>
</File>
<File <File
RelativePath=".\src\JitWindow.cpp" RelativePath=".\src\JitWindow.cpp"
> >

View File

@ -11,7 +11,6 @@ files = [
"BreakpointWindow.cpp", "BreakpointWindow.cpp",
"CodeWindow.cpp", "CodeWindow.cpp",
"CodeWindowFunctions.cpp", "CodeWindowFunctions.cpp",
"FileMonitor.cpp",
"MemoryCheckDlg.cpp", "MemoryCheckDlg.cpp",
"MemoryWindow.cpp", "MemoryWindow.cpp",
"RegisterWindow.cpp", "RegisterWindow.cpp",
@ -30,7 +29,7 @@ wxenv.Append(
) )
libs = [ libs = [
'common', 'common',
'debugger_ui_util' 'debugger_ui_util'
] ]
wxenv.StaticLibrary(env['local_libs'] + "debwx", files, LIBS = libs) wxenv.StaticLibrary(env['local_libs'] + "debwx", files, LIBS = libs)

View File

@ -648,6 +648,15 @@
RelativePath=".\Src\VolumeDirectory.cpp" RelativePath=".\Src\VolumeDirectory.cpp"
> >
</File> </File>
<File
RelativePath=".\Src\FileMonitor.cpp"
>
</File>
<File
RelativePath=".\Src\FileMonitor.h"
>
</File>
<File <File
RelativePath=".\Src\VolumeDirectory.h" RelativePath=".\Src\VolumeDirectory.h"
> >

View File

@ -28,7 +28,6 @@
#include "IniFile.h" #include "IniFile.h"
#include "LogManager.h" #include "LogManager.h"
#include "PowerPC/PowerPc.h" // Core
#include "ConfigManager.h" #include "ConfigManager.h"
#include "../../DiscIO/Src/FileSystemGCWii.h" #include "../../DiscIO/Src/FileSystemGCWii.h"
#include "../../DiscIO/Src/VolumeCreator.h" #include "../../DiscIO/Src/VolumeCreator.h"
@ -97,7 +96,7 @@ void ReadGC(std::string FileName)
void CheckFile(std::string File, int Size) void CheckFile(std::string File, int Size)
{ {
// Don't do anything if the log is unselected // Don't do anything if the log is unselected
if (!LogManager::GetInstance()->m_Log[LogTypes::FILEMON]->isEnable()) return; if (!LogManager::GetInstance()->isEnable(LogTypes::FILEMON)) return;
// Do nothing if we found the same file again // Do nothing if we found the same file again
if (CurrentFile == File) return; if (CurrentFile == File) return;
@ -124,8 +123,7 @@ void CheckFile(std::string File, int Size)
void FindFilename(u64 offset) void FindFilename(u64 offset)
{ {
// Don't do anything if the log is unselected // Don't do anything if the log is unselected
if (!LogManager::GetInstance()->m_Log[LogTypes::FILEMON]->isEnable()) return; if (!LogManager::GetInstance()->isEnable(LogTypes::FILEMON)) return;
if (PowerPC::GetState() != PowerPC::CPUState::CPU_RUNNING) return;
if (!FileAccess) return; if (!FileAccess) return;
if (!pFileSystem || ISOFile != SConfig::GetInstance().m_LastFilename) if (!pFileSystem || ISOFile != SConfig::GetInstance().m_LastFilename)

View File

@ -20,6 +20,7 @@ files = [
'VolumeGC.cpp', 'VolumeGC.cpp',
'VolumeWad.cpp', 'VolumeWad.cpp',
'VolumeWiiCrypted.cpp', 'VolumeWiiCrypted.cpp',
'FileMonitor.cpp',
'NANDContentLoader.cpp', 'NANDContentLoader.cpp',
'WiiWad.cpp', 'WiiWad.cpp',
'AES/aes_cbc.c', 'AES/aes_cbc.c',

View File

@ -19,7 +19,7 @@
#include "VolumeGC.h" #include "VolumeGC.h"
#include "StringUtil.h" #include "StringUtil.h"
#include "../../../Core/DebuggerWX/Src/FileMonitor.h" #include "FileMonitor.h"
namespace DiscIO namespace DiscIO
{ {