From: Yurii R. <yr...@us...> - 2003-01-25 20:00:39
|
Update of /cvsroot/eas-dev/eas-dev/libs/libsxmlstream/src In directory sc8-pr-cvs1:/tmp/cvs-serv31727/libs/libsxmlstream/src Added Files: sxml.cxx Log Message: Moving main Makefile to root; Started `libsxmlstream' implementation --- NEW FILE: sxml.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: sxml.cxx,v 1.1 2003/01/25 20:00:36 yrashk Exp $ */ #include <sxml.hxx> using namespace std; /* SXml creation */ 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); return e; } SXml SXml_Element_create(string aName) { return SXml_create(SXml_Element_t, aName); } SXml SXml_Attribute_create(string aName, string aValue) { SXml e = SXml_create(SXml_Attribute_t, aName); SXml c = SXml_create(SXml_Attribute_t, aValue); SXml_create_child(e, c); return e; } SXml SXml_Char_create(string aData) { return SXml_create(SXml_Char_t, aData); } SXml SXml_Namespace_create(string aPrefix, string aURI) { SXml e = SXml_create(SXml_Namespace_t, aPrefix); SXml c = SXml_create(SXml_Namespace_t, aURI); SXml_create_child(e, c); return e; } /* Childs operations */ void SXml_create_child(SXml e, SXml c) { (e->childs)->push_back(c); } |