--- projects/cms/source/host/c++/XMLFormatter.h 2000/11/30 21:58:39 1.1 +++ projects/cms/source/host/c++/XMLFormatter.h 2002/05/21 16:47:11 1.6 @@ -1,21 +1,49 @@ -#include -#include +/* + * i-scream central monitoring system + * http://www.i-scream.org.uk + * Copyright (C) 2000-2002 i-scream + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +#include +#include + +using std::string; + class XMLFormatter { public: // public variables // public methods - void XMLFormatter( char* newHostInfo ); + XMLFormatter( string newHostInfo ); + XMLFormatter(); + XMLFormatter( string newHostInfo, string attributes); - char* returnXML(); + string returnXML(); void closeNest(); - void addNest(char* nest); - void addElement(char* element); + void addNest(string nest); + void addElement(string element, string value); + void addElement(string element, string attribute, string value); + void addString(string text){ xmlData += text; }; private: // private variables - char* xmlData; - char* hostInfo; + string xmlData; + string hostInfo; + string stack[50]; + int stackPointer; }; // end class \ No newline at end of file