Update of /cvsroot/eas-dev/eas-dev/libs/libsxmlstream/src
In directory sc8-pr-cvs1:/tmp/cvs-serv11498/libs/libsxmlstream/src
Modified Files:
Makefile.am sxml.cxx sxmlstream.cxx
Log Message:
Bugfixes, bugfixes.. descendants in SXmlNode now is not a pointer. Binary
stream test still fails, but IMHO the problem is in the test itself.
2Yurii: please have a look at libs/libsxmlstream/tests/BinaryStreamTest.h
Index: Makefile.am
===================================================================
RCS file: /cvsroot/eas-dev/eas-dev/libs/libsxmlstream/src/Makefile.am,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- Makefile.am 3 Feb 2003 06:30:47 -0000 1.5
+++ Makefile.am 3 Feb 2003 18:59:38 -0000 1.6
@@ -2,5 +2,5 @@
libsxmlstream_la_SOURCES = sxml.cxx sxmlstream.cxx ../include/sxml.hxx \
../include/sxmlstream.hxx ../include/sxmlhandler.hxx
INCLUDES = -I../include -I$(top_srcdir)
-CXXFLAGS = @GLIB_CFLAGS@
+CXXFLAGS = @GLIB_CFLAGS@ @CXXFLAGS@
libsxmlstream_la_LIBADD = @GLIB_LIBS@
Index: sxml.cxx
===================================================================
RCS file: /cvsroot/eas-dev/eas-dev/libs/libsxmlstream/src/sxml.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- sxml.cxx 3 Feb 2003 06:30:47 -0000 1.5
+++ sxml.cxx 3 Feb 2003 18:59:38 -0000 1.6
@@ -25,27 +25,6 @@
namespace openeas { namespace sxmlstream {
-SXmlNode::SXmlNode(const SXmlNode& v)
-{
- type=v.type;
- if (!(v.descendants)->empty())
- *descendants = *(v.descendants);
- else
- descendants = new list<SXmlNode>;
- data = v.data;
-}
-
-SXmlNode& SXmlNode::operator=(const SXmlNode& v)
-{
- type=v.type;
- if (!(v.descendants)->empty())
- *descendants = *(v.descendants);
- else
- descendants = new list<SXmlNode>;
- data = v.data;
- return *this;
-}
-
/* Factory functions */
SXmlNode SXmlNode::Attribute(string aName, string aValue)
Index: sxmlstream.cxx
===================================================================
RCS file: /cvsroot/eas-dev/eas-dev/libs/libsxmlstream/src/sxmlstream.cxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- sxmlstream.cxx 3 Feb 2003 06:30:47 -0000 1.9
+++ sxmlstream.cxx 3 Feb 2003 18:59:38 -0000 1.10
@@ -35,42 +35,20 @@
/* SXmlStream */
-SXmlStream::SXmlStream()
-{
- m_queue = new queue<SXmlNode>();
-}
-
-SXmlStream::~SXmlStream()
-{
- delete m_queue;
-}
-
bool SXmlStream::queueIsEmpty()
{
- return m_queue->empty();
+ return m_queue.empty();
}
-SXmlNode& SXmlStream::pop()
+SXmlNode SXmlStream::pop()
{
- SXmlNode *e = &(m_queue->front());
- m_queue->pop();
- return *e;
+ SXmlNode e = m_queue.front();
+ m_queue.pop();
+ return e;
}
-/* SXmlBinaryStream */
-
-SXmlBinaryStream::SXmlBinaryStream()
-{
- m_queue = new queue<SXmlNode>();
-}
-
-SXmlBinaryStream::~SXmlBinaryStream()
-{
- delete m_queue;
-}
-
#define BIN_LBRACKET "("
#define BIN_RBRACKET ")"
@@ -98,9 +76,9 @@
os << BIN_SIGN << BIN_PORTABLE_SIZE(e.data.length()) <<
e.data;
// Output attributes
- if (!(e.descendants)->empty()) {
- iter = (e.descendants)->begin();
- while (iter!=(e.descendants)->end())
+ if (!e.descendants.empty()) {
+ iter = e.descendants.begin();
+ while (iter!=e.descendants.end())
{
if (iter->isAttribute())
{
@@ -112,9 +90,9 @@
}
}
// Output descendants
- if (!(e.descendants)->empty()) {
- iter = (e.descendants)->begin();
- while (iter!=(e.descendants)->end())
+ if (!e.descendants.empty()) {
+ iter = e.descendants.begin();
+ while (iter!=e.descendants.end())
{
if (!iter->isAttribute())
{
@@ -180,17 +158,6 @@
/* SXmlTextStream */
-SXmlTextStream::SXmlTextStream()
-{
- m_queue = new queue<SXmlNode>();
-}
-
-SXmlTextStream::~SXmlTextStream()
-{
- delete m_queue;
-}
-
-
ostream& SXml_TextOutput(ostream& os, SXmlNode e)
{
SXmlNode_iterator iter;
@@ -199,9 +166,9 @@
case SXmlNode_Element_t:
os << "(" << e.data << " ";
// Output attributes
- if (!(e.descendants)->empty()) {
- iter = (e.descendants)->begin();
- while (iter!=(e.descendants)->end())
+ if (!e.descendants.empty()) {
+ iter = e.descendants.begin();
+ while (iter!=e.descendants.end())
{
if (iter->isAttribute())
{
@@ -213,9 +180,9 @@
}
}
// Output descendants
- if (!(e.descendants)->empty()) {
- iter = (e.descendants)->begin();
- while (iter!=(e.descendants)->end())
+ if (!e.descendants.empty()) {
+ iter = e.descendants.begin();
+ while (iter!=e.descendants.end())
{
if (!iter->isAttribute())
{
|