Move project to its own file.
Modified: branches/xmlbuildsystem/reactos/tools/rbuild/makefile
Added: branches/xmlbuildsystem/reactos/tools/rbuild/project.cpp
Modified: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.cpp
_____
Modified: branches/xmlbuildsystem/reactos/tools/rbuild/makefile
--- branches/xmlbuildsystem/reactos/tools/rbuild/makefile
2005-01-04 17:53:26 UTC (rev 12792)
+++ branches/xmlbuildsystem/reactos/tools/rbuild/makefile
2005-01-04 18:24:21 UTC (rev 12793)
@@ -4,7 +4,7 @@
all: $(TARGET)
-BASE_OBJECTS = xml.o module.o
+BASE_OBJECTS = xml.o project.o module.o
OBJECTS = $(BASE_OBJECTS) rbuild.o
_____
Added: branches/xmlbuildsystem/reactos/tools/rbuild/project.cpp
--- branches/xmlbuildsystem/reactos/tools/rbuild/project.cpp
2005-01-04 17:53:26 UTC (rev 12792)
+++ branches/xmlbuildsystem/reactos/tools/rbuild/project.cpp
2005-01-04 18:24:21 UTC (rev 12793)
@@ -0,0 +1,49 @@
+#ifdef _MSC_VER
+#pragma warning ( disable : 4786 ) // identifier was truncated to '255'
characters in the debug information
+#endif//_MSC_VER
+
+#include "rbuild.h"
+
+using std::string;
+using std::vector;
+
+Project::~Project()
+{
+ for ( size_t i = 0; i < modules.size(); i++ )
+ delete modules[i];
+}
+
+void
+Project::ProcessXML ( const XMLElement& e, const string& path )
+{
+ const XMLAttribute *att;
+ string subpath(path);
+ if ( e.name == "project" )
+ {
+ att = e.GetAttribute ( "name", false );
+ if ( !att )
+ name = "Unnamed";
+ else
+ name = att->value;
+ }
+ else if ( e.name == "module" )
+ {
+ att = e.GetAttribute ( "name", true );
+ if ( !att )
+ return;
+ Module* module = new Module ( e, att->value, path );
+ modules.push_back ( module );
+ module->ProcessXML ( e, path );
+ return;
+ }
+ 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 );
+}
_____
Modified: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.cpp
--- branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.cpp
2005-01-04 17:53:26 UTC (rev 12792)
+++ branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.cpp
2005-01-04 18:24:21 UTC (rev 12793)
@@ -12,47 +12,6 @@
using std::string;
using std::vector;
-Project::~Project()
-{
- for ( size_t i = 0; i < modules.size(); i++ )
- delete modules[i];
-}
-
-void
-Project::ProcessXML ( const XMLElement& e, const string& path )
-{
- const XMLAttribute *att;
- string subpath(path);
- if ( e.name == "project" )
- {
- att = e.GetAttribute ( "name", false );
- if ( !att )
- name = "Unnamed";
- else
- name = att->value;
- }
- else if ( e.name == "module" )
- {
- att = e.GetAttribute ( "name", true );
- if ( !att )
- return;
- Module* module = new Module ( e, att->value, path );
- modules.push_back ( module );
- module->ProcessXML ( e, path );
- return;
- }
- 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 );
-}
-
int
main ( int argc, char** argv )
{