[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Usata-commits] Changes to usata2/src/xml/scene_parser.cpp
From: |
David Lau |
Subject: |
[Usata-commits] Changes to usata2/src/xml/scene_parser.cpp |
Date: |
Thu, 17 Feb 2005 21:24:34 -0500 |
Index: usata2/src/xml/scene_parser.cpp
diff -u usata2/src/xml/scene_parser.cpp:1.1 usata2/src/xml/scene_parser.cpp:1.2
--- usata2/src/xml/scene_parser.cpp:1.1 Wed Feb 16 06:30:02 2005
+++ usata2/src/xml/scene_parser.cpp Fri Feb 18 02:24:33 2005
@@ -10,23 +10,32 @@
// included in the software distribution, or visit
// http://www.fsf.org/licenses/gpl.html.
//
-// $Id: scene_parser.cpp,v 1.1 2005/02/16 06:30:02 skunix Exp $
+// $Id: scene_parser.cpp,v 1.2 2005/02/18 02:24:33 skunix Exp $
+
+#include <map>
+#include <iostream>
#include <boost/thread.hpp>
#include <boost/bind.hpp>
#include <boost/scoped_array.hpp>
-#include "scene_parser.hpp"
-#include <iostream>
+
#include <expat.h>
+
+#include "scene_parser.hpp"
+#include "scene_parser_elements.hpp"
+#include "../log.hpp"
+
namespace usata
{
-class SceneDocument
-: public SceneElement
+SceneElement::SceneElement(SceneElement*parent,
+ SceneParser*parser)
{
- SceneDocument(SceneParser *parser);
-};
+ mParent = parent;
+ mParser = parser;
+ return;
+}
SceneParser::SceneParser(std::istream& stream,
@@ -56,9 +65,14 @@
void
SceneParser::element_start(const char* name, const char**attrib)
{
+ if (mElements.empty())
+ {
+ SceneElement * ns = new SceneDocument(this);
+ ns->start_element(name,attrib);
+ mElements.push_back(ns);
+ return;
+ }
-
-
}
void SceneParser::element_end(const char*)
{
@@ -75,7 +89,6 @@
std::streamsize readlen;
std::streamsize x=0;
bool done(false);
-
void*buf;
while (!done)
@@ -100,7 +113,6 @@
SceneParser::threaded_parse()
{
mThread.reset(new
boost::thread(boost::bind(&SceneParser::thread_main,this)));
-
-
}
+
}