using std::vector;\r
using std::map;\r
\r
-map<string,MingwModuleHandler*>*\r
+map<ModuleType,MingwModuleHandler*>*\r
MingwModuleHandler::handler_map = NULL;\r
\r
FILE*\r
MingwModuleHandler::fMakefile = NULL;\r
\r
-MingwModuleHandler::MingwModuleHandler ( const char* moduletype_ )\r
+MingwModuleHandler::MingwModuleHandler ( ModuleType moduletype )\r
{\r
- string moduletype ( moduletype_ );\r
- strlwr ( &moduletype[0] );\r
if ( !handler_map )\r
- handler_map = new map<string,MingwModuleHandler*>;\r
+ handler_map = new map<ModuleType,MingwModuleHandler*>;\r
(*handler_map)[moduletype] = this;\r
}\r
\r
\r
/*static*/ MingwModuleHandler*\r
MingwModuleHandler::LookupHandler ( const string& location,\r
- const string& moduletype_ )\r
+ ModuleType moduletype )\r
{\r
- string moduletype ( moduletype_ );\r
- strlwr ( &moduletype[0] );\r
if ( !handler_map )\r
throw Exception ( "internal tool error: no registered module handlers" );\r
MingwModuleHandler* h = (*handler_map)[moduletype];\r
{\r
const Invoke& invoke = *module.invocations[i];\r
\r
- if ( invoke.invokeModule->etype != BuildTool )\r
+ if ( invoke.invokeModule->type != BuildTool )\r
throw InvalidBuildFileException ( module.node.location,\r
"Only modules of type buildtool can be invoked." );\r
\r
static MingwBuildToolModuleHandler buildtool_handler;\r
\r
MingwBuildToolModuleHandler::MingwBuildToolModuleHandler()\r
- : MingwModuleHandler ( "buildtool" )\r
+ : MingwModuleHandler ( BuildTool )\r
{\r
}\r
\r
static MingwKernelModuleHandler kernelmodule_handler;\r
\r
MingwKernelModuleHandler::MingwKernelModuleHandler ()\r
- : MingwModuleHandler ( "kernelmodedll" )\r
+ : MingwModuleHandler ( KernelModeDLL )\r
{\r
}\r
\r
static MingwStaticLibraryModuleHandler staticlibrary_handler;\r
\r
MingwStaticLibraryModuleHandler::MingwStaticLibraryModuleHandler ()\r
- : MingwModuleHandler ( "staticlibrary" )\r
+ : MingwModuleHandler ( StaticLibrary )\r
{\r
}\r
\r
class MingwModuleHandler\r
{\r
public:\r
- static std::map<std::string,MingwModuleHandler*>* handler_map;\r
+ static std::map<ModuleType,MingwModuleHandler*>* handler_map;\r
\r
- MingwModuleHandler ( const char* moduletype_ );\r
+ MingwModuleHandler ( ModuleType moduletype );\r
virtual ~MingwModuleHandler() {}\r
\r
static void SetMakefile ( FILE* f );\r
static MingwModuleHandler* LookupHandler ( const std::string& location,\r
- const std::string& moduletype_ );\r
+ ModuleType moduletype_ );\r
virtual void Process ( const Module& module ) = 0;\r
\r
protected:\r
\r
att = moduleNode.GetAttribute ( "type", true );\r
assert(att);\r
- stype = att->value;\r
- strlwr ( &stype[0] );\r
- etype = GetModuleType ( node.location, *att );\r
+ type = GetModuleType ( node.location, *att );\r
\r
att = moduleNode.GetAttribute ( "extension", false );\r
if (att != NULL)\r
string\r
Module::GetDefaultModuleExtension () const\r
{\r
- switch (etype)\r
+ switch (type)\r
{\r
case BuildTool:\r
return EXEPOSTFIX;\r