moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kvoctrain / kvoctrain / kvt-core / kvt-xml / XmlElement.cpp
blob7a950ef97528bc326cc7962d60dc284caa4d00cc
1 /* -*- C++ -*-
3 $Id$
5 This file is part of KIllustrator.
6 Copyright (C) 1998 Kai-Uwe Sattler (kus@iti.cs.uni-magdeburg.de)
8 modified for kvoctrain by Ewald Arnold kvoctrain@ewald-arnold.dein April ยด99
10 -----------------------------------------------------------------------
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU Library General Public License as
14 published by
15 the Free Software Foundation; either version 2 of the License, or
16 (at your option) any later version.
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
23 You should have received a copy of the GNU Library General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 #include <stdlib.h>
30 #include "XmlElement.h"
32 XmlAttribute::XmlAttribute (const KOXML_STRING& n, const KOXML_STRING& v) :
33 aname (n), value (v) {
37 XmlAttribute::XmlAttribute (const XmlAttribute& attr) :
38 aname (attr.aname), value (attr.value) {
41 XmlAttribute::~XmlAttribute () {
45 XmlAttribute& XmlAttribute::operator= (const XmlAttribute& attr) {
46 aname = attr.aname;
47 value = attr.value;
48 return *this;
52 float XmlAttribute::floatValue () const {
53 #ifndef KOXML_USE_STL
54 return atof (value.local8Bit());
55 #else
56 return atof (value.data());
57 #endif
61 int XmlAttribute::intValue () const {
62 #ifndef KOXML_USE_STL
63 return atoi (value.local8Bit());
64 #else
65 return atoi (value.data());
66 #endif
70 XmlElement::XmlElement () {
71 closed = false;
72 endTag = false;
76 XmlElement::XmlElement (const XmlElement& elem) :
77 tagId (elem.tagId), closed (elem.closed), endTag (elem.endTag),
78 attribs (elem.attribs) {
82 XmlElement::~XmlElement () {
86 void XmlElement::reset () {
87 tagId = "";
88 closed = false;
89 endTag = false;
90 attribs.erase (attribs.begin (), attribs.end ());
94 XmlElement& XmlElement::operator= (const XmlElement& elem) {
95 tagId = elem.tagId;
96 closed = elem.closed;
97 endTag = elem.endTag;
98 attribs = elem.attribs;
99 return *this;