mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 21:13:01 +00:00
parse a module's files into a vector ( conditions are still a TODO )
svn path=/branches/xmlbuildsystem/; revision=12789
This commit is contained in:
parent
b6ce86818c
commit
ee24430c57
3 changed files with 67 additions and 1 deletions
|
@ -17,3 +17,34 @@ Module::Module ( const XMLElement& moduleNode,
|
|||
path(modulePath)
|
||||
{
|
||||
}
|
||||
|
||||
Module::~Module()
|
||||
{
|
||||
for ( size_t i = 0; i < files.size(); i++ )
|
||||
delete files[i];
|
||||
}
|
||||
|
||||
void
|
||||
Module::ProcessXML ( const XMLElement& e, const string& path )
|
||||
{
|
||||
string subpath ( path );
|
||||
if ( e.name == "file" && e.value.size() )
|
||||
{
|
||||
files.push_back ( new File(path + "/" + e.value) );
|
||||
}
|
||||
else if ( e.name == "directory" )
|
||||
{
|
||||
// this code is duplicated between Project::ProcessXML() and Module::ProcessXML() :(
|
||||
const XMLAttribute* att = e.GetAttribute ( "name", true );
|
||||
if ( !att )
|
||||
return;
|
||||
subpath = path + "/" + att->value;
|
||||
}
|
||||
for ( size_t i = 0; i < e.subElements.size(); i++ )
|
||||
ProcessXML ( *e.subElements[i], subpath );
|
||||
}
|
||||
|
||||
File::File ( const std::string& _name )
|
||||
: name(_name)
|
||||
{
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue