cb5dae13b62ea55884b684df36f2fa64b53a9e14
12 FixSeparator ( const string
& s
)
15 char* p
= strchr ( &s2
[0], CBAD_SEP
);
19 p
= strchr ( p
, CBAD_SEP
);
24 Module::Module ( Project
* project
,
25 const XMLElement
& moduleNode
,
26 const string
& modulePath
)
30 path
= FixSeparator ( modulePath
);
32 const XMLAttribute
* att
= moduleNode
.GetAttribute ( "name", true );
36 att
= moduleNode
.GetAttribute ( "type", true );
38 type
= GetModuleType ( *att
);
40 att
= moduleNode
.GetAttribute ( "extension", false );
42 extension
= att
->value
;
44 extension
= GetDefaultModuleExtension ();
50 for ( i
= 0; i
< files
.size(); i
++ )
52 for ( i
= 0; i
< libraries
.size(); i
++ )
57 Module::ProcessXML ( const XMLElement
& e
,
60 string
subpath ( path
);
61 if ( e
.name
== "file" && e
.value
.size () )
63 files
.push_back ( new File ( FixSeparator ( path
+ CSEP
+ e
.value
) ) );
65 else if ( e
.name
== "library" && e
.value
.size () )
67 libraries
.push_back ( new Library ( e
.value
) );
69 else if ( e
.name
== "directory" )
71 const XMLAttribute
* att
= e
.GetAttribute ( "name", true );
73 subpath
= FixSeparator ( path
+ CSEP
+ att
->value
);
75 else if ( e
.name
== "include" )
77 Include
* include
= new Include ( project
, this, e
);
78 includes
.push_back ( include
);
79 include
->ProcessXML ( e
);
81 else if ( e
.name
== "define" )
83 Define
* define
= new Define ( project
, this, e
);
84 defines
.push_back ( define
);
85 define
->ProcessXML ( e
);
87 for ( size_t i
= 0; i
< e
.subElements
.size (); i
++ )
88 ProcessXML ( *e
.subElements
[i
], subpath
);
92 Module::GetModuleType ( const XMLAttribute
& attribute
)
94 if ( attribute
.value
== "buildtool" )
96 if ( attribute
.value
== "staticlibrary" )
98 if ( attribute
.value
== "kernelmodedll" )
100 throw InvalidAttributeValueException ( attribute
.name
,
105 Module::GetDefaultModuleExtension ()
116 throw InvalidOperationException (__FILE__
,
123 return FixSeparator (path
) + CSEP
+ name
+ extension
;
127 File::File ( const string
& _name
)
133 Library::Library ( const string
& _name
)