1
0
mirror of https://github.com/alliedmodders/metamod-source.git synced 2025-02-17 10:54:14 +01:00

Changed to namespaces

--HG--
extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%4099
This commit is contained in:
David Anderson 2005-08-12 17:44:53 +00:00
parent 05f9912d4e
commit ac1ea74510
11 changed files with 34 additions and 33 deletions

View File

@ -11,6 +11,8 @@
#ifndef _INCLUDE_SMM_LIST_H
#define _INCLUDE_SMM_LIST_H
namespace SourceHook
{
//This class is from CSDM_amxx by BAILOPAN
//
template <class T>
@ -240,5 +242,6 @@ public:
return *this;
}
};
}; //NAMESPACE
#endif //_INCLUDE_CSDM_LIST_H

View File

@ -20,6 +20,9 @@
#include <string.h>
#include <stdio.h>
namespace SourceHook
{
class String
{
public:
@ -361,4 +364,6 @@ public:
static const int npos = -1;
};
}; //NAMESPACE
#endif //_INCLUDE_CSTRING_H

View File

@ -68,7 +68,7 @@
#include "FastDelegate.h"
#include "sh_memfuncinfo.h"
#include "sh_memory.h"
#include "smm_list.h"
#include "sh_list.h"
#include <vector>
#include <map>

View File

@ -6,7 +6,6 @@
#include <string>
#include <list>
#include "sourcehook_impl.h"
#include "smm_list.h"
using namespace std;

View File

@ -389,7 +389,7 @@ bool CPluginManager::UnloadAll()
{
PluginIter i;
List<SourceMM::CPluginManager::CPlugin *> remqueue;
SourceHook::List<SourceMM::CPluginManager::CPlugin *> remqueue;
for (i=m_Plugins.begin(); i!=m_Plugins.end(); i++)
remqueue.push_back( (*i) );
@ -476,7 +476,7 @@ void CPluginManager::RemovePluginCmd(ISmmPlugin *api, ConCommandBase *pCmd)
void CPluginManager::UnregAllConCmds(CPlugin *pl)
{
List<ConCommandBase *>::iterator i;
SourceHook::List<ConCommandBase *>::iterator i;
for (i=pl->m_Cvars.begin(); i!=pl->m_Cvars.end(); i++)
g_SMConVarAccessor.Unregister( (*i) );

View File

@ -21,8 +21,8 @@
#include <convar.h>
#include "IPluginManager.h"
#include "oslink.h"
#include "smm_list.h"
#include "smm_string.h"
#include "sh_list.h"
#include "sh_string.h"
/**
* History of plugin versions: (M=min, C=current)
@ -54,14 +54,14 @@ namespace SourceMM
CPlugin();
public:
PluginId m_Id;
String m_File;
SourceHook::String m_File;
Pl_Status m_Status;
PluginId m_Source;
ISmmPlugin *m_API;
HINSTANCE m_Lib;
factories fac_list;
List<ConCommandBase *> m_Cvars;
List<ConCommandBase *> m_Cmds;
SourceHook::List<ConCommandBase *> m_Cvars;
SourceHook::List<ConCommandBase *> m_Cmds;
};
public:
CPluginManager();
@ -102,8 +102,8 @@ namespace SourceMM
bool Retry(PluginId id, char *error, size_t len);
//Internal iterators
List<SourceMM::CPluginManager::CPlugin *>::iterator _begin();
List<SourceMM::CPluginManager::CPlugin *>::iterator _end();
SourceHook::List<SourceMM::CPluginManager::CPlugin *>::iterator _begin();
SourceHook::List<SourceMM::CPluginManager::CPlugin *>::iterator _end();
private:
//These are identical internal functions for the wrappers above.
CPlugin *_Load(const char *file, PluginId source, char *error, size_t maxlen);
@ -113,12 +113,12 @@ namespace SourceMM
void UnregAllConCmds(CPlugin *pl);
private:
PluginId m_LastId;
List<CPlugin *> m_Plugins;
SourceHook::List<CPlugin *> m_Plugins;
bool m_AllLoaded;
};
};
typedef List<SourceMM::CPluginManager::CPlugin *>::iterator PluginIter;
typedef SourceHook::List<SourceMM::CPluginManager::CPlugin *>::iterator PluginIter;
/** @brief Singleton for plugin manager */
extern SourceMM::CPluginManager g_PluginMngr;

View File

@ -12,8 +12,8 @@
#include "CSmmAPI.h"
#include "concommands.h"
#include "CPlugin.h"
#include "smm_string.h"
#include "smm_list.h"
#include "sh_string.h"
#include "sh_list.h"
/**
* @brief Console Command Implementations
@ -50,7 +50,7 @@ bool SMConVarAccessor::Register(ConCommandBase *pCommand)
void SMConVarAccessor::MarkCommandsAsGameDLL()
{
for (List<ConCommandBase*>::iterator iter = m_RegisteredCommands.begin();
for (SourceHook::List<ConCommandBase*>::iterator iter = m_RegisteredCommands.begin();
iter != m_RegisteredCommands.end(); ++iter)
{
(*iter)->AddFlags(FCVAR_GAMEDLL);
@ -203,7 +203,7 @@ CON_COMMAND(meta, "Metamod:Source Menu")
CONMSG("Plugin %d is not loaded.\n", id);
} else {
CONMSG("Console commands for %s:\n", pl->m_API->GetName());
List<ConCommandBase *>::iterator ci;
SourceHook::List<ConCommandBase *>::iterator ci;
size_t count = 0;
for (ci=pl->m_Cmds.begin(); ci!=pl->m_Cmds.end(); ci++)
@ -234,7 +234,7 @@ CON_COMMAND(meta, "Metamod:Source Menu")
CONMSG("Plugin %d is not loaded.\n", id);
} else {
CONMSG("Registered cvars for %s:\n", pl->m_API->GetName());
List<ConCommandBase *>::iterator ci;
SourceHook::List<ConCommandBase *>::iterator ci;
size_t count = 0;
for (ci=pl->m_Cvars.begin(); ci!=pl->m_Cvars.end(); ci++)

View File

@ -20,11 +20,11 @@
#include <eiface.h>
#include "sourcemm.h"
#include <convar.h>
#include "smm_list.h"
#include "sh_list.h"
class SMConVarAccessor : public IConCommandBaseAccessor
{
List<ConCommandBase*> m_RegisteredCommands;
SourceHook::List<ConCommandBase*> m_RegisteredCommands;
public:
virtual bool RegisterConCommandBase(ConCommandBase *pCommand);
bool Register(ConCommandBase *pCommand);

View File

@ -34,8 +34,8 @@ GameDllInfo g_GameDll = {false, NULL, NULL};
EngineInfo g_Engine = {NULL, NULL, NULL, NULL};
SourceHook::CSourceHookImpl g_SourceHook;
SourceHook::ISourceHook *g_SHPtr;
String g_ModPath;
String g_BinPath;
SourceHook::String g_ModPath;
SourceHook::String g_BinPath;
PluginId g_PLID = Pl_Console; //Technically, SourceMM is the "Console" plugin... :p
bool bInShutdown = false;
bool bInFirstLevel = true;

View File

@ -78,10 +78,10 @@ extern EngineInfo g_Engine;
extern SourceHook::CSourceHookImpl g_SourceHook;
/** @brief Mod path (important!)*/
extern String g_ModPath;
extern SourceHook::String g_ModPath;
/** @brief Path to server binary */
extern String g_BinPath;
extern SourceHook::String g_BinPath;
/** @brief Global variable for SourceHook macros */
extern SourceHook::ISourceHook *g_SHPtr;

View File

@ -180,15 +180,6 @@
<File
RelativePath=".\resource.h">
</File>
<File
RelativePath=".\smm_list.h">
</File>
<File
RelativePath=".\smm_string.h">
</File>
<File
RelativePath=".\smm_vector.h">
</File>
<File
RelativePath=".\sourcemm.h">
</File>
@ -220,6 +211,9 @@
<Filter
Name="SourceHook"
Filter="">
<File
RelativePath="..\sourcehook\sh_string.h">
</File>
<File
RelativePath="..\sourcehook\sourcehook.cpp">
</File>