2 * Copyright (C) 2005 Casper S. Hornstrup
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 AutoRegister::AutoRegister ( const Project
& project_
,
25 const Module
* module_
,
26 const XMLElement
& node_
)
27 : XmlNode(project_
, node_
),
34 AutoRegister::IsSupportedModuleType ( ModuleType type
)
36 if ( type
== Win32DLL
||
48 AutoRegister::GetAutoRegisterType( const string
& type
)
50 if ( type
== "DllRegisterServer" )
51 return DllRegisterServer
;
52 if ( type
== "DllInstall" )
56 throw XMLInvalidBuildFileException (
58 "<autoregister> type attribute must be DllRegisterServer, DllInstall or Both." );
62 AutoRegister::Initialize ()
64 if ( !IsSupportedModuleType ( module
->type
) )
66 throw XMLInvalidBuildFileException (
68 "<autoregister> is not applicable for this module type." );
71 const XMLAttribute
* att
= node
.GetAttribute ( "infsection", true );
74 throw XMLInvalidBuildFileException (
76 "<autoregister> must have a 'infsection' attribute." );
78 infSection
= att
->value
;
80 att
= node
.GetAttribute ( "type", true );
83 throw XMLInvalidBuildFileException (
85 "<autoregister> must have a 'type' attribute." );
87 type
= GetAutoRegisterType ( att
->value
);