X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fpbd%2Fpbd%2Fxml%2B%2B.h;h=e6795e5d455a0b2b9697322d8de57608ff562d64;hb=e3329000557015ce54691235769db8821e75666b;hp=9c3782e3c2bb4a1ce25446c5df75dc63662b3248;hpb=71b3c8cfe12fad319af00ba03f7746761a90b568;p=ardour.git diff --git a/libs/pbd/pbd/xml++.h b/libs/pbd/pbd/xml++.h index 9c3782e3c2..e6795e5d45 100644 --- a/libs/pbd/pbd/xml++.h +++ b/libs/pbd/pbd/xml++.h @@ -1,3 +1,25 @@ +/* + Copyright (C) 2012 Paul Davis + + 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., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#ifndef __XML_H +#define __XML_H + /* xml++.h * libxml++ and this file are copyright (C) 2000 by Ari Johnson, and * are covered by the GNU Lesser General Public License, which should be @@ -15,8 +37,7 @@ #include #include -#ifndef __XML_H -#define __XML_H +#include "pbd/libpbd_visibility.h" class XMLTree; class XMLNode; @@ -31,7 +52,7 @@ typedef XMLPropertyList::iterator XMLPropertyIterator; typedef XMLPropertyList::const_iterator XMLPropertyConstIterator; typedef std::map XMLPropertyMap; -class XMLTree { +class LIBPBD_API XMLTree { public: XMLTree(); XMLTree(const std::string& fn, bool validate = false); @@ -71,7 +92,7 @@ private: int _compression; }; -class XMLNode { +class LIBPBD_API XMLNode { public: XMLNode(const std::string& name); XMLNode(const std::string& name, const std::string& content); @@ -98,8 +119,8 @@ public: const XMLPropertyList& properties() const { return _proplist; } XMLProperty* property(const char*); XMLProperty* property(const std::string&); - const XMLProperty* property(const char* n) const { return ((XMLNode*)this)->property(n); } - const XMLProperty* property(const std::string& n) const { return ((XMLNode*)this)->property(n); } + const XMLProperty* property(const char* n) const { return const_cast(this)->property(n); } + const XMLProperty* property(const std::string& n) const { return const_cast(this)->property(n); } XMLProperty* add_property(const char* name, const std::string& value); XMLProperty* add_property(const char* name, const char* value = ""); @@ -129,7 +150,7 @@ private: void clear_lists (); }; -class XMLProperty { +class LIBPBD_API XMLProperty { public: XMLProperty(const std::string& n, const std::string& v = std::string()); ~XMLProperty(); @@ -143,7 +164,7 @@ private: std::string _value; }; -class XMLException: public std::exception { +class LIBPBD_API XMLException: public std::exception { public: explicit XMLException(const std::string msg) : _message(msg) {} virtual ~XMLException() throw() {}