From: Yurii R. <yr...@us...> - 2003-01-25 21:51:32
|
Update of /cvsroot/eas-dev/eas-dev/libs/libsxmlstream/src In directory sc8-pr-cvs1:/tmp/cvs-serv679/libs/libsxmlstream/src Modified Files: sxml.cxx Added Files: .cvsignore Makefile.am sxmlstream.cxx Log Message: a bit update to libsxmlstream; changes in build process; very small change in core-architecture-ru --- NEW FILE: .cvsignore --- Makefile.in Makefile *.o *.lo *.la .deps .libs --- NEW FILE: Makefile.am --- lib_LTLIBRARIES = libsxmlstream.la libsxmlstream_la_SOURCES = sxml.cxx sxmlstream.cxx INCLUDES = -I../include --- NEW FILE: sxmlstream.cxx --- /*******************************************************/ /* */ /* libsxmlstream */ /* */ /* Copyright (c) 2003. */ /* E/AS Software Foundation */ /* */ /* Author(s): */ /* Yurii A. Rashkovskii <yr...@op...> */ /* */ /* */ /* This program is free software; you can redistribute */ /* it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the */ /* Free Software Foundation; version 2 of the License. */ /* */ /*******************************************************/ /* $Id: sxmlstream.cxx,v 1.1 2003/01/25 21:51:28 yrashk Exp $ */ #include <sxmlstream.hxx> using namespace std; /* SXmlTextStream operators */ ostream& operator<<(ostream& os, const SXmlTextStream& s) { SXml e; while (!m_queue.empty()) { e = m_queue.front(); switch (e.type) { case SXml_Element_t: os << "(" << e.data << ")"; break; default: break; } m_queue.pop(); } return os; }; Index: sxml.cxx =================================================================== RCS file: /cvsroot/eas-dev/eas-dev/libs/libsxmlstream/src/sxml.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- sxml.cxx 25 Jan 2003 20:00:36 -0000 1.1 +++ sxml.cxx 25 Jan 2003 21:51:28 -0000 1.2 @@ -26,9 +26,9 @@ SXml SXml_create(SXml_t aType, string aData) { - SXml e = (SXml) malloc(sizeof(_SXml *)); - e->type = aType; e->data = aData; - e->childs = new vector(1); + SXml e; + e.type = aType; e.data = aData; + e.childs = new vector<SXml>(0); return e; } @@ -60,10 +60,28 @@ return e; } +/* SXml destruction */ + +void SXml_delete(SXml e) +{ + delete e.childs; +} + /* Childs operations */ void SXml_create_child(SXml e, SXml c) { - (e->childs)->push_back(c); + (e.childs)->push_back(c); +} + +string SXml_get_property(SXml e) +{ + if (SXml_has_property(e)) + { + return ((SXml)(e.childs)->at(0)).data; + } else + { + return 0; + } } |